Hi everyone, I would like to hear your thoughts on changing the default behaviour of Fedora when it comes to multiple preferred IPv6 addresses.
TLDR: When there are multiple IPv6 addresses with a preferred lifetime > 0, Fedora seems to not pick the newest one but keeps on trying to use an old one with a preferred lifetime > 0, which won’t work. This behaviour leads to problems in networks where the ISP gives out non-persistent IPv6 prefixes. Android seems to prefer always the newest prefix and works without a problem in such an environment.
Long Story: There are ISPs, mine is one of them, who do not give their customers a persistent IPv6 prefix, but give out a new prefix together with a new IPv4 address on reconnects. The router will get this new prefix via DHCPv6. The Router will then send Router Advertisement packages to tell the devices in the different subnets that there is a new prefix for which they should generate an IPv6 address and it will also send Router Advertisement packages with the old IPv6 prefix and the preferred lifetime of this prefix set to 0, effectively disabling the old prefix so that only the new one will be used by the devices. This works fine with Fedora, since there always is only one IPv6 address that is preferred and will therefore be used.
But there is one scenario when Fedora has a real problem (and Alma Linux 10, which I have tested, most probably also RHEL, which I have not tested): If the Router gets rebooted or looses power and then restarts, it will reconnect to the ISP and will get an new IPv6 prefix. It will then send this prefix to the devices in its networks via Router Advertisement. But some Routers only keep the old prefixes in memory, which is lost at reboot, and therefore can not invalidate the old prefix after boot. Mikrotik is one of these Routers that behaves like this. Which leads to Fedora having two (or more) IPv6 addresses that are “preferred”. Fedora will then try to use an old one, which will not work, since the ISP will route only the newest one, effectively leaving Fedora without IPv6 connectivity until the preferred lifetime of the old IPv6 has run out.
Here is how that looks like:
$ ip a
…
inet6 2a02:3100:47cd:2804:d54a:5224:6b9d:cd4d/64 scope global dynamic noprefixroute
valid_lft 239059sec preferred_lft 152659sec
inet6 2a02:3100:3c90:d904:7c5c:44f6:255b:74f6/64 scope global dynamic noprefixroute
valid_lft 239170sec preferred_lft 152770sec
inet6 2a02:3100:3f5e:b104:55ba:fcbd:1388:e964/64 scope global dynamic noprefixroute
valid_lft 2573075sec preferred_lft 585875sec
…
$ ping 2606:4700::6810:85e5
PING 2606:4700::6810:85e5 (2606:4700::6810:85e5) 56 data bytes
^C
— 2606:4700::6810:85e5 ping statistics —
6 packets transmitted, 0 received, 100% packet loss, time 5118ms
If I delete now the two older Adresses it works again:
# ip -6 a del 2a02:3100:47cd:2804:d54a:5224:6b9d:cd4d/64 dev eno1
# ip -6 a del 2a02:3100:3c90:d904:7c5c:44f6:255b:74f6/64 dev eno1
# ip a
…
inet6 2a02:3100:3f5e:b104:55ba:fcbd:1388:e964/64 scope global dynamic noprefixroute
valid_lft 2572734sec preferred_lft 585534sec
…
# ping 2606:4700::6810:85e5
PING 2606:4700::6810:85e5 (2606:4700::6810:85e5) 56 data bytes
64 bytes from 2606:4700::6810:85e5: icmp_seq=1 ttl=59 time=9.28 ms
64 bytes from 2606:4700::6810:85e5: icmp_seq=2 ttl=59 time=8.65 ms
64 bytes from 2606:4700::6810:85e5: icmp_seq=3 ttl=59 time=9.21 ms
^C
— 2606:4700::6810:85e5 ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 8.647/9.045/9.276/0.282 ms
And here is more information on this topic from RIPE: https://www.ripe.net/publications/docs/ripe-690/#5-end-user-ipv6-prefix-assignment-persistent-vs-non-persistent
So, my suggestion is that Fedora should always use the newest IPv6 address it has available. In my tests, this is what Android seems to do as well. But maybe there is a good reason why Fedora does it the way it is now (?) and it is solely the responsibility of the router manufacturers to remember old IPv6 prefixes after reboot and keep invalidating them.
Thoughts?