how respond only to specific clients

Simon Hobson dhcp1 at thehobsons.co.uk
Thu Jun 22 16:04:19 UTC 2006


Douglas Sterner wrote:

>Trying to use the dhcp-client-identifier option to only give out IP's to
>authorized workstations. Well the short story is it doesn't work. My
>clients all have Internal as there DCI but are unable to get an address
>with this config. Do I need to use pools, the man pages have been vague on
>examples. In addition dhcp-client-identifier, 0, 3 where can I find out
>what the 0 and 3 mean, I haven't found a good reference as of yet.
>
>#192.168.40.X Network
>class "Internal" {
>   match if substring (option dhcp-client-identifier, 0, 3) = "Internal";
>}
>subnet 192.168.40.0 netmask 255.255.254.0 {
>         pool {
>                 option netbios-node-type 8;
>                 ddns-updates on;
>                 range 192.168.41.120 192.168.41.245;
>                 option subnet-mask 255.255.254.0;
>                 option routers 192.168.40.1;
>                 allow members of "Internal";
>               deny unknown-clients;
>               authoritative;
>         }

Try this, though as Glenn points out, you may find you need to start 
at character 1 instead of 0.

class "Internal" {
   match if substring (option dhcp-client-identifier, 0, 8) = "Internal";
}
subnet 192.168.40.0 netmask 255.255.254.0 {
   authoritative;
   option netbios-node-type 8;
   ddns-updates on;
   option subnet-mask 255.255.254.0;
   option routers 192.168.40.1;
   pool {
     range 192.168.41.120 192.168.41.245;
     allow members of "Internal";
   }
}


Glenn wrote:

>The substring operator is described in the dhcp-eval man page. The 0,3
>describe the offset and length, so a substring of length 3 can never
>equal "Internal". You probably want to just drop the whole substring bit
>and use something like this:
>
>#192.168.40.X Network
>class "Internal" {
>   match if option dhcp-client-identifier = "Internal";
>}

No, that WILL NOT WORK. If the clients give "Internal" as their 
client ID then they will all get the same IP address.

Simon


More information about the dhcp-users mailing list