how to set class attributes for a host or group instead of a pool?

Steve Rikli sr at genyosha.net
Wed Nov 6 15:54:12 UTC 2013


Our DHCP is composed of groups of known hosts in multiple subnets,
with fixed-address assignments based on hardware ethernet addresses.

I'd like to use functionality similar to this typical example:

  class "pxeclients" {
     match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
     next-server <tftp server>;
     filename "pxelinux.0";
  }

with allow/deny as needed; but it seems that global class can only be
applied to pools with ranges, rather than a host or group of hosts.

So today to enable pxebooting we usually add next-server & filename to a
host{} (e.g. for a re-install situation) or to a group{} (e.g. when
bringing up a new subnet or installing a new batch of clients, etc.).
This works well enough, but gets cumbersome.

Recently, we've added a new batch of hosts with UEFI as well as a legacy
BIOS mode, so we're likely to need something more complex, e.g.:

  match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
     next-server <tftp server>;
     if option arch = 00:06 {
       filename "bootia32.efi";
       }
     else if option arch = 00:07 {
       filename "bootx64.efi";
       }
     else {
       filename "pxelinux.0";
     }

which seems unwieldy to replicate in groups and individual hosts.

Is there a more elegant way to define a global "class"-like function,
potentially with multiple matches and if-then conditions, yet still be
able to selectively enable/disable it for given groups and individual
hosts, without replicating the whole block of code everywhere?

Cheers,
sr.


More information about the dhcp-users mailing list