From Fedora Project Wiki

Consistent Network Device Naming

Summary

Change the network device naming scheme from ethX to a physical location-based name for easy identification and use.

Owner

Current status

  • Targeted release: Fedora 15
  • Last updated: 2010-12-03
  • Percentage of completion: 90%

Detailed Description

Systems, particularly servers, with multiple network ports, name the ports ethX in a non-deterministic order, and are therefore not useful for system administrators.

The proposal is as follows:

  • update biosdevname to upstream release 0.3.1 (complete 27-Nov-2010)
  • ensure postinstall udev uses biosdevname in udev rules to name LAN-on-Motherboard network ports from ethX to em[1234] and PCI cards to pci<slot>#<port>_<vf> (complete 27-Nov-2010)
  • have kickstart / anaconda use the biosdevname-provided name em[1234] (complete 28-Nov-2010)
  • add biosdevname to @base (complete 28-Nov-2010)
  • add biosdevname to dracut-network (https://bugzilla.redhat.com/show_bug.cgi?id=659915)
  • have NetworkManager display the label somehow (TBD, not critical for feature)
  • initscripts needs to accept names with # in them (https://bugzilla.redhat.com/show_bug.cgi?id=663904)
  • udev renaming 2-step overflows IFNAMSIZ (https://bugzilla.redhat.com/show_bug.cgi?id=673675)
  • Don't suggest names when running in a VM (use virt-what ?)
  • Handle SR-IOV and NPAR better (get actual mapping of PFs and VFs to ports)

Benefit to Fedora

System Administrators can then use BIOS-provided names, which are consistent and not arbitrarily named, for their network ports. This eliminates the confusion that non-deterministic naming brings, and eliminates the use of hard-coded MAC address based port renaming which a) is racy and error-prone, and b) introduces state into an otherwise stateless system.

This change affects most desktop, notebook, and server-class systems.

Limitations

Not all add-in cards have a method to expose their Linux interface name(s) to external port mapping. biosdevname may provide incorrect names for such. Discussions are ongoing on the netdev mailing list to standardize a method of exposing such mapping.

Scope

  • See above

How To Test

  • System-Under-Test can be just about any system. Systems that expose SMBIOS 2.6 Type 9 and Type 41 fields are preferred, but the code will work on systems that expose the legacy PCI IRQ Routing Table as well.
  • biosdevname must be installed on the target system.
  • erase /etc/udev/rules.d/70-persistent-net.rules file. This is where naming is persisted across reboots.
  • reboot the system
  • Following reboot:
    • /sbin/ifconfig -a must show LAN-on-Motherboard ports named em[1234]
    • em[1234] must correspond to the chassis labels. Verify using ethtool -p em[1234] and watch the lights blink.
  • Installing using Anaconda:
    • anaconda should present network devices to use, having the new naming convention.

User Experience

Ethernet NICs embedded on the motherboard will be named em[1234] rather than ethX. PCI add-in card NICs will be named pci<slot>#<port>_<vf>.

Linux guests running under VMware Workstation 7 may find their (virtual) NICs named pci3#1. Linux guests running under Xen will not have devices renamed as the virtual machine BIOS does not provide the necessary information.

Dependencies

None

Contingency Plan

None necessary, revert to previous release behaviour.

Documentation

Release Notes

  • Servers often have multiple Ethernet ports, either embedded on the motherboard, or on add-in PCI cards. Linux has traditionally named these ports ethX, but there has been no correlation of the ethX names to the chassis labels - the ethX names are non-deterministic. Starting in Fedora 15, Ethernet ports on servers will have a new naming scheme corresponding to physical locations, rather than ethX. Ethernet ports embedded on server motherboards will be named em<port_number>, while ports on PCI cards will be named pci<slot_number>#<port_number>, corresponding to the chassis labels. Additionally, if the network device is an SR-IOV Virtual Function, the name will have a suffix of _<virtual_instance>.

By changing the naming convention, system administrators will no longer have to guess at the ethX to physical port mapping, or invoke workarounds on each system to rename them into some "sane" order.

This feature affects all systems that expose network port naming information in SMBIOS 2.6 or later (specifically field types 9 and 41). Dell PowerEdge 10G and newer servers (PowerEdge 1950 III family, PowerEdge R710 family, and newer), and HP ProLiant G6 servers and newer are known to expose this information, as do some newer desktop models. Furthermore, most older systems expose some information in the PCI IRQ Routing Table, which will be consulted if information is not provided by SMBIOS.

Existing installations upgraded to Fedora 15 will not see a change in names unless /etc/udev/rules.d/70-persistent-net.rules is deleted and the HWADDR lines are removed from all /etc/sysconfig/network-scripts/ifcfg-* files, and those files are renamed to use the new device names.

You may continue to write rules in /etc/udev/rules.d/70-persistent-net.rules to change the device names to anything you wish. Such will take precedence over this physical location naming scheme. Such rules may look like:

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:11:22:33:44:55", ATTR{type}=="1", KERNEL=="eth*", NAME="public"

Comments and Discussion