host-identifier and option 82

Ed Ravin eravin at panix.com
Fri Jan 27 19:31:01 UTC 2012


On Fri, Jan 27, 2012 at 12:56:05PM +0100, Michal Vančo wrote:
> The reason I'm using static host decls is to allow clients to
> change their MACs "freely" which is not possible with normal lease
> (client must wait until lease expires). Please see my later post
> regarding this

I had a similar requirement for a site where we wanted one device
per switch port to receive a DHCP address, and we also wanted the
IP addresses to stay linked to the same switch ports.

I was able to use Option 82 processing to get the one IP per switch
port set up (a big mess of class statements, one per switch port,
each with its own one-IP address pool), but we ran into the same
problem when the client changed their MAC address.  The lease for
the one IP on that port was already taken, so when the client changed
devices, they couldn't get an IP address until the old lease expired.

We ended up writing a separate daemon to monitor "link down" events
from the switches.  The daemon looks up the lease associated with
the port that just went down, and then uses the OMAPI to "free" [*]
the lease.  When the link comes back up a few seconds later, with the
new client device with the different MAC address plugged in, the
old lease has been freed and the new device smoothly obtains the
lease for the desired IP address.

	-- Ed

[*] actually, you can't directly free a lease with OMAPI, but you
can set its state to free and modify the lease expiration time to
the current time, which has the same effect.



More information about the dhcp-users mailing list