Migrating for ISC DHCPd to ...?

Started by devilkin, Today at 06:16:39 PM

Previous topic - Next topic
Hi,

I'm currently running dhcpd for ipv4 and ipv6 (+ SLAAC). I'm trying to figure out what the best thing to migrate to is.

My setup is small (home), with 6 VLANs, and what I use is:

* ipv4 dynamic leases + registration in unbound
* ipv4 static leases (reservations) + registrations in unbound
* ipv6 dynamic leases
* ipv6 static leases
* unbound overrides for a bunch of hostnames

(I'm not entirely sure if the ipv6 addresses get registered in unbound.)

What I'd like is that the leases and static reservations I put end up in "a" DNS server (can be unbound, can be dnsmasq), and ofcourse dhcp leases for all my vlans.

First I thought Kea, but I found out that those lease registrations towards unbound require an unbound restart(?) before they get picked up. So I'm guessing for my home setup dnsmasq makes more sense?

Thanks for any and all suggestions.

Kind regards

DNSMASQ + radvd is my go to setup.  It's a bit complex, but has the added benefits shown at the bottom of this copied + pasted post from the 26.1 release subforum:

I'll use fd00::/64 as my sample ULA prefix for this example, sub in your prefixes as you see fit

1.) Set a ULA Virtual IP with a /64 on the interface(s) where you want ULA stable addressing (eg: fd00::1/64; fd01::1/64 etc.).  Reboot so that the IPs are correctly applied to your interfaces.  I ran into an issue where rebooting was the only way to get this to apply correctly.

2.) Set RADVD to "assisted", configure other options as you see fit; set router advertisement prio to "high" in radvd

3.) In DNSMASQ set up a DHCP range for your interface(s) as shown below.

Interface: Your interface for the ULA assignment (eg: where the virtual IP is set).
Start Address: Set the ULA Prefix + Start address of your desired range (ex: fd00::1000)
End Address: Set the ULA Prefix + End address of your desired range (ex: fd00::2000)
Constructor: None
Prefix Length: 64
RA Mode: ra-names
RA Prio: Normal

4.) Reboot your clients to force soliciting new addresses if needed.


Set the rest of the settings for the lease time etc. as needed for your environment.  The net result is as follows:

1.) My clients receive only SLAAC GUAs.  The prefix assigned by my ISP is in practice not stable, thus DHCPv6 is not a great client option for the GUA.  I also prefer radvd for announcements as it also sends a shutdown, deprecate and remove route announcement if a prefix changes.  The shutdown, deprecate announcement and remove route options are configurable in the advanced settings of radvd per interface.  Note that it is also possible to configure DHCPv6 for both the ULA and GUA.  However, given most ISPs GUAs are not stable, I went with the route described in this post.

2.) My clients also receive a SLAAC ULA and, if client is able, a DHCPv6 ULA.

3.) Local name resolution for IPv6 will only return ULAs.  A lookup of a local client will return either the SLAAC IP, the DHCPv6 IP, or both.

4.) Set DNS forwarding for your interface's domains in Unbound to "forward first" to your interface's IP port 53053 More info here: https://docs.opnsense.org/manual/dnsmasq.html#dhcpv4-with-dns-registration for configuring unbound forwarding to DNSMASQ.

Note: Enabling both SLAAC and DHCPv6 addresses for the ULA range covers all bases for clients' quirks to get at least one ULA address registered in DNS.  For example, Apple devices prefer a "secure" SLAAC-generated IP which cannot be registered via ra-names, but the DHCPv6 address is registered since that is assigned by DNSMASQ.  Some of my containers and other clients etc. are only SLAAC and will probably stay that way, therefore SLAAC addresses are registered in DNS for these clients and able to be resolved.

End result:

No messy unbound restarts.  All local DNS is managed by DNSMASQ via an unbound forward; all Internet-facing DNS is handled by unbound.  Clients have a stable prefix for local IPv6 addressing and a proper GUA for accessing the public Internet.  IPv4 is also covered: static and dynamic leases are both registered in DNSMASQ.  All bases are covered!