Assigning options within a class

Glenn Satchell Glenn.Satchell at
Thu Apr 10 14:33:13 UTC 2008

>Date: Thu, 10 Apr 2008 09:52:38 -0400
>From: "Norman Elton" <normelton at>
>To: dhcp-users at
>Subject: Assigning options within a class
>I'm trying assign specific options to MAC addresses from a given
>vendor. My first attempt has been unpredictable:
>I've got two subnets, each with two variations on the "controller"
>option. It appears that clients in one subnet are getting the values
>assigned in another subnet, if this makes any sense.
>Surely there is a "correct" way of doing this. Any ideas?
>Norman Elton
A client can be a member of more than one class. When it gets its class
membership it also inherits from the scope of that class. Generally
classes are defined in the global scope to avoid this problem.

So a client with a mac address that matches 00:0b:85 will be a member
of treyburn-ap-1000 and pen-ap-1000. And it will inherit options from
the enclosing subnet definition. Asboth classes define the controller
option then there is a potential for either option to be set. It's
probably necessary to look at the source code to work out which value
is likely to be chosen in this case.

I think in your case a simpler solution might be to use if statements
within the subnet (see dhcp-eval man page) something like

subnet netmask {
        option subnet-mask    ;
        option routers        ;
        default-lease-time              86400; # 1 day
        max-lease-time                  86400; # 1 day

        if substring (hardware, 1, 3) = 00:0b:85 {
                option controller = ",,";
        } elsif substring (hardware, 1, 3) = 00:1d:a1 {
                option controller = f1:08:0a:46:00:97:0a:46:00:98;

        range ;

and similarly for the other subnet.


More information about the dhcp-users mailing list