[Kea-users] dnsmasq-style address allocation
Wilhelm Schuster
lists+kea at rot13.io
Fri Aug 9 08:32:18 UTC 2024
Hi list,
I'm evaluating switching from OpenWRT to VyOS on my main home network
router setup. VyOS integrates kea as DHCPv4 server whereas OpenWRT
relies on dnsmasq.
dnsmasq implements an interesting address allocation strategy which I
like quite a bit. Here is how its manpage describes it [1]:
Dnsmasq is designed to choose IP addresses for DHCP clients using a
hash of the client's MAC address. This normally allows a client's
address to remain stable long-term, even if the client sometimes
allows its DHCP lease to expire. In this default mode IP addresses
are distributed pseudo-randomly over the entire available address
range.
Here is a link to the source code: [2]
I'm a fan of that strategy as it keeps host addresses somewhat stable
even after leases have expired. I've scoured the kea manual, but was
unable to find a suitable strategy: the random allocator does not appear
to use the client MAC address (from a brief look at the kea source). If
there is no built-in way to mimic the allocation strategy, is there the
possibility to implement a custom allocator as a plugin or hook, or does
that require forking the codebase?
[1]: https://man.archlinux.org/man/dnsmasq.8#dhcp-sequential-ip
[2]:
https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=blob;f=src/dhcp.c;h=b65facd8707b03919d6f78afd2ea8dd25078e5e9;hb=HEAD#l790
Cheers, Wilhelm.
More information about the Kea-users
mailing list