Score:0

Systemd-networkd fails IPv6 autoconfig where ifupdown succeeds

nc flag

Title is a bit vague, since I do not know what is going on. I want to switch to systemd-networkd, and I want it to autoconfigure both IPv4 and IPv6. I come from ifupdown, with the following config:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug ens3
iface ens3 inet dhcp
# This is an autoconfigured IPv6 interface
iface ens3 inet6 auto

This works:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 52:54:00:4f:e8:63 brd ff:ff:ff:ff:ff:ff
    altname enp0s3
    inet <valid ipv4>/24 brd <valid stuff> scope global dynamic ens3
       valid_lft 86031sec preferred_lft 86031sec
    inet6 2a01:7c8:****:***:****:ff:fe4f:e863/64 scope global dynamic mngtmpaddr 
       valid_lft 2591987sec preferred_lft 604787sec
    inet6 fe80::5054:ff:fe4f:e863/64 scope link 
       valid_lft forever preferred_lft forever

Then I want to switch to systemd-networkd, so I create the following config

[Match]
Name=ens3

[Network]
DHCP=yes

I then purge ifupdown to get it out of the way, enable systemd-networkd and systemd-resolved and reboot. IPv4 works fine, IPv6 is broken:

ip a                                                                                                                                                                                                                                                  130 ↵
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 52:54:00:4f:e8:63 brd ff:ff:ff:ff:ff:ff
    altname enp0s3
    inet <valid ipv4> brd <valid stuff> scope global dynamic ens3
       valid_lft 86371sec preferred_lft 86371sec
    inet6 fe80::5054:ff:fe4f:e863/64 scope link 
       valid_lft forever preferred_lft forever

So there is no global ipv6 address. Looking into the debug logs of systemd-networkd gives:

jan 23 16:01:43 transip-vps systemd-networkd[3251]: ens3: Configuring route: dst: 2a01:7c8:d003::/48, src: n/a, gw: n/a, prefsrc: n/a, scope: global, table: main, proto: ra, type: unicast
jan 23 16:01:43 transip-vps systemd-networkd[3251]: ens3: Setting NDisc routes.
jan 23 16:01:43 transip-vps systemd-networkd[3251]: ens3: State changed: configured -> configuring
jan 23 16:01:43 transip-vps systemd-networkd[3251]: Sent message type=signal sender=n/a destination=n/a path=/org/freedesktop/network1/link/_32 interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=52 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a
jan 23 16:01:43 transip-vps systemd-networkd[3251]: rtnl: received non-static neighbor, ignoring.
jan 23 16:01:43 transip-vps systemd-networkd[3251]: ens3: NDisc routes set.
jan 23 16:01:43 transip-vps systemd-networkd[3251]: ens3: Removing old NDisc information obtained from fe80::d003:1.
jan 23 16:01:43 transip-vps systemd-networkd[3251]: ens3: link_check_ready(): dhcp4:yes dhcp6_addresses:no dhcp_routes:no dhcp_pd_addresses:no dhcp_pd_routes:no ndisc_addresses:yes ndisc_routes:yes
jan 23 16:01:43 transip-vps systemd-networkd[3251]: ens3: State changed: configuring -> configured
jan 23 16:01:43 transip-vps systemd-networkd[3251]: Sent message type=signal sender=n/a destination=n/a path=/org/freedesktop/network1/link/_32 interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=53 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a
jan 23 16:01:46 transip-vps systemd-networkd[3251]: NDISC: Received Router Advertisement: flags none preference medium lifetime 12 sec
jan 23 16:01:46 transip-vps systemd-networkd[3251]: NDISC: Invoking callback for 'router' event.
jan 23 16:01:46 transip-vps systemd-networkd[3251]: ens3: Configuring route: dst: n/a, src: n/a, gw: fe80::d003:1, prefsrc: n/a, scope: global, table: main, proto: ra, type: unicast
jan 23 16:01:46 transip-vps systemd-networkd[3251]: NDISC: Invalid prefix length, ignoring prefix for stateless autoconfiguration.
jan 23 16:01:46 transip-vps systemd-networkd[3251]: ens3: Configuring route: dst: 2a01:7c8:d003::/48, src: n/a, gw: n/a, prefsrc: n/a, scope: global, table: main, proto: ra, type: unicast
jan 23 16:01:46 transip-vps systemd-networkd[3251]: ens3: Setting NDisc routes.
jan 23 16:01:46 transip-vps systemd-networkd[3251]: ens3: State changed: configured -> configuring
jan 23 16:01:46 transip-vps systemd-networkd[3251]: Sent message type=signal sender=n/a destination=n/a path=/org/freedesktop/network1/link/_32 interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=54 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a
jan 23 16:01:46 transip-vps systemd-networkd[3251]: rtnl: received non-static neighbor, ignoring.
jan 23 16:01:46 transip-vps systemd-networkd[3251]: ens3: NDisc routes set.
jan 23 16:01:46 transip-vps systemd-networkd[3251]: ens3: Removing old NDisc information obtained from fe80::d003:1.
jan 23 16:01:46 transip-vps systemd-networkd[3251]: ens3: link_check_ready(): dhcp4:yes dhcp6_addresses:no dhcp_routes:no dhcp_pd_addresses:no dhcp_pd_routes:no ndisc_addresses:yes ndisc_routes:yes
jan 23 16:01:46 transip-vps systemd-networkd[3251]: ens3: State changed: configuring -> configured
jan 23 16:01:46 transip-vps systemd-networkd[3251]: Sent message type=signal sender=n/a destination=n/a path=/org/freedesktop/network1/link/_32 interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=55 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a
jan 23 16:01:47 transip-vps systemd-networkd[3251]: NDISC: Received Router Advertisement: flags none preference medium lifetime 12 sec
jan 23 16:01:47 transip-vps systemd-networkd[3251]: NDISC: Invoking callback for 'router' event.
jan 23 16:01:47 transip-vps systemd-networkd[3251]: ens3: Configuring route: dst: n/a, src: n/a, gw: fe80::d003:1, prefsrc: n/a, scope: global, table: main, proto: ra, type: unicast
jan 23 16:01:47 transip-vps systemd-networkd[3251]: NDISC: Invalid prefix length, ignoring prefix for stateless autoconfiguration.
jan 23 16:01:47 transip-vps systemd-networkd[3251]: ens3: Configuring route: dst: 2a01:7c8:d003::/48, src: n/a, gw: n/a, prefsrc: n/a, scope: global, table: main, proto: ra, type: unicast

Ad infinium. What I see is that the prefix 2a01:7c8:d003::/48 looks correct (except /48 instead of 64?), but it is unable to set such an address and just tries forever.

What should I do to get systemd-networkd ipv6 working?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.