Bug#1005851: systemd: networkd does not reliably configure hot-plugged interfaces
Noah Meyerhans
noahm at debian.org
Wed Feb 16 01:14:26 GMT 2022
Package: systemd
Version: 250.3-2
Severity: important
Dear Maintainer,
I'm using systemd-networkd on an Amazon EC2 virtual machine with the following
.network file:
admin at ip-10-0-0-80:~$ cat /etc/systemd/network/20-eni.network
[Match]
Driver=ena
[Link]
MTUBytes=9001
[Network]
DHCP=yes
IPv6DuplicateAddressDetection=0
LLMNR=no
[DHCPv4]
UseHostname=no
This hardware supports hotplugging, and it's a fairly common operation to
perform with it. When an interface matching this configuration attached, the
expected behavior is that networkd configures it per the .network file, as
shown:
admin at ip-10-0-0-80:~$ networkctl status ens6
● 3: ens6
Link File: /usr/lib/systemd/network/99-default.link
Network File: /etc/systemd/network/20-eni.network
Type: ether
State: routable (configured)
Online state: online
Alternative Names: enp0s6
Path: pci-0000:00:06.0
Driver: ena
Vendor: Amazon.com, Inc.
Model: Elastic Network Adapter (ENA)
HW Address: 02:3f:ef:3b:20:71
MTU: 9001 (min: 128, max: 9216)
QDisc: mq
IPv6 Address Generation Mode: eui64
Queue Length (Tx/Rx): 2/2
Address: 10.0.0.8 (DHCP4 via 10.0.0.1)
2600:1f14:eeb:2203:5dbb:f7c8:9e47:822e
2600:1f14:eeb:2203:8ff0:610d:6df4:6b3e
fe80::3f:efff:fe3b:2071
Gateway: 10.0.0.1
fe80::8f:53ff:fe6f:64ef
DNS: 10.0.0.2
Activation Policy: up
Required For Online: yes
DHCP4 Client ID: IAID:0x6618dd42/DUID
DHCP6 Client IAID: 0x6618dd42
DHCP6 Client DUID: DUID-EN/Vendor:0000ab11b98c8625365b63860000
However, starting with the systemd 250 upstream releases, configuration of
these interfaces fails intermittently, with networkd not properly associating
the interface with the .network file:
admin at ip-10-0-0-165:~$ networkctl status ens6
● 6: ens6
Link File: /usr/lib/systemd/network/99-default.link
Network File: n/a
Type: ether
State: off (unmanaged)
Online state: unknown
Alternative Names: enp0s6
Path: pci-0000:00:06.0
Driver: ena
Vendor: Amazon.com, Inc.
Model: Elastic Network Adapter (ENA)
Hardware Address: 02:3f:ef:3b:20:71
MTU: 1500 (min: 128, max: 9216)
QDisc: noop
IPv6 Address Generation Mode: eui64
Queue Length (Tx/Rx): 2/2
Activation Policy: up
Required For Online: yes
The networkd logs don't indicate any errors, but they also don't show
the link bring brought up or otherwise configured:
Feb 15 23:11:56 ip-10-0-0-165 kernel: pci 0000:00:06.0: [1d0f:ec20] type 00 class 0x020000
Feb 15 23:11:56 ip-10-0-0-165 kernel: pci 0000:00:06.0: reg 0x10: [mem 0x00000000-0x00003fff]
Feb 15 23:11:56 ip-10-0-0-165 kernel: pci 0000:00:06.0: BAR 0: assigned [mem 0x80000000-0x80003fff]
Feb 15 23:11:56 ip-10-0-0-165 kernel: ena 0000:00:06.0: enabling device (0000 -> 0002)
Feb 15 23:11:56 ip-10-0-0-165 kernel: ena 0000:00:06.0: ENA device version: 0.10
Feb 15 23:11:56 ip-10-0-0-165 kernel: ena 0000:00:06.0: ENA controller version: 0.0.1 implementation version 1
Feb 15 23:11:56 ip-10-0-0-165 kernel: ena 0000:00:06.0: LLQ is not supported Fallback to host mode policy.
Feb 15 23:11:56 ip-10-0-0-165 kernel: ena 0000:00:06.0: Elastic Network Adapter (ENA) found at mem 80000000, mac addr 02:3f:ef:3b:20:71
Feb 15 23:11:56 ip-10-0-0-165 kernel: ena 0000:00:06.0 ens6: renamed from eth0
Feb 15 23:11:56 ip-10-0-0-165 systemd-udevd[517]: Using default interface naming scheme 'v250'.
Feb 15 23:11:56 ip-10-0-0-165 systemd-networkd[371]: eth0: Interface name change detected, renamed to ens6.
udev seems to see the correct information for this interface:
admin at ip-10-0-0-165:~$ udevadm info /sys/class/net/ens6
P: /devices/pci0000:00/0000:00:06.0/net/ens6
L: 0
E: DEVPATH=/devices/pci0000:00/0000:00:06.0/net/ens6
E: INTERFACE=ens6
E: IFINDEX=5
E: SUBSYSTEM=net
E: USEC_INITIALIZED=172589369
E: ID_NET_NAMING_SCHEME=v250
E: ID_NET_NAME_MAC=enx023fef3b2071
E: ID_NET_NAME_PATH=enp0s6
E: ID_NET_NAME_SLOT=ens6
E: ID_BUS=pci
E: ID_VENDOR_ID=0x1d0f
E: ID_MODEL_ID=0xec20
E: ID_PCI_CLASS_FROM_DATABASE=Network controller
E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller
E: ID_VENDOR_FROM_DATABASE=Amazon.com, Inc.
E: ID_MODEL_FROM_DATABASE=Elastic Network Adapter (ENA)
E: ID_PATH=pci-0000:00:06.0
E: ID_PATH_TAG=pci-0000_00_06_0
E: ID_NET_DRIVER=ena
E: ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
E: ID_NET_NAME=ens6
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/ens6
E: TAGS=:systemd:
E: CURRENT_TAGS=:systemd:
-- Package-specific info:
-- System Information:
Debian Release: bookworm/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 5.16.0-1-cloud-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages systemd depends on:
ii adduser 3.118
ii libacl1 2.3.1-1
ii libapparmor1 3.0.3-6
ii libaudit1 1:3.0.6-1+b1
ii libblkid1 2.37.2-5
ii libc6 2.33-1
ii libcap2 1:2.44-1
ii libcrypt1 1:4.4.27-1
ii libcryptsetup12 2:2.4.2-1
ii libfdisk1 2.37.2-5
ii libgcrypt20 1.9.4-5
ii libgnutls30 3.7.2-4
ii libgpg-error0 1.43-1
ii libip4tc2 1.8.7-1
ii libkmod2 29-1
ii liblz4-1 1.9.3-2
ii liblzma5 5.2.5-2
ii libmount1 2.37.2-5
ii libpam0g 1.4.0-11
ii libseccomp2 2.5.3-2
ii libselinux1 3.3-1+b1
ii libsystemd0 250.3-2
ii libzstd1 1.4.8+dfsg-3
ii mount 2.37.2-5
ii util-linux 2.37.2-5
Versions of packages systemd recommends:
ii chrony [time-daemon] 4.1-4
ii dbus [default-dbus-system-bus] 1.12.20-3
Versions of packages systemd suggests:
ii libfido2-1 1.9.0-1
pn libtss2-esys-3.0.2-0 <none>
pn libtss2-mu0 <none>
pn libtss2-rc0 <none>
pn policykit-1 <none>
pn systemd-container <none>
Versions of packages systemd is related to:
pn dbus-user-session <none>
pn dracut <none>
ii initramfs-tools 0.140
pn libnss-systemd <none>
ii libpam-systemd 250.3-2
ii udev 250.3-2
-- no debconf information
More information about the Pkg-systemd-maintainers
mailing list