host-identifier and option 82

Christian Kratzer ck-lists at cksoft.de
Sat Jan 28 12:19:40 UTC 2012


Hi,

On Fri, 27 Jan 2012, Ed Ravin wrote:

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

the hack to use a separate class and pool for each switchport is no
longer necessary sind isc dhcp has backported host-identifier from
dhcpv6. Sadly the web is full of howtos how to set this up with classes
and ranges.

As an example for the archives you can do things like this since isc
dhcp version 4 something:

 	host foo {
 	    host-identifier option agent.circuit-id "foo";
 	    fixed-address 192.0.2.17;
 	}

This will work fine whatever the client mac is and even if it changes as
it uses host-identifier and not mac as identity.

I have used above in an ISP environment with each customer identified
by the layer2 switchport they connect to.  The dhcp snooping feature in
cisco switches inserts the relay agent options at the customer
switchport and also seems to handle the subsequent unicast dhcp packets.

Greetings
Christian


> 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.
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users

-- 
Christian Kratzer                      CK Software GmbH
Email:   ck at cksoft.de                  Wildberger Weg 24/2
Phone:   +49 7032 893 997 - 0          D-71126 Gaeufelden
Fax:     +49 7032 893 997 - 9          HRB 245288, Amtsgericht Stuttgart
Web:     http://www.cksoft.de/         Geschaeftsfuehrer: Christian Kratzer



More information about the dhcp-users mailing list