Network interfaces are named em instead of eth on Ubuntu 14.04 LTS

Written by - 0 comments

Published on - last updated on June 22nd 2023 - Listed in Linux Network


Today I manually installed a new Ubuntu 14.04 LTS server on a HP Proliant DL 380 Gen8 server. To my big surprise the network interfaces were detected as "em X" rather than "eth X" during the setup process:

Ubuntu naming interfaces em

The reason for this is a changed naming convention in the naming of network interfaces. It seems that Ubuntu has decided to go the same way as Fedora for the interface naming.

In one way it makes sense to call the onboard nics "em" (for embedded) to separate onboard and additional nics. But this can also lead to unexpected errors as there are many scripts to configure nics which use static naming, for example "ifconfig eth2".

The change of the interface names is coming from the biosdevname naming convention. As the Red Hat documentation describes it:

 Device  Old Name
 New Name
 Embedded network interface
 eth[012345...]  em[123456...]
 PCI network card
eth[012345...]  p<slot>p<port>
 Virtual
eth[012345...] p<slot>p<port>_<virtual interface>

The obvious advantage: The interface order is better detected and remains stable across reboots - while (theoretical) the older ethX naming could change for each interface after a reboot (mostly did not though).

In the meantime other naming styles have appeared. On my physical workstation I can see the onboard NIC being named enp3s0. On virtual machines using newer Ubuntu distributions the interfaces are often named eno160 or eno192. On some CentOS VM's I even spotted interfaces with names such as eno16777984. I agree, this can be quite confusing.

To revert back to the previous naming style (using eth0, eth1, etc) you can add the biosdevname Kernel option to your boot command line (usually in /etc/default/grub) and set it to 0 (default is 1 for enabled).

ck@mint ~ $ cat /etc/default/grub | grep CMDLINE
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash biosdevname=0"
GRUB_CMDLINE_LINUX=""

Followed by a Grub update:

ck@mint ~ $ sudo update-grub
[sudo] password for ck:       
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50_linuxmint.cfg'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.0-75-generic
Found initrd image: /boot/initrd.img-5.15.0-75-generic
Found linux image: /boot/vmlinuz-5.15.0-73-generic
Found initrd image: /boot/initrd.img-5.15.0-73-generic
Found linux image: /boot/vmlinuz-5.4.0-152-generic
Found initrd image: /boot/initrd.img-5.4.0-152-generic
Found linux image: /boot/vmlinuz-5.0.0-32-generic
Found initrd image: /boot/initrd.img-5.0.0-32-generic
done

ck@mint ~ $ sudo grub-install /dev/sda
Installing for i386-pc platform.
Installation finished. No error reported.


Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.