How to rename eth1 to eth0

Issue

– How to rename eth1 to eth0
– How to rename ethX to yourname

Hey, Most of the time when you are dealing with cloned Virtual Linux Servers, You may get the Ethernet device name as eth3,4 etc and without eth0. How we can rename it to eth0, eth1 or even to AWSADMINZ !!!

Lets see, So this is how you can rename it back to eth0 or any name.

Solution

cd /etc/sysconfig/network-scripts/
mv ifcfg-eth4 ifcfg-eth0

– Open the file with VI and change the DEVICE field to eth0 from eth4

DEVICE=eth4 to DEVICE=eth0

– Now, Open the following file /etc/udev/rules.d/70-persistent-net.rules with vi

vim /etc/udev/rules.d/70-persistent-net.rules

– You can see some lines as below, `SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”00:16:17:de:ad:20″, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth4″`
– Now change the last part of the line to NAME=”eth0″ from NAME=”eth4″

– So the lines will be like this.
`SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”00:16:17:de:ad:20″, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth0″`
– Thats it, Now reboot the server by running,

reboot

– Once the server is up, You can run ifconfig to see the new name of the device.

Comment and Share if found  helpul. ! 🙂

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
Scroll to Top