using option 82 to assign a static ip-address

Peter Rathlev peter at rathlev.dk
Sun Dec 16 17:04:05 UTC 2012


On Sun, 2012-12-16 at 16:09 +0100, Nico De Ranter wrote:
> substring = substring fomr charcter x to character y (not y characters
> long).  So substring( ... 2,7) is 6 bytes long, substring( ..., 5,5)
> is 1 character long as expected.  I'm actually using the same
> substrings in my log statement (not included below) and it prints
> exactly the parts I want.

It's substring(string, offset, length). Take a look at man dhcp-eval to
confirm. I only run dhcp-4.x but as far as I can see via Google it was
the same in 3.1.1.
> 
> Why am I converting to ascii? Because that's what I found in an
> example. I tried without converting but then I didn't seem to get a
> match. :-).  I'm not so worried about performance as there will be
> about 100 clients max anyway.

Not converting to ASCII means better performance but also that you don't
have to worry about single or double digit bytes as Sten pointed out. It
can work fine with the conversion though.
> 
> As you can see at the bottom of my initial mail I'm actually
> reasonably sure the class definition is correct as I also have a log
> statement (not included below) which logs a message when the right
> client does a dhcp request. If a change anything in the class
> definition or remove the 'allow ...' from the pool or if another
> client tries to do dhcp it doesn't log.   So it seems the dhcp server
> does properly match the client's option 82 info and MAC address, it
> just doesn't seem to do anything with it.

What does syslog messages from dhcpd say? Does it log the DISCOVER?
Maybe it says something about why it doesn't hand out a lease.

-- 
Peter




More information about the dhcp-users mailing list