how to config class

Simon Hobson dhcp1 at thehobsons.co.uk
Thu Nov 21 15:42:33 UTC 2013


"Stier, Matthew" wrote:
> Order?
> As written, both classes are true, so the later one overwrites the settings of the prior one.


No, order is not significant within the config file - at least, not in that way for class definitions. Some things are evaluated in a specific order, but that is implementation dependent and may change at any time without warning.


>  I need most subnets PXE server ip address as 10.1.1.10, and only subnet 10.2.2.0/24 need PXE server address as 10.2.2.10
> How can I write the class statement using two classes. I have tried netboot from my laptop on ip 10.2.2.100, but, I still get server-identifier 10.1.1.10.

> could anyone advice what I did wrong?

It's messy (especially if you start to extend it), but re-write the main class so as to exclude the other devices :

class ...
 match if A and B

class ...
 match if A and not B

In this case, A issubstring( option vendor-class-identifier, 0, 9 ) = "PXEClient" and B isbinary-to-ascii(10,8, ".", packet(24,4)) = "10.2.2.1"


More information about the dhcp-users mailing list