[Kea-users] Lease affinity of released leases

Johannes Midgren johannes at midgren.net
Wed Nov 10 13:47:21 UTC 2021


TLDR: How do I make KEA offer the same IP to a host that is rebooted and
that releases its IP address while shutting down?

I have recently started to use KEA on my home network. I love the fact that
I can control its configuration through Ansible and all the possibilities
the REST API gives, so I'm very glad that I found the project!

One thing that I still have not been able to get the way I prefer it
though, is to have lease affinity in all cases. That is, I would like for a
client to always get the same IP address when it reconnects (as long as
it's still available of course). I have read the chapter about Lease
Expiration (and Affinity) in the manual and I'm not sure the case I'm
looking for is covered. The manual talks about expired leases, but I would
like to have affinity also in the case that the lease has been released
rather than expired. Using a packet sniffer I can see that clients tend to
properly release the DHCP lease when being rebooted and when it gets online
again it does a DHCP Discover and is offered a new IP address by the KEA
DHCP4 server.

Does anyone know if KEA is supposed to (or rather can be made to) work the
way I intend it to or if lease affinity by design is only supposed to work
for expired, thus not released, leases? (Or maybe something is wrong with
my setup and this should actually work?)

The problem I have is that cached DNS entries make hosts unavailable for
some time after they are restarted - they are "sought for" by their old IP.
I guess I can mitigate the issue by setting a very low TTL in my DNS
configuration, but I would prefer to let KEA hold leases for a long time
and reuse them instead. Another way would of course be to make reservations
for all hosts where this matters, but that prevents the automation that I
try to use KEA for.

I have been playing with the expired-leases-processing configuration for
the DHCP4 server, and I currently have this:

       "expired-leases-processing": {
           "flush-reclaimed-timer-wait-time": 300,
           "hold-reclaimed-time": 604800,
           "max-reclaim-leases": 100,
           "max-reclaim-time": 250,
           "reclaim-timer-wait-time": 180,
           "unwarned-reclaim-cycles": 5
       },

I'm running KEA 1.8 (installed from CloudSmith repos) on CentOS Stream 8. I
use the memfile lease-database, have DHCP-DDNS setup and I use the HA hook
(with one primary, one standby and one backup host).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20211110/ed19e9f0/attachment-0001.htm>


More information about the Kea-users mailing list