Re: dhcpcd ignores additional routes from IPv6 Router Advertisements
Roy Marples
Sun Jan 06 10:14:17 2019
On 06/01/2019 00:51, Raphaël Halimi wrote:
Hi,
I have a problem with dhcpcd which, even after several days of googling,
I'm unfortunately unable to solve.
Here's a quick description of my setup:
My LAN is equipped with a DSL modem/switch lent from my ISP, which sends
IPv6 Router Advertisements to devices connected to its four ports. I
also have one host which is my "main" server, as it offers DHCP (both
IPv4/IPv6), DNS, and also hosts virtual machines behind a purely virtual
bridge (not connected to any physical interface). It also acts as the
default IPv4 gateway for other LAN hosts. It's not the default IPv6
gateway though, because the ISP's box still sends RAs even when I enable
the option supposed to disable them; it seems broken), but it has radvd
installed nevertheless to send RAs to the virtual machines, and also to
the physical hosts (to instruct them on how to reach the VMs).
Here's my problem:
I have a Raspberry Pi with Raspbian installed, which uses dhcpcd. All
other hosts are "pure" Debian, and thus use either ifupdown (on servers)
or NetworkManager (on desktops) instead.
On the server, radvd is configured like this for the physical interface:
interface mvl1 {
AdvSendAdvert on;
AdvDefaultLifetime 0;
prefix fdxx:y:z:1::/64 { AdvOnLink on; AdvAutonomous off; };
route fdxx:y:z:2::/64 { AdvRoutePreference high; };
AdvManagedFlag on;
AdvOtherConfigFlag on;
};
dhcpcd's logs show that it does receive RAs from both the ISP's router
and my server:
dhcpcd[295]: wlan0: Router Advertisement from fe80::a:b:c:d
dhcpcd[295]: wlan0: adding address 2a01:x:y:z:a:b:c:d/64
dhcpcd[295]: wlan0: adding route to 2a01:x:y:z::/64
dhcpcd[295]: wlan0: adding default route via fe80::a:b:c:d
dhcpcd[295]: wlan0: Router Advertisement from fe80::c:d:e:f
dhcpcd[295]: wlan0: adding route to fdxx:y:z:1::/64
...
dhcpcd[1049]: wlan0: REPLY6 received from fe80::c:d:e:f
dhcpcd[1049]: wlan0: adding address fdxx:y:z:1::30/128
(2a01... is the prefix advertised by the ISP's box to reach the outside
world; fdxx... are ULAs inside my LAN, served by DHCPv6; fe80::a:b:c:d
is the ISP's box link-local address, and fe80::c:d:e:f is the server's
link-local address)
As you can see, it only adds the default route from the ISP's router,
but not the additional route advertised by the server; ip -6 route gives:
2a01:x:y:z::/64 dev wlan0 proto kernel metric 303 mtu 1480 pref medium
fdxx:y:z:1::/64 dev wlan0 proto kernel metric 303 pref medium
fe80::/64 dev wlan0 proto kernel metric 256 pref medium
default via fe80::a:b:c:d dev wlan0 metric 303 mtu 1480 pref medium
On another host, NetworkManager does the right thing and adds both routes:
2a01:x:y:z::/64 dev enp4s0 proto ra metric 100 pref medium
fdxx:y:z:1::100 dev enp4s0 proto kernel metric 100 pref medium
fdxx:y:z:1::/64 dev enp4s0 proto ra metric 100 pref medium
fdxx:y:z:2::/64 via fe80::c:d:e:f dev enp4s0 proto ra metric 100 pref high
fe80::/64 dev enp4s0 proto kernel metric 100 pref medium
default via fe80::a:b:c:d dev enp4s0 proto ra metric 100 pref medium
I couldn't verify that ifupdown acts like dhcpcd, or does the right
thing like NetworkManager, since all servers are virtual, and have a
static network configuration.
I also tried to add ipv6ra_own to /etc/dhcpcd.conf but it didn't work.
Any help would be very much appreciated; as I said, I'm asking here as a
last resort, having crawled Google for days without success.
This is a bug in dhcpcd and likely most BSD kernels as well.
Fixed here:
https://roy.marples.name/git/dhcpcd.git/commit/?id=12489da256cfd51afb736b278b88510e5e4303e7
Roy
Archive administrator: postmaster@marples.name