Skip to content
Home » Linux » How to Change NIC Device Name Back to eth0 on Enterprise Linux 7

How to Change NIC Device Name Back to eth0 on Enterprise Linux 7

After installing CentOS 7.1 release 1503 in a virtual machine, I found the conventional NIC name has been changed as eno16777736, not eth0 anymore. But this could be changed back by following steps:
  1. Make sure MAC address of eno16777736
  2. [root@test ~]# ifconfig eno16777736
    ...
            ether 00:0c:29:4e:c6:92  txqueuelen 1000  (Ethernet)
    ...

  3. Add or change udev persistent rules
  4. [root@test ~]# vi /etc/udev/rules.d/70-persistent-ipoib.rules
    ...
    ACTION=="add", SUBSYSTEM=="net", DRIVERS=="?*", ATTR{type}=="32", ATTR{address}=="00:0c:29:4e:c6:92", NAME="eth0"

    Or on this file:
    [root@test ~]# vi /etc/udev/rules.d/70-persistent-net.rules
    Both files can result in the same effects.

  5. Rename the NIC file as ifcfg-eth0
  6. [root@test ~]# mv /etc/sysconfig/network-scripts/ifcfg-eno16777736 /etc/sysconfig/network-scripts/ifcfg-eth0
  7. Change device name into eth0
  8. [root@test ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
    ...
    NAME=eth0
    DEVICE=eth0
    ...

  9. Bounce the server
  10. [root@test ~]# init 6
  11. Check the ifconfig
  12. [root@test ~]# ifconfig eth0
    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    ...
All done!

Leave a Reply

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