[Bug 1914884] Re: udev tries to assign identical name to multiple network cards
sm8ps
1914884 at bugs.launchpad.net
Thu Feb 25 08:30:02 UTC 2021
In case anybody else should stumble over this issue, my solution was to create a .link file /etc/systemd/network/10-fix-names.link with content
[Match]
OriginalName=*
[Link]
NamePolicy=path
AlternativeNamesPolicy=path
as described in https://www.freedesktop.org/software/systemd/man/systemd.link.html. For reasons unknown to me the AlternativeNamesPolicy is necessary; otherwise the name is kept at ens2 (only) for the active link (the other two NICs are inactive).
sudo SYSTEMD_LOG_LEVEL=debug udevadm test-builtin net_setup_link
/sys/class/net/ens2 yields the expected result enp5s0 and the machine
can be rebooted.
Closing this issue.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1914884
Title:
udev tries to assign identical name to multiple network cards
Status in systemd package in Ubuntu:
New
Bug description:
Upon upgrading from U18.04 to U20.04.2, the network interface names became unpredictable. They could be *any* of eth0, eth1, eth2 and ens2. Further inspection shows error messages like
"systemd-udevd: eth1: Failed to rename network interface 3 from 'eth1' to 'ens2': File exists"
The installation is plain vanilla; in fact, the system had not been
used at all yet. Neither of the files '/lib/udev/rules.d/75
-persistent-net-generator.rules', '/etc/udev/rules.d/70-persistent-
net.rules' or '/lib/udev/rules.d/71-biosdevname.rules' exist.
On U18.04, 'ls /sys/class/net' yielded "enp5s0 enp14s0 enp9s0 lo".
After the upgrade, it currently shows "ens2 eth0 eth1 lo".
For each of these entries, 'udevadm test-builtin net_id $nic 2>/dev/null' gives the following:
/sys/class/net/ens2
ID_NET_NAMING_SCHEME=v245
ID_NET_NAME_MAC=enx002481d13e60
ID_OUI_FROM_DATABASE=Hewlett Packard
ID_NET_NAME_PATH=enp14s0
ID_NET_NAME_SLOT=ens2
/sys/class/net/eth0
ID_NET_NAMING_SCHEME=v245
ID_NET_NAME_MAC=enx001018b197dc
ID_OUI_FROM_DATABASE=Broadcom
ID_NET_NAME_PATH=enp5s0
ID_NET_NAME_SLOT=ens2
/sys/class/net/eth1
ID_NET_NAMING_SCHEME=v245
ID_NET_NAME_MAC=enx00101897069a
ID_OUI_FROM_DATABASE=Broadcom
ID_NET_NAME_PATH=enp9s0
ID_NET_NAME_SLOT=ens2
This seems to be a case where the naming scheme v245 should be replaced by v247, according to
https://www.freedesktop.org/software/systemd/man/systemd.net-naming-scheme.html
The situation does not change with passing "net.naming-scheme=latest" to the kernel.
The installed version of udev is 245.4-4ubuntu3.4.
Since this faulty behavior happened completely out of the blue on a
practically pristine LTS installation, I hope to have some kind of
solution similar to a backport. Thanks for comments!
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1914884/+subscriptions
More information about the foundations-bugs
mailing list