DHCP and 2 subnets

Simon Hobson dhcp1 at thehobsons.co.uk
Thu Apr 10 20:28:02 UTC 2008


Chris Arnold wrote:

>Ok, so here is my dhcp.conf file. Is it in the correct syntax:
>option domain-name "domain here";
>option domain-name-servers 192.168.123.x;
>option ntp-servers 192.168.123.x;
>ddns-update-style none;
>default-lease-time 14400;
>max-lease-time 172800;
>class "123 DHCP Clients" {
>          match pick-first-value (option dhcp-client-identifier, hardware);
>        }
>
>        subclass "123 DHCP Clients" 1:8:0:2b:4c:39:ad;
>        subclass "123 DHCP Clients" 1:8:0:2b:a9:cc:e3;
>        subclass "123 DHCP Clients" 1:0:0:c4:aa:29:44;
>
>        subnet 192.168.123.x netmask 255.255.255.0 {
>          pool {
>            allow members of "123 DHCP Clients";
>            range 192.168.123.x 192.168.123.x;
>          }
>        }
>
>A couple of things i don't understand is what is the match 
>pick-first-value (option dhcp-client-identifier, hardware);
>If i want to match MAC's, do i need this?

It does what it's name suggests, it picks the first value (ie not 
null) from the list - so it would pick the client id if provided, and 
fall back to MAC address if client id wasn't provided. In your case 
you do NOT want this as you only want to match on MAC address :
   match  hardware;

>Do i need to do this for both subnets? If it already gives out on 
>192.168.124 network, why would i have to include that network in 
>this file?

No, you don't need to do this for the 124 subnet, BUT you do need to 
exclude your 123 subnet clients from the 124 subnet. You see, the 
above is sufficient to allow the listed clients, and only the listed 
clients, to get an address in the 123 subnet, but it doesn't prevent 
them getting an address in the 124 subnet - so you need to add 
something like this :

        subnet 192.168.124.x netmask 255.255.255.0 {
          pool {
            deny members of "123 DHCP Clients";
            range 192.168.124.x 192.168.124.x;
          }
        }




More information about the dhcp-users mailing list