NetworkManager ignores IPv6 routes with same prefix
Hi folks!
NM ignores an IPv6 route having the same prefix as another route.
My router (FritzBox) announces an ULA prefix (fdc0:a86f::/64
) as well as a dedicated route information for this subnet in the router advertisement. Both have the same prefix length. Hence, the corresponding routes only differ in the nexthop information: on-link vs. a dedicated router:
fdc0:a86f::/64 via fe80::52e6:36ff:fe1a:11f4 dev 2
fdc0:a86f::/64 dev 2
As you can see in my log below, the ndisc component receives both the dedicated route as well as the prefix information. The l3cfg component, however, only knows about the route via the dedicated router (route fdc0:a86f::/64 via fe80::52e6:36ff:fe1a:11f4
).
Btw, the Linux kernel is more or less fine with adding both routes: The kernel adds the route for the on-link prefix with a lower metric than the dedicated route. Hence, the kernel will always use the on-link route (fdc0:a86f::/64 dev 2
).
I already had a look at NM's source code. Is it possible to add prefix-based routes with a lower metric than routes obtained via ra route information?
Cheers, Alex
ndisc[0x556d89702140,"eth0"]: router-data: next lifetime expiration will happen: in 1200,000 seconds
ndisc[0x556d89702140,"eth0"]: neighbor discovery configuration changed [dGARS]:
ndisc[0x556d89702140,"eth0"]: dhcp-level none
ndisc[0x556d89702140,"eth0"]: hop limit : 255
ndisc[0x556d89702140,"eth0"]: gateway fe80::52e6:36ff:fe1a:11f4 pref high exp 1800,000
ndisc[0x556d89702140,"eth0"]: address 2001:16b8:683:c600:15b9:5689:3a6c:46f5 exp 7200,000
ndisc[0x556d89702140,"eth0"]: address fdc0:a86f::1080:99d2:2f0a:4557 exp 7200,000
ndisc[0x556d89702140,"eth0"]: route 2001:16b8:683:c600::/56 via fe80::52e6:36ff:fe1a:11f4 pref high exp 1800,000
ndisc[0x556d89702140,"eth0"]: route fdc0:a86f::/64 via fe80::52e6:36ff:fe1a:11f4 pref high exp 1800,000
ndisc[0x556d89702140,"eth0"]: route 2001:16b8:683:c600::/64 via :: pref medium exp 7200,000
ndisc[0x556d89702140,"eth0"]: dns_server fdc0:a86f::cb exp 1200,000
device[79acc8b1ce92fc0d] (eth0): ip:ac6: grace period stopped
ndisc[0x556d89702140,"eth0"]: solicit: schedule sending next (slow) solicitation in about 1142,036 seconds
l3cfg[a8225735fe2aef9d,ifindex=2]: obj-state: track: [6f76b4ce7ff9e1c9, ip6-address, 2001:16b8:683:c600:15b9:5689:3a6c:46f5/64 lft 7201sec pref 3601sec lifetime 2-2[3601,7201] dev 2 flags mngtmpaddr,noprefixroute src ndisc force-commit], in-platform
l3cfg[a8225735fe2aef9d,ifindex=2]: obj-state: track: [6a3d9bf98b44d844, ip6-address, fdc0:a86f::1080:99d2:2f0a:4557/64 lft 7201sec pref 3601sec lifetime 2-2[3601,7201] dev 2 flags mngtmpaddr,noprefixroute src ndisc force-commit], in-platform
l3cfg[a8225735fe2aef9d,ifindex=2]: obj-state: track: [bc262cefca41862b, ip6-route, type unicast 2001:16b8:683:c600::/56 via fe80::52e6:36ff:fe1a:11f4 dev 2 metric 100 mss 0 rt-src ndisc pref high force-commit], in-platform
l3cfg[a8225735fe2aef9d,ifindex=2]: obj-state: track: [c64877c8b7bd75fe, ip6-route, type unicast fdc0:a86f::/64 via fe80::52e6:36ff:fe1a:11f4 dev 2 metric 100 mss 0 rt-src ndisc pref high force-commit], in-platform
l3cfg[a8225735fe2aef9d,ifindex=2]: obj-state: track: [0bca6c5bc33f68d4, ip6-route, type unicast 2001:16b8:683:c600::/64 dev 2 metric 100 mss 0 rt-src ndisc force-commit], in-platform
l3cfg[a8225735fe2aef9d,ifindex=2]: obj-state: track: [4606448e77256478, ip6-route, type unicast ::/0 via fe80::52e6:36ff:fe1a:11f4 dev 2 metric 100 mss 0 rt-src ndisc pref high force-commit], in-platform