using option 82 to assign a static ip-address

Nico De Ranter nico.deranter at esaturnus.com
Sun Dec 16 20:02:31 UTC 2012


On Sun, Dec 16, 2012 at 6:04 PM, Peter Rathlev <peter at rathlev.dk> wrote:

> 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.
>

strange, I had to increase the first substring from 6 to 7 otherwise the
last character wouldn't match.


> >
> > 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.
>
> Yep, it does log the discover. But that's about all it logs

[Dec 16 21:52:22][info][mgt][dhcpd][-]:  Lease for 84:78:ac:84:e5:80 remote
id e hardware 1:0:14:2d:40:f:15
[Dec 16 21:52:22][info][mgt][dhcpd][-]:  DHCPDISCOVER from
00:14:2d:40:0f:15 via eth0: unknown client

The first line is my log statement.  If I change anything in the class so
it doesn't match anymore I get something like this in stead (I only want to
use static addresses)

[Dec 16 21:51:08][err][mgt][dhcpd][-]:  DHCPDISCOVER from 00:1b:21:28:7f:66
via eth0: network 10.103.0/24: no free leases

Nico


-- 
Nico De Ranter

Operations Engineer


eSATURNUS

T. +32 16 40 12 82

M. +32 497 91 53 78

www.esaturnus.com


<http://www.esaturnus.com/>


 <http://vcard.esaturnus.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20121216/f0a484ce/attachment.html>


More information about the dhcp-users mailing list