IPv6 Question: Subnets with SLAAC vs. DHCPv6 (Example here: Starlink)

Hi there. I will tell you what I learned and what my assumptions are. Perhaps I can learn some more :wink:

First, the "assumptions part"...

DHCPv6:

  1. is a "legacy" technology
  2. is missing "default route" information

SLAAC (aka RA aka Router Advertisement):

  1. is the new kid native to IPv6 you should rely on

DHCPv6/SLAAC:

  1. I can use none, both or one of them.

  2. The IP address the interface of my device gets from either of them is always something like <prefix>:<address>/64 or <prefix>:<address>/128
    Meaning: <prefix>:<address>/56 does NEVER exist as an interface address, as the subnet is part of the <prefix> and therefore the address is displayed with "/64"
    So if I configure some local subnets, the prefix differs but each subnet is "handing out" /64 addresses.

Now my example with Starlink...

A) There is router advertisement and radvdump says:

#
# radvd configuration generated by radvdump 2.19
# based on Router Advertisement from fe80::200:5eff:fe00:101
# received by interface bridge
#

interface bridge
{
	AdvSendAdvert on;
	# Note: {Min,Max}RtrAdvInterval cannot be obtained with radvdump
	AdvManagedFlag off;
	AdvOtherConfigFlag on;
	AdvReachableTime 0;
	AdvRetransTimer 0;
	AdvCurHopLimit 64;
	AdvDefaultLifetime 300;
	AdvHomeAgentFlag off;
	AdvDefaultPreference medium;
	AdvSourceLLAddress on;
	AdvLinkMTU 1500;

	prefix 2a0d:3344:1500:73fd::/64
	{
		AdvValidLifetime 300;
		AdvPreferredLifetime 150;
		AdvOnLink on;
		AdvAutonomous on;
		AdvRouterAddr off;
	}; # End of prefix definition


	RDNSS 2606:4700:4700::1111 2001:4860:4860::8888
	{
		AdvRDNSSLifetime 360;
	}; # End of RDNSS definition

}; # End of interface definition

B) There is DHCPv6 and dhcp6dump.phar (work in progess) says:

Eth Src: 00:00:5e:00:01:01
Eth Dst: ff:ff:ff:ff:ff:ff

IPv6 Src: 2a0d:3344:1500:73fd::1
IPv6 Dst: fe80::ee08:6bff:fe56:bc57

Message type: 7 (REPLY)
Transaction ID: 0x3380D1
Option: 1 (CLIENTID)
    Type: 2 (DUID-EN)
        Enterprise Number: 43793 (systemd)
        FE CE BA B8  (....)

Option: 2 (SERVERID)
    Type: 2 (DUID-EN)
        Enterprise Number: 50960 (TODO)
        00  (.)

Option: 25 (IA_PD)
    IAID: 3980038939
    T1: 300s
    T1: 480s
    Option: 26 (IAPREFIX)
        TODO
        00 00 02 58 00 00 04 B0 38 2A 0D 33 44 15 DE 79  (...X....8*.3D..y)
        00 00 00 00 00 00 00 00 00                       (.........       )
    

Option: 23 (DNS_SERVERS)
    2606:4700:4700::1111
    2001:4860:4860::8888

What I did... (with systemd-networkd)

A) I configured IPv6 with DHCPv6 only:

[...]
[Network]
DHCP=ipv6
DHCPPrefixDelegation=true
[...]

I configure a token for fun:

[...]
[DHCPPrefixDelegation]
Token=::1234:1234:1234:1234
[...]

Then I get (via "ip ad")

[...]
    inet6 2a0d:3344:15de:7900:1234:1234:1234:1234/64 metric 256 scope global dynamic mngtmpaddr
       valid_lft 1192sec preferred_lft 592sec
[...]

Additionally I can also configure a subnetid for even more fun:

[...]
[DHCPPrefixDelegation]
Token=::1234:1234:1234:1234
SubnetId=42
[...]

Then "ip ad" says:

[...]
    inet6 2a0d:3344:15de:7942:1234:1234:1234:1234/64 metric 256 scope global dynamic mngtmpaddr
       valid_lft 1158sec preferred_lft 558sec
[...]

See that little "42" that is in place of "00"? Nice.

Also, "journalctl -fau systemd-networkd" says:

[...] systemd-networkd[6951]: bridge: DHCP: received delegated prefix 2a0d:3344:15de:7900::/56
[...] systemd-networkd[6951]: bridge: DHCP-PD address 2a0d:3344:15de:7942:1234:1234:1234:1234/64 (valid for 19min 59s, preferred for 9min 59s)

That's a ::/56 from Starlink! :partying_face:

I also had to configure the default route by hand:

[...]
[Route]
Gateway=fe80::200:5eff:fe00:101
GatewayOnLink=true
[...]

(I stole the info from SLAAC/radvdump!!!)

B) Now I configure IPv6 with SLAAC only (with token again :smiley:):

[...]
[Network]
IPv6AcceptRA=true

[IPv6AcceptRA]
Token=::1234:1234:1234:1234
[...]

And "ip ad" says:

[...]
    inet6 2a0d:3344:1500:73fd::1234:1234:1234:1234/64 scope global dynamic mngtmpaddr noprefixroute
       valid_lft 267sec preferred_lft 117sec
[...]

So as you can see, they got slightly different prefixes for DHCPv6 vs. SLAAC (See "[...]de:79[...]"-vs-"[...]00:73[...]"-part.) Also the subnetid with SLAAC in my case (?) is "fd". I don't know... could this be default, like "00" with DHCPv6. ("fd" is kind of reminding me of the "fd::"-style local addresses.)

So, my remaining Questions are:

  • How can I see, what kind of prefix my ISP hands out with SLAAC? /64? /56?
  • If not for the output of journalctl how would I even know I had /56 with DHCPv6?
  • If I had e.g. /56 with SLAAC like with DHCPv6, how would I set SubnetId?
  • Is SLAAC capable of non-/64 advertisement at all?
  • Why would an ISP use both: SLAAC and DHCPv6?
  • Have I misunderstood subnets with SLAAC?

Anyway, you may think, my post contains too much useless information. Maybe... But a post like that would have helped me earlier. So, just comment and correct my assumptions or answer my questions if you like...
Thanks everybody!

DHCPv6 isn't legacy, it's newer than SLAAC.

Something you don't mention is that DHCPv6 can be used both to distribute single addresses (called IA_NA or IA_TA), ie /128, and for prefix delegation (called IA_PD).

To use SLAAC the prefix needs to be /64.

It's common for an ISP to support both SLAAC and DHCPv6-PD (ie DHCPv6 with IA_PD). It allows you to connect end devices directly to the WAN. A global WAN address (configured with SLAAC) is also useful on a router, but it's not required since it can use a global IPv6 from the LAN or another interface when sending packets to Internet destinations.

3 Likes

Don't make the mistake of thinking that DHCP is merely a means for distributing IP addresses, it is very much more than that (in fact, I go so far as to say that's sort of a secondary function in IPv6). DHCPv6 was added to address some shortcomings in the IPv6 stack, most notably distribution of dns and ntp server addresses to client devices, even when they are SLAAC-only (like Android).

https://egustafson.github.io/post/ipv6-dhcpv6/

Also regarding some of your address-form questions, see https://www.rfc-editor.org/rfc/rfc4291
LLA - Link Local Address = fe80::/10
ULA - Unique Local Address = fd00::/8
GUA - Global Unicast Address = 2000::/3

1 Like