Subclasses and Scope

Glenn Satchell glenn.satchell at
Wed Sep 21 14:19:25 UTC 2011

On 09/21/11 06:52, Michael Dahlberg wrote:
> I'm trying to configure my dhcpd server to provide different boot
> options to systems based on vendor options and MAC addresses.  I would
> like most systems with a specific vendor-class-identifier to be given
> one tftp server, but another system with the same
> vendor-class-identifier and the MAC address 00:02:03:ab:cd:ef should
> be given a different tftp server.  The relevant parts of the config
> file are listed below:
> class "engineering" {
>       match if (option vendor-class-identifier="SimpleAsciiString");
>       option root-path "server:/var/net/boot";
>       filename "tftpboot.simple";
> }
> subclass "engineering" 1:00:02:03:ab:cd:ef {
>       option root-path "anotherserver:/var/net/boot";
>       filename "tftpboot.complex";
> }
> Assuming that the root-paths and filenames are correct, will these
> statements do what I'm trying to accomplish?  If not, can you
> recommend a different method?
> Thanks,
> Mike

That subclass wopn't work because when you define the class you say

match something;

then in the subclass definition you have to list the value of the something.

eg \

class "engineering" {
   match hardware;
subclass "engineering" 1:00:02:03:ab:cd:ef {
subclass "engineering" 1:00:02:03:04:04:06 {

In this case you can do a host statement for that mac address and add 
the variables to that. host statement has higher preference than class. 
If you created a second class for that mac address there are no 
guarantees about the  order the classes are evaluated.

host "engineering-special" {
   hardware ethernet 0:02:03:ab:cd:ef;
   option root-path "anotherserver:/var/net/boot";
   filename "tftpboot.complex";

Glenn Satchell                            |  Miss 9: What do you
Uniq Advances Pty Ltd, Sydney Australia   |  do at work Dad?
mailto:glenn.satchell at         |  Miss 6: He just tel:0409-458-580   |  types random stuff.

More information about the dhcp-users mailing list