Software & AppsOperating SystemLinux

How To Rename Interface Device Name from em1 to eth0 in Linux 14.04 LTS

Ubuntu 9

In this article, we will delve into the process of renaming the interface device name from em1 to eth0 in Linux 14.04 LTS. This can be a crucial task for system administrators managing network configurations.

Understanding the Interface Device Name

In Linux, each network interface has a unique name that allows the system and administrators to identify it. The names em1 or eth0 are examples of these interface device names. The traditional naming convention for wired Ethernet interfaces in Linux was eth0, eth1, etc. However, in some newer Linux distributions, the naming convention has changed to em1, em2, etc.

Methods to Rename Interface Device Name

There are three main methods to rename the interface device name:

  1. Uninstalling the biosdevname package
  2. Editing the /etc/default/grub file
  3. Editing the 70-persistent-net.rules file

Method 1: Uninstalling the biosdevname package

The biosdevname package in some Linux distributions is responsible for the em naming convention. By uninstalling this package, you can revert to the traditional eth naming convention. Here’s how you can do it:

  1. Open the terminal. You can do this by pressing Ctrl+Alt+T on your keyboard.
  2. Run the following command to uninstall the biosdevname package:
sudo apt-get remove biosdevname

The sudo command allows you to run this command with root permissions. The apt-get remove command uninstalls the specified package, in this case, biosdevname.

  1. After uninstalling, run the following command to update the initial RAM filesystem:
sudo update-initramfs -u
  1. Finally, reboot your system with the following command:
sudo reboot

After the system reboots, the interface device name should be changed to eth0.

Method 2: Editing the /etc/default/grub file

Another method to rename the interface device name is by editing the GRUB bootloader configuration. Here’s how to do it:

  1. Open the terminal.
  2. Run the following command to open the GRUB configuration file in a text editor:
sudo nano /etc/default/grub

The nano command opens the specified file in the Nano text editor. You can replace nano with your preferred text editor.

  1. In the file, search for the lines GRUB_CMDLINE_LINUX_DEFAULT="" and GRUB_CMDLINE_LINUX="".
  2. Add biosdevname=0 to both lines, so they become:
GRUB_CMDLINE_LINUX_DEFAULT="biosdevname=0"
GRUB_CMDLINE_LINUX="biosdevname=0"
  1. Save the file and exit the editor. In Nano, you can do this by pressing Ctrl+X, then Y to confirm saving the changes, and Enter to confirm the file name.
  2. Run the following command to update the GRUB configuration:
sudo update-grub
  1. Reboot your system. After the system reboots, the interface device name should be changed to eth0.

Method 3: Editing the 70-persistent-net.rules file

The final method involves editing a udev rules file. Here’s how to do it:

  1. Open the terminal.
  2. Run the following command to open the 70-persistent-net.rules file in a text editor:
sudo nano /etc/udev/rules.d/70-persistent-net.rules
  1. In the file, locate the line that corresponds to the hardware named em1.
  2. Replace em1 with eth0.
  3. Save the file and exit the editor.
  4. Reboot your system. After the system reboots, the interface device name should be changed to eth0.

Conclusion

Renaming the interface device name in Linux 14.04 LTS from em1 to eth0 can be achieved through several methods. Each method has its own advantages and use cases, and you can choose the one that best fits your needs. Always remember to back up your important files before making changes to system configurations. If you encounter any issues, don’t hesitate to seek help from the Linux community.

Why would I want to rename the interface device name from `em1` to `eth0`?

Renaming the interface device name can be useful in cases where you have scripts or configurations that rely on the traditional eth naming convention. By changing the name to eth0, you can ensure compatibility with those scripts and configurations.

Can I rename the interface device name to something other than `eth0`?

Yes, you can choose any name you prefer as long as it follows the naming conventions and does not conflict with existing device names. However, it is recommended to stick with the traditional eth naming convention to maintain compatibility with scripts and configurations.

Will renaming the interface device name cause any network connectivity issues?

Renaming the interface device name should not cause any network connectivity issues as long as you follow the correct procedures and ensure that the renamed device is properly configured with the necessary network settings.

Do I need to reboot my system after renaming the interface device name?

Yes, rebooting your system is necessary for the changes to take effect. After rebooting, the interface device name should be updated to the new name you have chosen.

Can I revert the changes and go back to the default `em1` naming convention?

Yes, you can revert the changes by following the same methods and replacing the new name with em1 instead of eth0. Make sure to update the necessary configuration files and reboot your system for the changes to take effect.

Leave a Comment

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