8.10. Troubleshooting Network Device Naming

Predictable interface names will be assigned for each interface, if applicable, as per the procedure described in Section 8.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 8.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 via 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 8.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 8.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 (via 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 8.3. Using Naming Scheme in ifcfg Files with ethX Names Does Not Work

Red Hat Enterprise Linux 7 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 an ethX 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 8.4. Setting net.ifnames=0 Results in Inconsistent ethX 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 ethX 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 7 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.