Recently, I moved some of my virtual machines to new place. By doing that, I figured out that my Centos linux server, was unable to connect to internet and was not getting any ip address.
Therefore, when I did ifconfig command, the interface name was changed from eth1 to eth0. In this post, I will show how to put it back as eth0.
First of all, open the file /etc/udev/rules.d/70-persistent-net.rules with your favorite editor. I used vim, so
On that file, you should see two lines like below
What you have to do
1. Remove or comment the line which start with SUBSYSTEM and end with eth0
2. Change the 2nd line name from eth1 to eth0
3. Copy the 2nd line MAC address (in my example it is 00:0C:29:1B:25:0E… you will need it for another place
After that, open the file
On that file, simply change the HWADDR address with the one you copied from above file OR you may also remove the HWADDR line if you want
I tried to restart the network service but without succes. Therefore, I had to reboot the server to make it work’s : reboot
Disclaimer: All work shared in this post is property of IT Secure Net