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.

fl0at0xff@bl00b:~/Desktop$ dmesg | egrep "renamed"

[1.692529] tg3 0000:04:00.0 enp4s0f0: renamed from eth0
[1.693602] tg3 0000:04:00.0 enx68cf2: renamed from wlan0

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.

fl0at0xff@bl00b:~/Desktop$ cat /etc/default/grub | egrep GRUB_CMDLINE_LINUX=

GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"

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

fl0at0xff@bl00b:~/Desktop$ sudo update-grub
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.13.0-21-generic
Found initrd image: /boot/initrd.img-4.13.0-21-generic
Found linux image: /boot/vmlinuz-4.13.0-19-generic
Found initrd image: /boot/initrd.img-4.13.0-19-generic
Found linux image: /boot/vmlinuz-4.13.0-17-generic
Found initrd image: /boot/initrd.img-4.13.0-17-generic
Found linux image: /boot/vmlinuz-4.13.0-16-generic
Found initrd image: /boot/initrd.img-4.13.0-16-generic

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.


  1. Hi Cyrill, this is already an older feature and has been published by a ubuntu developer in 2015. Follow this link:

    Second link:

    • 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.

  2. Helllo Cyrill.
    Thanks for your good explanation. It worked for Ubuntu 16.04 LTS…
    Unfortunately it is not working with 18.04… Or did I something wrong?
    Here is my /etc/default/grub

    GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
    GRUB_CMDLINE_LINUX_DEFAULT=”net.ifnames=0 biosdevname=0″

    After “update-grub” and a reboot, nothing has changed…
    Any suggestions…???

  3. its me again…
    I found the reason why it didn’t work…

    in the sub directory /etc/default/grub.d is now a file named
    this file overwrites the “GRUB_CMDLINE_LINUX_DEFAULT=” in the ../default/grub file.
    All I had to do is pasting the ”net.ifnames=0 biosdevname=0″ into “50-curtin-settings.cfg”
    update-grub and reboot… now it works as expected.

    Thanks again…

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.