Persistent network interface names changed after upgrading to SLES 15 SP3
This document (000020417) is provided subject to the disclaimer at the end of this document.
Environment
SUSE Linux Enterprise Server 15 Service Pack 2
Situation
By default SLE uses the "classical" interface names like eth0 etc, but the system is booting with net.ifnames=1 to activate policy-based network interface naming.
As an example the interface that was named enp59s0f1 on SLE 15 SP2 now shows up as ens2f1 in the output of ip link which at the same time lists the "desired" name as "altname" :
# ip l
...
5: ens2f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 3c:fd:fe:ad:09:b9 brd ff:ff:ff:ff:ff:ff
altname enp59s0f1
...
Comparing the output of udevadm info -e reveals that a new property - ID_NET_NAME_SLOT - is exposed on SLE 15 SP3.
Selected lines of the output from SLE 15 SP2 :
P: /devices/pci0000:3a/0000:3a:00.0/0000:3b:00.1/net/enp59s0f1
E: DEVPATH=/devices/pci0000:3a/0000:3a:00.0/0000:3b:00.1/net/enp59s0f1
E: ID_MODEL_FROM_DATABASE=Ethernet Controller XL710 for 40GbE QSFP+ (Ethernet Converged Network Adapter XL710-Q1)
E: ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
E: ID_NET_NAME_PATH=enp59s0f1
E: ID_PATH=pci-0000:3b:00.1
E: ID_PATH_TAG=pci-0000_3b_00_1
E: INTERFACE=enp59s0f1
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/enp59s0f1
Selected lines of the output from SLE 15 SP3 :
P: /devices/pci0000:3a/0000:3a:00.0/0000:3b:00.1/net/ens2f1
E: DEVPATH=/devices/pci0000:3a/0000:3a:00.0/0000:3b:00.1/net/ens2f1
E: ID_MODEL_FROM_DATABASE=Ethernet Controller XL710 for 40GbE QSFP+ (Ethernet Converged Network Adapter XL710-Q1)
E: ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
E: ID_NET_NAME_PATH=enp59s0f1
E: ID_NET_NAME_SLOT=ens2f1
E: ID_PATH=pci-0000:3b:00.1
E: ID_PATH_TAG=pci-0000_3b_00_1
E: INTERFACE=ens2f1
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/ens2f1
Resolution
- Copy /usr/lib/systemd/network/99-default.link to /etc/systemd/network/
- Open /etc/systemd/network/99-default.link and and swap the order of slot and path in the NamePolicy line, so it looks like this :
NamePolicy=keep kernel database onboard path slot - Recreate the initrd to make the changes be applied during subsequent boots.
- # dracut --logfile /var/log/YaST2/mkinitrd.log --force
- Reboot the system
To address that add
--include /etc/systemd/network/ /etc/systemd/network/
to the dracut command.
Cause
From man systemd.link :
NamePolicy=
An ordered, space-separated list of policies by which the
interface name should be set. NamePolicy= may be disabled by
specifying net.ifnames=0 on the kernel command line. Each of the
policies may fail, and the first successful one is used. The name
is not set directly, but is exported to udev as the property
ID_NET_NAME, which is, by default, used by a udev(7), rule to set
NAME.
The default policy is :
NamePolicy=keep kernel database onboard slot path
Thus, since the ID_NET_NAME_SLOT property is not exposed on SLE 15 SP2, the interface hits the "path" policy.
However on SLE 15 SP3, both ID_NET_NAME_PATH and ID_NET_NAME_SLOT are available for some network interfaces (or on certain hypervisors), which causes udev to name the device based on the "slot" policy.
Additional Information
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000020417
- Creation Date: 27-Oct-2021
- Modified Date:27-Oct-2021
-
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com