Latest lease entry not the one offered to the client

Niall O'Reilly niall.oreilly at ucd.ie
Wed Aug 26 09:58:41 UTC 2020


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](https://tools.ietf.org/html/rfc2131#section-2.2):

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

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

> 3. 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20200826/fcf7af94/attachment.htm>


More information about the dhcp-users mailing list