Dear VyOs Team,
we appreciate the good working kea DHCP server very much - however, one minor detail is basically completely breaks it for us (I can’t think of why others wouldn’t need this tbh):
A host that reboots gets assigned a new IP address after the boot (randomly).
This is due to kea immediately deleting a lease after a host sends DHCPRELEASE due to shutdown.
Most others (even kea by default) reserves a released IP for a short period of time to catch exactly the “reboot” case.
By default, kea holds released leases for 3600 seconds (1 hour), this is defined in the default config even available in vyos: /etc/kea/kea-dhcp4.conf
// Setup reclamation of the expired leases and leases affinity. // Expired leases will be reclaimed every 10 seconds. Every 25 // seconds reclaimed leases, which have expired more than 3600 // seconds ago, will be removed. The limits for leases reclamation // are 100 leases or 250 ms for a single cycle. A warning message // will be logged if there are still expired leases in the // database after 5 consecutive reclamation cycles. // If both "flush-reclaimed-timer-wait-time" and "hold-reclaimed-time" are // not 0, when the client sends a release message the lease is expired // instead of being deleted from the lease storage. "expired-leases-processing": { "reclaim-timer-wait-time": 10, "flush-reclaimed-timer-wait-time": 25, "hold-reclaimed-time": 3600, "max-reclaim-leases": 100, "max-reclaim-time": 250, "unwarned-reclaim-cycles": 5 },
Sadly, the vyos-kea running config contains none of these (sane default) settings.
There are two possible solutions for this:
- low-effort: add the defaults that kea proposes to the running config - but: this changes behaviour for all vyos instances when upgrading, may not be desirable?
- add config option
- a dhcp-server option “set service dhcp-server keep-expired-leases 3600” that adds all these defaults settings with the
hold-reclaimed-timebeing set as specified (or adds none of those if set to 0) - dhcp-server options for each of those variables
- a dhcp-server option “set service dhcp-server keep-expired-leases 3600” that adds all these defaults settings with the
In my opinion it makes most sense to go with option 2.1 - it keeps the current behaviour for everyone when upgrading (since default value is 0), but allows for a sysadmin to easily “enable temporary reserving of expired leases”.
I think this is a very straightforward feature to add with lots of practical use case. If accepted, I can go ahead and try to implement/PR it myself (experienced in python and systems, but have never worked on vyos source myself).
Thank you very much!