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 "emX" rather than "ethX" during the setup process:
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.
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.
Depending on your physical hardware, setting biosdevname=0 might not be enough. Some information hints that biosdevname is only applicable on DELL hardware.
Another Kernel parameter is net.ifnames. Setting net.ifnames=0 should generally disable the "predictable names" for the network interfaces. From the Systemd documentation:
net.ifnames=
Network interfaces are renamed to give them predictable names when possible. It is enabled by default; specifying 0 disables it.
Added in version 199.
Therefore:
ck@mint ~ $ cat /etc/default/grub | grep CMDLINE
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash net.ifnames=0"
GRUB_CMDLINE_LINUX=""
ck@mint ~ $ sudo update-grub
No comments yet.
AWS Android Ansible Apache Apple Atlassian BSD Backup Bash Bluecoat CMS Chef Cloud Coding Consul Containers CouchDB DB DNS Database Databases Docker ELK Elasticsearch Filebeat FreeBSD Galera Git GlusterFS Grafana Graphics HAProxy HTML Hacks Hardware Icinga Influx Internet Java KVM Kibana Kodi Kubernetes LVM LXC Linux Logstash Mac Macintosh Mail MariaDB Minio MongoDB Monitoring Multimedia MySQL NFS Nagios Network Nginx OSSEC OTRS Office PGSQL PHP Perl Personal PostgreSQL Postgres PowerDNS Proxmox Proxy Python Rancher Rant Redis Roundcube SSL Samba Seafile Security Shell SmartOS Solaris Surveillance Systemd TLS Tomcat Ubuntu Unix VMWare VMware Varnish Virtualization Windows Wireless Wordpress Wyse ZFS Zoneminder