Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

11.9. Troubleshooting Network Device Naming

Predictable interface names will be assigned for each interface, if applicable, as per the procedure described in Section 11.2, “Understanding the Device Renaming Procedure”. To view the list of possible names udev will use, issue a command in the following form as root:
~]# udevadm info /sys/class/net/ifname | grep ID_NET_NAME
where ifname is one of the interfaces listed by the following command:
~]$ ls /sys/class/net/
One of the possible names will be applied by udev according to the rules as described in Section 11.2, “Understanding the Device Renaming Procedure”, and summarized here:
  • /usr/lib/udev/rules.d/60-net.rules - from initscripts,
  • /usr/lib/udev/rules.d/71-biosdevname.rules - from biosdevname,
  • /usr/lib/udev/rules.d/80-net-name-slot.rules - from systemd
From the above list of rule files it can be seen that if interface naming is done through initscripts or biosdevname it always takes precedence over udev native naming. However if initscripts renaming is not taking place and biosdevname is disabled, then to alter the interface names copy the 80-net-name-slot.rules from /usr to /etc and edit the file appropriately. In other words, comment out or arrange schemes to be used in a certain order.

Example 11.1. Some Interfaces Have Names from the Kernel Namespace (eth[0,1,2...]) While Others Are Successfully Renamed by udev

Mixed up schemes most likely means that either for some hardware there is no usable information provided by the kernel to udev, thus it could not figure out any names, or the information provided to udev is not suitable, for example non-unique device IDs. The latter is more common and the solution is to use a custom naming scheme in ifcfg files or alter which udev scheme is in use by editing 80-net-name-slot.rules.

Example 11.2. In /var/log/messages or the systemd Journal, Renaming Is Seen to Be Done Twice for Each Interface

Systems with the naming scheme encoded in ifcfg files but which do not have a regenerated initrd image are likely to encounter this issue. The interface name is initially assigned (through biosdevname or udev or dracut parameters on the kernel command line) during early-boot while still in initrd. Then after switching to real rootfs, renaming is done a second time and a new interface name is determined by the /usr/lib/udev/rename_device binary spawned by udev because of processing 60-net.rules. You can safely ignore such messages.

Example 11.3. Using Naming Scheme in ifcfg Files with ethX Names Does Not Work

Red Hat Enterprise Linux does not provide a way to consistently apply the ethX naming convention except under very specific circumstances.
The udev rules, which set an interface to a specific name, fail if the requested name is already in use by some other interface. This includes the functionality provided by the /usr/lib/udev/rules.d/60-net.rules file.
Kernel uses the ethX naming convention at boot time when it enumerates network devices. The ethX names are inconsistent across various reboots, and thus they are unpredictable. Consequently, attempting to use udev to rename an interface to a predictable name or to reorder the unpredictable ethX names given by the kernel fails.
Using the ethX names works correctly for the following scenarios:
  • The system has only one network interface.
  • When used for virtio NICs in Red Hat Enterprise Linux 7 virtual machine guests. See the KVM Paravirtualized (virtio) Drivers and Network Configuration chapters in the Virtualization Deployment and Administration Guide

Example 11.4. Setting net.ifnames=0 Results in Inconsistent enpXxX Names

If both systemd predictable interface naming (net.ifnames) and biosdevname naming schemes are disabled, network interfaces continue to use the unpredictable and potentially inconsistent ethX name originally given by the kernel.
Kernel always uses the enpXxX naming convention at boot when it enumerates network devices. Due to parallelization, the order of the kernel interface enumeration is expected to vary across reboots. Red Hat Enterprise Linux relies on either systemd predictable interface naming scheme or the biosdevname naming scheme to rename the kernel unpredictable ethX interfaces in a predictable way to a name which is always consistent across reboots.
For more information about network adapter naming conventions, see the Is it safe to set net.ifnames=0 in RHEL7? Knowledge Centered Support article on the Red Hat Customer Portal.

Example 11.5. Limitations for Prefixes of Ethernet Interfaces

The prefix that you choose must meet the following requirements:
  • It consists of ASCII characters.
  • It is an alpha-numeric string.
  • It is shorter than 16 characters.
  • It does not conflict with any other well-known prefix used for network interface naming, such as eth, eno, ens, and em.