Latest lease entry not the one offered to the client

glenn.satchell at uniq.com.au glenn.satchell at uniq.com.au
Wed Aug 26 10:22:01 UTC 2020


Just to add to Niall's useful reply, the lease file format is documented 
in the dhcpd.leases(5) man page.

regards,
-glenn

On 2020-08-26 19:58, Niall O'Reilly wrote:
> I haven't seen follow-up to this yet, so here is my tuppence-worth.
> 
> On 18 Aug 2020, at 4:07, ksladic wrote:
> 
>> Regarding lease file cleanup:
>> 1. Does it remove all expired leases?
> 
> No, because removing them would not be consistence with the
> service definition [1]:
> 
> "The
> allocation mechanism (the collection of DHCP servers) guarantees not
> to reallocate that address within the requested time and attempts to
> return the same network address each time the client requests an
> address." (My emphasis)
> 
> This means that an expired lease should be retained for use in case
> the
> client ever requests it again.
> 
>> * Does it remove duplicate leases ... keeping only last valid one?
> 
> Yes, but a lease is identified for this purpose by its IP address,
> not by any property of the client, such as MAC address or UUID,
> or so I recall.
> 
> It follows that an expired lease which, because of depletion of the
> lease pool, is assigned to a different client, may lose its
> association
> with an earlier client.
> 
>> * In general (before or after lease file cleanup) if I would like
>> to find the latest valid leased IP for a client, is it best to go
>> through whole file and pick valid lease with latest timestamp?
>> Because as I understand I can not rely on the order of leases in the
>> file.
> 
> It's easy but tedious to write a script to do this. I may have one
> which was
> once in production in some backup somewhere, but you can probably code
> one
> faster than I could find it again.
> 
> I hope this helps.
> 
> Niall O'Reilly
> 
> Links:
> ------
> [1] https://tools.ietf.org/html/rfc2131#section-2.2
> _______________________________________________
> ISC funds the development of this software with paid support
> subscriptions. Contact us at https://www.isc.org/contact/ for more
> information.
> 
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users


More information about the dhcp-users mailing list