Linux how to change interface name

When cloning vm’s inside a ESX I always get a eth1 instead of eth0.
So here is what I do to fix that.

Step #1:Get Mac
ifconfig -a | grep hwaddr
eth0 Link encap:Ethernet HWaddr b8:ac:6f:65:31:e5

Step #2: Rename eth1 as eth0
vi /etc/udev/rules.d/70-persistent-net.rules

The names of the Ethernet devices are listed in this file as follows, also check the MAC address:
# PCI device 0x14e4:0x1680 (tg3)
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”b8:ac:6f:65:31:e5″, ATTR{dev_id}==”0x0″, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth0″
Save and close the file. Reboot the system to test changes:
Step #3: Restart the server
reboot

Verify new settings:
ifconfig -a
ifconfig eth0
ifconfig -a | less
ip addr show

One thought

Leave a Reply

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

VAMOVE *

*