After the CentOS cloned from the VM is restored, the network cannot be connected. If ifconfig is used, no eth0 is detected, and the virtual NIC address is changed.
Solution:
First, open/etc/udev/rules. d/70-persistent-net.rules with the following content:
# PCI device 0x1022: 0x2000 (pcnet32)
SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 00: 0c: 29: 8f: 89: 97 ", ATTR {type} =" 1 ", KERNEL = "eth *", NAME = "eth0"
# PCI device 0x1022: 0x2000 (pcnet32)
SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 00: 0c: 29: 50: bd: 17 ", ATTR {type} =" 1 ", KERNEL = "eth *", NAME = "eth1"
In the past, the NIC Driver configured for the new virtual machine was re-installed to eth1 according to the new Nic, so there are two solutions:
First, delete the newly added eth1 configuration and change the Virtual Machine NIC address to the same as eth0;
The second is to change the NIC address and name in the/etc/sysconfig/network-scripts/ifcfg-eth0 to the same as eth1.