1828676 Members
2209 Online
109984 Solutions
New Discussion

creating a dhcp class

 
SOLVED
Go to solution
John Waller
Esteemed Contributor

creating a dhcp class

I am trying to create a dhcp class in the dhcpd.conf file based on the first 3 bits of a MAC address.

We have to configure a large number of mobile devices which all have a MAC address starting 00:a0:f8. I want to create a class based on this information so I can alloacte a sperate IP range and also a short default lease time.

A "tcpdump -lenx -s 1500 port 67 | dhcpdump" command give the following information as part of a dhcprequest packet:

OPTION: 61 ( 7) Client-identifier 0100a0f827540b

but using an entry:
match if substring(option dhcp-client-indentifier, 0, 10) = "0100A0F8"

does not work.

1 REPLY 1
Stuart Browne
Honored Contributor
Solution

Re: creating a dhcp class

Umm.. lets see..

substring takes two paramters, an offset, and a length.

Now, given that you are grabbing 10 characters of the 'dhcp-client-identifier', and comparing it against only 8 digits, I'm picking you'll never get a match.

Try using a length of '8', i.e.:

match if substring(option dhcp-client-identifier, 0, 8) = "0100A0F8"

Or bugger off dhcp-client-identifier, and just use:

match if substring(hardware, 0, 8) = "0100A0F8"

If these still fail, show us a bit more of your dhcpd.conf than just this one line.
One long-haired git at your service...