Isc dhcp class with more match

dhcpisc-dhcp

Is there any way to define more matches with OR?

I would like to create a class with a mac address check, like

class "fixVms" {
match if substring (hardware, 1, 4) = 00:15:5d:aa;
}

but I would like to add another macs to it, like

subclass "fixVms" 1:00:15:5d:bb:00:00;

I tried to add

match pick-first-value (option dhcp-client-identifier, hardware);

to the class body but it did not work. The 2 things separetly does work.

Best Answer

I haven't been able to test it myself, and the DHCPD.conf man page isn't that great, but you could try something like the following:

match if ( substring(hardware,1,3) = 00:01:e6 ) or
         ( substring(hardware,1,3) = 00:60:b0 ) or
         ( substring(hardware,1,3) = 00:10:83 );

This came from the following mailing list message

http://marc.info/?l=dhcp-server&m=102521117221954&w=2

Related Topic