Why are systemd network interface names different between RHEL7 and RHEL8 ?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 7 and later
  • systemd Predictable Network Interface Names (net.ifnames=1)

Issue

  • Why are systemd network interface names different between RHEL7 and RHEL8 ?
  • Why is NIC naming different between RHEL 7 and RHEL 8?
  • On RH7 the NIC name is enp#, but on RH8 the NIC name is ens#.
  • Different network naming between RHEL7 and RHEL8
  • On the RHEL8 server, the interfaces come up with the ens3f0/1 naming convention. On the RHEL7 server, the interfaces come up with the p3p1/2 naming convention.
  • I wanted to understand more on why for the same physical server chassis with network cards in the same slots we see differences for the naming convention in RHEL7 RHEL8.

Resolution

Network interface names are not expected to always be the same between major versions of RHEL.

It is expected that installation of one major release (eg: RHEL7) and then another major release (eg: RHEL8) could result in network interface names changing, even on the exact same system.

Possible Workaround

As of RHEL 8.4 (systemd-239-45.el8 provided by Errata RHSA-2021:1611) it is possible to encourage systemd-udev to name according to previous naming schemes, by adding the following to the kernel boot line, where SCHEME_VERSION is a valid version:

net.naming-scheme=SCHEME_VERSION

However, the versioning strings start at v238 and rhel-8.0 (which is v239). There are no RHEL 7 version options available.

This feature is described further at:

To view all version logic, view Content from github.com is not included.udev-builtin-net_id.c in the RHEL systemd source, looking for the enum NamingSchemeFlags and array naming_schemes[].

Root Cause

From the systemd net-naming-scheme manual page:

<Content from www.freedesktop.org is not included.https://www.freedesktop.org/software/systemd/man/systemd.net-naming-scheme.html>
Names and MAC addresses are derived from various stable device metadata attributes. Newer versions of udev take more of these attributes into account, improving (and thus possibly changing) the names and addresses used for the same devices.

From systemd's netif-naming-scheme.c:

  8 static const NamingScheme naming_schemes[] = {
  9         { "v238", NAMING_V238 },
 10         { "v239", NAMING_V239 },
 11         { "v240", NAMING_V240 },
 12         { "v241", NAMING_V241 },
 13         { "v243", NAMING_V243 },
 14         { "v245", NAMING_V245 },
 15         { "v247", NAMING_V247 },
 16         { "v249", NAMING_V249 },
 17         /* … add more schemes here, as the logic to name devices is updated … */   <-------
 18 };

So new naming schemes may be added in later versions of systemd.

Diagnostic Steps

The udevadm info shows different attribute for RHEL8 compared to RHEL7.

RHEL7

# udevadm info -q property -p /class/net/enp59s0f0

P: /devices/pci0000:3a/0000:3a:00.0/0000:3b:00.0/net/enp59s0f0
E: DEVPATH=/devices/pci0000:3a/0000:3a:00.0/0000:3b:00.0/net/enp59s0f0
E: ID_BUS=pci
E: ID_MM_CANDIDATE=1
E: ID_MODEL_FROM_DATABASE=I350 Gigabit Network Connection
E: ID_MODEL_ID=0x1521
E: ID_NET_DRIVER=igb
E: ID_NET_NAME_MAC=enxaabbcc112233
E: ID_NET_NAME_PATH=enp59s0f0
E: ID_OUI_FROM_DATABASE=QUANTA COMPUTER INC.
E: ID_PATH=pci-0000:3b:00.0
E: ID_PATH_TAG=pci-0000_3b_00_0
E: ID_PCI_CLASS_FROM_DATABASE=Network controller
E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller
E: ID_VENDOR_FROM_DATABASE=Intel Corporation
E: ID_VENDOR_ID=0x8086
E: IFINDEX=2
E: INTERFACE=enp59s0f0
E: SUBSYSTEM=net
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/enp59s0f0
E: TAGS=:systemd:
E: USEC_INITIALIZED=870366

RHEL8

# udevadm info -q property -p /class/net/ens5f0

P: /devices/pci0000:3a/0000:3a:00.0/0000:3b:00.0/net/ens5f0
E: DEVPATH=/devices/pci0000:3a/0000:3a:00.0/0000:3b:00.0/net/ens5f0
E: ID_BUS=pci
E: ID_MM_CANDIDATE=1
E: ID_MODEL_FROM_DATABASE=I350 Gigabit Network Connection
E: ID_MODEL_ID=0x1521
E: ID_NET_DRIVER=igb
E: ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
E: ID_NET_NAME=ens5f0
E: ID_NET_NAME_MAC=enxaabbcc112233
E: ID_NET_NAME_PATH=enp59s0f0
E: ID_NET_NAME_SLOT=ens5f0 <------------------------------------- new attribute added
E: ID_OUI_FROM_DATABASE=QUANTA COMPUTER INC.
E: ID_PATH=pci-0000:3b:00.0
E: ID_PATH_TAG=pci-0000_3b_00_0
E: ID_PCI_CLASS_FROM_DATABASE=Network controller
E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller
E: ID_VENDOR_FROM_DATABASE=Intel Corporation
E: ID_VENDOR_ID=0x8086
E: IFINDEX=2
E: INTERFACE=ens5f0
E: SUBSYSTEM=net
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/ens5f0
E: TAGS=:systemd:
E: USEC_INITIALIZED=6537299
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.