Some minor questions regarding IPv6 static leases (18.06.4)

I'm currently in the process of implementing and using IPv6 inside my LAN, and I've run into some annoying quirks with DHCP leases:

  • Dual/Multi booting: A single host with multiple operating systems will generate different DUID values.

With a IPv4 lease I had a static MAC address that was shared between all operating systems on a host. That lease would be reused/renewed if I booted into a different OS. This way, the IPv4 address would remain the same and I could have a single set of firewall rules for the services running on all the applicable operating systems.

For IPv6, I've tried working around this by adding different entries into the dhcp file:

config host
        option dns '1'
        option ip '192.168.1.3'
        option name 'example'
        option mac 'XX:XX:XX:79:4D:B6'
        option duid '000100012380be330c9d92794db6'
        option hostid '3'

config host
	option dns '1'
	option name 'example'
	option duid '0004ecdb2fbd1533b6d58c115305086294f5'
	option hostid '3'

And I've noticed that if two entires share the same hostid value, only the last entry in order will work. So I've been forced to set the hostid to a3/b3/c3/etc, depending on the OS and specific DUID. This sucks, because now I have to duplicate all my IPv6 firewall rules for that one host.

Is there a way to specify multiple duid values for a single IPv6 hostid, in a way that would mimic the IPv4 lease behavior? I'd like all the operating systems to have the same IPv6 address assigned.

  • The hostname specified in the static IPv6 lease is ignored in favour of the DHCPv6 clients actual hostname.

The name option has no effect if the DHCPv6 client reports a hostname back. It will simply use the hostname the client provides. This sucks for one major reason: A dual-stack client with a IPv4 and IPv6 static lease will now have two hostnames in the domain. One with a IPv4 A record, and one with a AAAA record for IPv6.

IPv4 lease:
example.domain.lan. 0	IN	A	192.168.1.3

IPv6 lease:
Aurelian.domain.lan. 0	IN	AAAA	fd42::b3

What I expected:
example.domain.lan. 0	IN	A	192.168.1.3
example.domain.lan. 0	IN	AAAA	fd42::b3

This last quirk can be worked around by adding entries into the hosts file manually, which kinda ruins the point of the whole exercise. Is this a bug or a feature of DHCPv6?

For IPv6, DUID can/should be by interface for hosts with multiple interfaces.

The host in question has only one physical interface. I don't mind the different DUID values at all to be honest. I'm more exasperated that I can't figure out how to reuse a IPv6 lease when I boot into a different operating system on the same physical host.

Basically, I want every operating system to receive the same IPv6 address on one physical host with one physical interface. But if I set that up like I've mentioned above, it's simply ignored. I don't see any error message that says I've borked up the syntax or did something illegal.

I'll concede IPv6 was probably never made for this kind of re-using. How would I fix the static hostnames being ignored? If DHCPv6 would at least stick to the hostname I've set for each DUID, then I could use FQDNs in my firewall rules instead.

Set the DUID explicitly on the host, for each OS.

3 Likes

not sure if it of use to you... but dnsmasq(-full) has;

--dhcp-ignore-names > Ignore hostnames provided by DHCP clients

Setting the DUID values manually and updating the hostname entries was the simplest and quickest solution in the end.

Thank you for the help!

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.