Solve the problem that eth0 cannot be initialized/eth0 cannot be found after CentOS6.4 is cloned.
# Ifconfig
Only the local loopback interface can be seen,
Then use
# Ifconfig-
View all available NICs and find that eth1 is not eth0.
Conjecture
During Clone, all Nic configurations of the original virtual machine are cloned,
But in VMware, Clone actually re-creates a server,
MAC addresses and so on will naturally be re-created,
However, because the configurations of the original server are copied, the newly created Nic is no longer eth0, but saved as eth1.
Solution:
Modify/Etc/udev/rules. d/70-persistent-net.rules // configuration file for saving Nic MAC address and other information
First, check that:
# PCI device 0x8086: 0x100f (e1000)
SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" eth0-MAC ", ATTR {type} =" 1 ", KERNEL =" eth * ", NAME =" eth0"
# PCI device 0x8086: 0x100f (e1000)
SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" eth1-MAC ", ATTR {type} =" 1 ", KERNEL =" eth * ", NAME =" eth1"
Delete the preceding eth0 information and set eth1-> eth0
# PCI device 0x8086: 0x100f (e1000)
SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" eth1-MAC ", ATTR {type} =" 1 ", KERNEL =" eth * ", NAME =" eth0"
Then change the MAC address in the ifcfg-eth0 to the eth1-MAC address above, and then configure the IP address and other information,
Restart the server.
Then you can use ifconfig to view the eth0 configuration information again.