How to rename em1 to eth0 on Cent OS 6

For a while now, As a part of licensing scheme MAC address of the network interface card which you are running it needs a unique name. Since it just assumes that your ethernet device is /dev/eth0.

There is a part of an attempt to make interface naming more predictable and meaningful which is why  NICs that are embedded on the motherboard which are identified by udev as em1, em2 and so on.

So here i am going to show you how to rename the interface naming from em1 to eth0.

Just to be on safe side please make sure you have access to the console so that you can access to it even when your internet is down.

Furthermore steps are mentioned below:

  1. First make a backup of /etc/grub.conf retaining SELinux info as cp –preserve=context /etc/grub.conf /etc/grub.backup
  2. open the grub-configuration file and add biosdevname=0 at the end of the line to the kernel boot arguements in /etc/grub.conf
  3. You will need to rename the /etc/sysconfig/network-scripts/ifcfg-em1 to /etc/sysconfig/network-scripts/ifcfg-eth0. make sure to change DEVICE=em1 to DEVICE=eth0 inside that file.
  4. you will need to delete the file called 70-persistent-net.rules in /etc/udev/ruled.d.
  5. Finally reboot the machine.

Follow the above steps you will be able to see the interface name renamed from em1 to eth0.

Rajkishor Maharjan has written 17 articles