How to rename Ethernet Interfaces to eth0 in Ubuntu

In this guide i am going to show you how to rename Ethernet devices to eth0 from something like ens33 etc. Renaming ethernet devices to eth0 makes it a lot easier when setting up bonding in Ubuntu Server/Desktop, I do this because i use Bonding in Ubuntu Server for LACP etc, the old school eth0 is a lot better. Working in Ubuntu 16.04, 18.04 and 20.04, Note that from 18.04 + it now uses Netplan instead on /etc/network/interfaces.

The first thing we want to open up Terminal by pressing Ctrl Alt T or right click on the Desktop then press Open Terminal.

Now type sudo nano /etc/default/grub, Enter Password it should look something like this,

The line we are interested in and need to modify is GRUB_CMDLINE_LINUX=”” we need to modify this to GRUB_CMDLINE_LINUX=”net.ifnames=0 biosdevname=0″ after you added this the finished project should look like this,

To save Press Crt O hit enter to save then Ctrl Z to Exit. Before rebooting we need to update the grub bootloader without doing so the edits we applied will not take any affect. Now type the following sudo update-grub once doing this it should look something like this,

Now it is safe to reboot. Once booted back up now type ifconfig, Note this is already installed in Ubuntu Server but on Ubuntu Desktop it requires to be installed by typing sudo apt install net-tools make sure to run sudo apt update first. The output of ifconfig should show Network Interfaces as eth0, eth1 etc.

Hope this guide helps you. Enjoy.

Author:

Leave a Reply

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