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 3
SUSE Linux Enterprise Server 15 Service Pack 2

Situation

It has been observed that the network interface names changed after upgrading from SLE 15 SP2 to SLE 15 SP3.
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

Change the order of list items in the NamePolicy.
  1. Copy /usr/lib/systemd/network/99-default.link to /etc/systemd/network/
  2. 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
  3. Recreate the initrd to make the changes be applied during subsequent boots.
  4. # dracut --logfile /var/log/YaST2/mkinitrd.log --force
  5. Reboot the system
Note : If dracut is invoked with the -N (--no-hostonly) argument, then the files in /etc/systemd/network/ will not be included in the initrd.
To address that add
--include /etc/systemd/network/ /etc/systemd/network/
to the dracut command.

Cause

The naming policy is defined in /usr/lib/systemd/network/99-default.link.

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

This problem can also appear on SLE 15 SP2 running on a SLE 12 SP4/5 KVM host as QEMU version 3.1.1 does expose the SLOT while QEMU 4.2 on SLES 15 SP2+ does not.

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

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Join Our Community

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.


SUSE Customer Support Quick Reference Guide SUSE Technical Support Handbook Update Advisories
Support FAQ

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.

Go to Customer Center