Search This Blog

2013-05-21

Consistent Interface Naming with Biosdevname

Why are my interfaces mapped em for some and eth for others?

This is very likely due to a change in naming convention brought upon by Dell and a partnership with RedHat to make interface naming less confusing. It is called 'biosdevname' and may leave you confused as to why some of your interfaces are mapped differently on new dell systems from what they were before.

Dell Supports this new naming convention out of the box and has special parameters to ensure they work on Dell machines by default.

What is biosdevname?

Dell and RedHat have partnered together to develop a new standardized naming convention for interfaces. Instead of starting at the traditional eth0 and working their way up in an arbitrary fashion, they have made it so that interface names match the interface numbering on the chassis.

Such that em1 = embedded motherboard port 1 (which is labeled with a 1 on the chassis).

PCI interfaces are always difficult to name correctly and idenfity. Typically, with eth naming they would just continue the sequence number in an arbitrary fashion, making it difficult to know whether eth3 is on the first pci card or the second.

The new naming convention makes it so that pci interfaces are named logically. This named sdevices by the following convention

p(slot#)p(port#)_(virtual_function_instance)

The Requirements

  • Be on a Supported OS platform (RHEL >=6.1)
  • Run on a supported hardware/BIOS platform (most 12th generation and above servers)
  • Check for SMBios Support (type 9 and type 41)

Biosdevname will be installed and will work by default on supported platforms. The kernel parameter biosdevname=0 can be added to /boot/grub/grub.conf in order to disable this functionality.

If you wish to transfer to biosdevname you will have to remove mappings in /etc/udev/rules.d/70-persistent-net.rules and change interface names in /etc/sysconfig/network-scripts/ifcfg-* to the appropriate em names.

There is much more information regarding biosdevname on the dell website. They will give you an idea of which generation of devices are supported and what hardware/bios/os version is required to utilize this new naming convention.

Useful links

Consistent Device Naming - http://linux.dell.com/files/whitepapers/consistent_network_device_naming_in_linux.pdf
Migrating to biosdevname - http://linux.dell.com/files/whitepapers/consistent_network_device_naming_migration_guide_rhel_6.pdf
Checking for SMBios Support - https://fedoraproject.org/wiki/Test_Day:2011-01-27_Network_Device_Naming_With_Biosdevname

Commands and Examples

biosdevname mapping

ls -lah /sys/class/net/
total 0
drwxr-xr-x  2 root root 0 May 14 10:22 .
drwxr-xr-x 37 root root 0 May 14 10:22 ..
lrwxrwxrwx  1 root root 0 May 14 10:22 em1 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/net/em1
lrwxrwxrwx  1 root root 0 May 14 10:22 em2 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.1/net/em2
lrwxrwxrwx  1 root root 0 May 14 10:22 em3 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.2/net/em3
lrwxrwxrwx  1 root root 0 May 14 10:22 em4 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.3/net/em4
lrwxrwxrwx  1 root root 0 May 14 10:22 lo -> ../../devices/virtual/net/lo

lspci | grep -i giga
01:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
01:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
01:00.2 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
01:00.3 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)

cd ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/net/em1/

cat ifindex
2

Traditional Eth Mapping

ls -lah /sys/class/net/
total 0
drwxr-xr-x  2 root root 0 May 14 13:46 .
drwxr-xr-x 37 root root 0 May 14 13:46 ..
lrwxrwxrwx  1 root root 0 May 14 13:46 eth0 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/net/eth0
lrwxrwxrwx  1 root root 0 May 14 13:46 eth1 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.1/net/eth1
lrwxrwxrwx  1 root root 0 May 14 13:46 eth2 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.2/net/eth2
lrwxrwxrwx  1 root root 0 May 14 13:46 eth3 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.3/net/eth3
lrwxrwxrwx  1 root root 0 May 14 13:46 lo -> ../../devices/virtual/net/lo

lspci | grep -i giga
01:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
01:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
01:00.2 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
01:00.3 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)

cd /sys/class/net/
cd ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/net/
cat ifindex
2

Checking PCI mappings

Tradtitional eth naming

ethtool -i eth0
driver: igb
version: 3.2.10-k
firmware-version: 1.5-6
bus-info: 0000:01:00.0

New Biosdevname Naming

ethtool -i em1
driver: igb
version: 3.2.10-k
firmware-version: 1.5-6
bus-info: 0000:01:00.0

Important Files

/lib/udev/rules.d/71-biosdevname.rules - rules to determine whether biosdevname is enabled/disabled
/boot/grub/grub.conf - can be used to disable biosdevname on the kernel line
/etc/udev/rules.d/70-persistent-net.rules - maintains persistent mapping of PCI busses to interface names
/sys/class/net/ - directory that maintains a consistent list/mapping of dev names to PCI bus addresses
/etc/sysconfig/network-scripts/ifcfg-* - scripts that contain interface configuration specific information


No comments:

Post a Comment