VMWare Image Clone Problem: eth0 Renamed As eth1

来源:互联网 发布:装修风格效果图软件 编辑:程序博客网 时间:2024/06/05 20:15

VMWare Image Clone Problem: eth0 Renamed As eth1

by nixCraft onJuly 11, 2011 · 18 comments·LAST UPDATED July 11, 2011

http://www.cyberciti.biz/tips/vmware-linux-lost-eth0-after-cloning-image.html

in vmware

After cloning a VMWare image I had noticed that my CentOS Linux server renamed eth0 as eth1, eth1 as eth2 and so on. This is due to wrong or duplicate mac address. To fix this problem login to your CentOS Linux server using console and type the following commands:

# cd /etc/udev/rules.d
# cp 70-persistent-net.rules /root/
# rm 70-persistent-net.rules
# reboot

This file was automatically generated by the /lib/udev/write_net_rules program, run by the persistent-net-generator.rules rules file. Simple delete it and reboot the system to recreate the same. This should fix the problem:
# /sbin/ifconfig | grep "^eth"
Sample outputs:

eth0      Link encap:Ethernet  HWaddr 00:0C:29:F3:E4:14eth1      Link encap:Ethernet  HWaddr 00:0C:29:F3:E4:1E

You need to remove the MAC address in /etc/sysconfig/networking-scripts/ifcfg-eth*. To find out current MAC address, enter:
# ifconfig -a | grep eth1 | grep HWaddr | awk '{ print $5}'
# ifconfig -a | grep eth2 | grep HWaddr | awk '{ print $5}'

Update your /etc/sysconfig/networking-scripts/ifcfg-eth0 with eth1 HWaddr (MAC address), enter:
# cat /etc/sysconfig/networking-scripts/ifcfg-eth0
Sample outputs:

 DEVICE="eth0"BOOTPROTO="dhcp"NM_CONTROLLED="yes"ONBOOT="yes"HWADDR="00:0C:29:69:0C:4A" 

Save and close the file. Restart the network service, enter:
# service network restart
You can verify new settings with the following commands:
# /sbin/ifconfig -a
# route -n

0 0