Static DHCPv6 on client with dual NICs?

Started by Mpegger, May 10, 2025, 02:48:27 AM

Previous topic - Next topic
Going through the release notes of the recent Opnsense version, I'm planning to eventualy switch over from ISC to DNSmasq for my home network. As I was going through setting up the Hosts entries for Static ips, I noticed that the VM I have Pi-hole running on with 2 virtual NICs, has the same DUID for each NIC, which makes sense since it's the same client. Currently ISC DHCPv6 shows that each NIC has a unique IPv6 GUA address, which I assume is because of the client host OS using SLAAC to assign the GUA IPs.

I'm probably just not reading the help documents correctly, or maybe there is a setting I need to toggle, or maybe make use of something else in Opnsense (alias? Unbound Overrides?), but I don't see any way it's possible for me to assign a Static IPv6 GUA address to each individual NIC, if they both use the same DUID (though they do have different MACs). Other then making a 2nd VM for the pi-hole (I abosuletely don't want to do this), what can I do?

What is the purpose of the virtual NICs? Presumably they are on different LAN segments? You should be able to create static mappings with the same DUID on different interfaces (at least with ISC - I haven't looked at dnsmasq integration yet)...

Primary purpose of the dual NICs is just to keep those OS' that require 2 distinct IP addresses for DNS servers, ie Android which will automatically insert a Google DNS ip for use if only 1 DNS server IP is given in DHCP. And yes, I already have Opnsense setup with blocking outbound DNS and fowarding all DNS requests to my Pihole for those clients that ignore the DHCP settings. I still prefer to have 2 actual working IP address for the DNS server.

Hoever, instead of having 2 Pi-hole servers running to acheive that, I opted for a single instance with dual NICs. Works fine for IPv4 and using Link-Local IPv6, but I see with the VM presenting only a single DUID that this would create an issue with Static IPv6 delegation via DHCPv6.

I've been trying to think of other ways, such as assigning 2 IP addresses (IPv4 & IPv6) to the DHCP client, but that seems only possible with the current new DNSmasq which isn't ready for roll out, so trying to figure out a way to work it with ISC and possibly future proofing my setup for the switchover to DNSmasq without having to redo my network yet again, and again, and again...

PS: Trying to set Static IPs on the host is a no go with GUA IPv6 as I have Verizon which only uses Dynamic prefixes. ULA is pretty much useless in a mixed IPv4+IPv6 network, so that option is also out. Gotta stick with GUA as I do have some services I need accesible from the WAN.

A client with multiple interfaces doing DHCP on the same LAN segment is kindof unusual, and I don't think it's really catered for in OPNsense. It appears that the proper way to do it would be to use a combination of DUID and IAID, but the UI (at least) doesn't provide a way to configure that.

I haven't tried to use dnsmasq yet, but looking at the UI, there is a place for "Hardware addresses", as well as "Client identifier" when configuring "Hosts". I don't know if that would accomplish what you need, but it might be worth checking out....