What should I do if the NIC cannot be started after the Linux virtual machine is cloned?

  
                

In Linux system operation, after using VMware's cloning function, the network card is faulty and the network connection is not up. What should I do if I encounter this problem? The following small series will introduce you to the solution of the network card error after Linux virtual machine cloning, let's learn together.

1 Problem Description

VMware to clone a virtual machine is a regular thing for the client virtual machine is cloned directly Winows would be used. After the virtual machine clone of the client is Linux, there will be a problem that the network cannot be started.

Using the service network start command, an error message appears as follows:

device eth0 does not seem to be present

2 Cause Analysis

Using VMware's cloning function A newly created virtual machine is configured with a network card different from the MAC address of the original virtual machine network card. For Linux systems such as CentOS, the runtime NIC MAC address is recorded in the /etc/udev/rules.d/70-persistent-net.rules file. This record is also saved in the new cloned system.

When the new system starts up, since vmware has configured different MAC addresses for it, the system will treat the new MAC address of the network card as eth1 when starting the scanning hardware, and add the above file. in. At this time, /etc/sysconfig/network-scripts/ifcfg-eth0 in the configuration file records the original MAC address, and this MAC address does not exist in the new system, so it cannot be started.

3 Solution

In the new system, delete the eth0 line corresponding to the old MAC recorded in the rules file, and then change the name of eth1 corresponding to the new MAC to eth0. Then change the value of HDADDR to the new MAC address in the ifcfg-eth0 file.

Such rules and ifcfg-eth0 correspond to each other (eth0 in the rules corresponds to the ifcfg-eth0 file name, and the mac in the rules corresponds to the HDADDR in the ifcfg-eth0 file). At this point you need to restart the system and everything is OK.

The above is the solution to the NIC error after the Linux virtual machine is cloned. Because the cloned MAC address does not exist, resetting the MAC address can solve this problem.

Copyright © Windows knowledge All Rights Reserved