<div dir="ltr"><div>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?<br></div><div><br></div><div>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!</div><div><br></div><div>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.<br></div><div><br></div><div>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?)<br></div><div><br></div><div>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.<br></div><div><br></div><div>I have been playing with the expired-leases-processing configuration for the DHCP4 server, and I currently have this:<br></div><div><br></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"> "expired-leases-processing": {
</span><br> "flush-reclaimed-timer-wait-time": 300,
<br> "hold-reclaimed-time": 604800,
<br> "max-reclaim-leases": 100,
<br> "max-reclaim-time": 250,
<br> "reclaim-timer-wait-time": 180,
<br> "unwarned-reclaim-cycles": 5
<br> },<br>
<br></span></div><div>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).<br></div></div>