Change NIC name on Ubuntu 17.10

hi all,

In this post, I will explain how to change the network interface name in Ubuntu based distro. In my case, I used release 17.10 (artful).

Since Ubuntu 16.04 (maybe even before), the classic name of network interfaces like eth0 or wlan0 has been replaced by really nasty names and often impossible to memorize. In fact, a renaming process occurs during the boot of the OS. I do not know why exactly but I can prove it 🙂 

Update 05.01.18 : Thank to @Eduardo for information in its comment. The reasons why this renaming is performed is explained in detail here : 

It is possible to show this renaming process by looking in the kernel log after the boot. Once you are logged into Ubuntu, open a terminal and display kernel log and filter output with egrep for example.

As you can see, during the boot, 2 network devices are detected, eth0 and wlan0, and for an unknown reason, they are renamed. It is possible to add a special command in the Grub configuration to avoid this renaming process. To do this, edit the file /etc/default/grub.

Search for the variable GRUB_CMDLINE_LINUX and set it to the following value : net.ifnames=0 biosdevname=0. In my case, I commented the default line, created a new one with the value. Once modified, you must have this entry in the file.

After that, it is necesary to reload this change. You can do it simply using this command:

Just reboot your system and the name of the NICs on your system should not be changed ! 
 

ps: If someone knows why Ubuntu performs this renaming, please let me a comment !

Bookmark the permalink.

2 Comments

  1. Hi Cyrill, this is already an older feature and has been published by a ubuntu developer in 2015. Follow this link: https://lists.ubuntu.com/archives/ubuntu-devel/2015-May/038761.html

    Second link: https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/

    • Cyrill Gremaud

      Hi eduardo and thank you for your useful information ! I better understand the reason of this renaming. I will modify my post to include the links for more information about this choice.

Leave a Reply

Your email address will not be published. Required fields are marked *