VMware克隆后找不到eth0
用ESX克隆虚拟机的时候,会发现网卡编号变化了,原来的eth0,eth1不见了,而出现了eth2,eth3。我估计可能的原因是ESX在创建虚拟机时,会重新创建网卡,当系统发现网卡和配置不一样时,就新建了新的网络接口。
可以用下面的方法把eth0改回来:
修改70-persistent-net.rules文件
1. [root@RedHat89178 ~]# vim /etc/udev/rules.d/70-persistent-net.rules
2. # This file wasautomatically generated by the /lib/udev/write_net_rules
3. # program, run by thepersistent-net-generator.rules rules file.
4. #
5. # You canmodify it, as long as you keep each rule on a single
6. # line, and changeonly the value of the NAME= key.
7.
8. # PCI device0x15ad:0x07b0 (vmxnet3)
9. # 把原来的配置注释掉
10. #SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:9c:00:99", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
11.
12. # PCI device0x15ad:0x07b0 (vmxnet3)
13. # 把新出现的eth2改为eth0
14. SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:9c:00:9a", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
更改网卡配置文件
更新主机名
参考链接:http://www.linuxidc.com/Linux/2012-09/70025.htm