The network cannot be started after the VM is cloned and restarted.
After cloning or reinstalling the virtual machine and then starting the system, you will find that there is no eth0 in the system, but it becomes eth1. When/etc/init is used. d/network: When you restart the network, the system will prompt that the startup scripts of eth0 and eth1 cannot be found.
The solution is as follows:
Method 1:
Make the following changes:
Rename the/etc/sysconfig/network-scripts/ifcfg-eth0 to/etc/sysconfig/network-scripts/ifcfg-eth1,
Modify the mac address in/etc/sysconfig/network-scripts/ifcfg-eth0 to the physical address of the original eth0 Nic, and the virtual machine assigns a new physical address for eth1, therefore, the information in the startup script does not match the actual information. Delete the MAC address information from the script and restart the network again. OK!
Why does the original eth0 change to eth1?
Many Linux distribution uses udev to dynamically manage device files and name them based on device information. Udev identifies the NIC during system boot, and records the mac address and nic name in the udev rule script. For new virtual machines, VMware will automatically generate a MAC address for the Virtual Machine's Nic. When you clone or reinstall the Virtual Machine Software, because you used the previous system virtual hard disk information, the system already has eth0 information. For this new Nic, udev will automatically name it eth1 (accumulation principle), so after your system starts, the Network Card Name you see in ifconfig is eth1.
How can I change the name back to eth0?
In Fedora 11, the udev Network Rule recording script is:/etc/udev/rules. d/70-persistent-net.rules.
Open the file and you will find that there are eth0 and eth1 NICs, but in fact you can only find the information of one eth1 Nic In ifconfig, because eth0 does not exist at all.
Delete eth0 information, change the device name in eth1 to eth0, restart the system, and then ifconfig the network adapter you see is eth0, or delete all the information and restart the system udev to help you find the new device.
Method 2:
In CentOS, delete the file/etc/udev/rules. d/70-persistent-net.rules, edit/etc/sysconfig/network-scripts/ifcfg-eth0, delete the MAC address, then restart init 6 or reboot, then it should be able to start eth0!
The above content has been tested by myself. If there is any change, update it at any time! For reference only ...... If you have other questions, you can discuss them together !!!
This article permanently updates the link address: