LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   IP range for a group in dhcpd.conf (https://www.linuxquestions.org/questions/linux-server-73/ip-range-for-a-group-in-dhcpd-conf-781504/)

designator 01-11-2010 11:53 AM

IP range for a group in dhcpd.conf
 
Is there any way to associate a group to subnet in dhcpd.conf?
I want hosts in a specific group to be locked to an IP range defined in subnet.

Something like this:
Code:

authoritative;
ddns-update-style ad-hoc;

subnet 192.168.0.0 netmask 255.255.255.0 {
    range 192.168.0.1 192.168.0.100;
    option blah1;
    option blah2;
}

subnet 192.168.0.0 netmask 255.255.255.0 {
    range 192.168.0.101 192.168.0.200;
    option blah3;
    option blah4;
}

group {
# How do a link this group to range 1-100?
    host test1 { hardware ethernet 00:11:22:33:44:55; }
    host test2 { hardware ethernet 00:22:22:33:44:66; }
}

group {
# How do a link this group to range 101-200?
  host test3 { hardware ethernet 00:22:55:66:99:88; }
  host test4 { hardware ethernet 00:33:77:11:22:44; }
}

Thanks in advance.

designator 01-11-2010 05:25 PM

I think I solved my problem with the following, but it seems really ugly and will contain a lot of repetitions of mac addresses between host definitions and subclasses. Is there a better way to do this?

Any suggestions welcome.
Thanks.

Code:

ddns-update-style interim;

class "static" {
        match hardware;
}

subclass "static" 1:00:22:44:66:88:99;

class "dynamic" {
}

subclass "dynamic" 1:00:11:22:33:44:55;

subnet 192.168.0.0 netmask 255.255.255.0 {
        pool {
                allow members of "dynamic";
                range 192.168.0.10 192.168.0.89;
        }

        pool {
                allow members of "static";
                range 192.168.0.90 192.168.0.100;
        }

        pool {
                allow unknown-clients;
                range 192.168.0.101 192.168.0.200;
        }
}

group {
        host test {
                hardware ethernet 00:22:44:66:88:99;
                fixed-address 192.168.0.10;
        }
}



All times are GMT -5. The time now is 06:42 PM.