Adventures with IPv6
IPv6, like Dippin' Dots and net-positive fusion power, seems to be "the future." So I decided I should probably have some.
These are my notes for how I'm doing home-network IPv6. YMMV.
Obtaining IPv6 Addresses from Spectrum
My router, which is actually a multi-homed Debian 12 fanless mini-PC, was easily able to just obtain an IPv6 address from Spectrum for its external interface via the standard Router Advertisement (RA) exchange. Woohoo! That, however, doesn't do much good for the multiple subnets of machines behind the router. Especially since We Don't Talk About NAT in IPv6.
Tangent- Subnet Masks and Network Sizes
The standard network subnet for IPv6 addresses is /64. My first thought was "Wow, that's 64 bits (18 bajillion!) host addresses. I'll just split that up!"
BZZT! WRONG ANSWER!
I mean, sure, you can happily divide a /64 into 16 different /68 networks, and still have a bajillion addresses in each one, but amazingly this causes problems with lots of IPv6 stacks, as they assume the network is /64. Why? Because there's crazy standards for calculating ephemeral "temporary" scoped IPv6 addresses on top of the MAC-address derived "permanent" global addresses, and those algos seems to assume (in most? all? cases) the availability of the entire 64 bits of host address space. I've had trouble finding specific technical documentation around this for the plethora of Desktop and Mobile OS stacks, so suffice it to say "sticking with what the OS expects, which is a /64 network, just turned out to be easier."
Obtaining Network Addresses
I tried a few variants of the built-in methods in /etc/network/interfaces :
Specifically:
iface IFNAME inet6 auto
would get me an external IPv6 address, but not internal ones for my subnets. Ultimately I figured out that Spectrum uses a combination of DHCPv6 to assign network addresses & subnets, but RA to publish gateways and DNS servers. The key seemed to be that I have to specifically ask Spectrum for:
- A "normal" IPv6 address for the external inferface
- IPv6 Prefix Delegation (a subnet)
- With a "hint" for the length I want.
The command to do this with /etc/network/interfaces , given an external address of enp1s0 , looks like this:
iface enp1s0 inet6 manual
up /usr/sbin/dhclient -6 -v -pf /run/dhclient6.enp1s0.pid -lf /var/lib/dhcp/dhclient6.enp1s0.leases -I -P --prefix-len-hint 60 -N -df /var/lib/dhcp/dhclient.enp1s0.leases enp1s0-P --prefix-len-hint NN
specifies we want a PD address block with a subnet mask of NN.
-N
specifies we also want a "normal" IPv6 address for the external interface itself.
Once the interface is brought up, you can see the "normal" dynamic IPv6 address in the address assignments for enp1s0
$ ip a
2: enp1s0: <BROADCAST,MULTICAST,ALLMULTI,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:e2:[...]
[...]
inet6 2600:6c4e:7008:[...]And you can see the PD block in the /var/lib/dhcp/dhclient6.enp1s0.leases file under the ia-pd xx:xx:xx:xx { block in the lease outputs.
Great! But wait. What do we do with that ::/60 address block once we get it?
Assigning the Prefix Delegation (PD) Subnets
{to be continued} [2025-02-28. Update within 7 days - KCB]