Many times, when we use the virtual machine, we will install a virtual machine as model, the need to build a test environment will be copied by the model to achieve, so convenient and fast, and then in the replication of the new System network card check can not be used directly, this is because the MAC address of the network card is unique, Copy of the new system, will generate a new MAC address, and the Ifcfg-eth0 configuration file inside the MAC address is still original, so you need to manually modify into a new MAC address.
After cloning the Linux system, the clone version cannot start the network card, prompting the error:
Device eth0 does not seem to be present,delaying initialization
Cause Analysis: Linux uses Udev to dynamically manage device files. VMware automatically generates the MAC address of the virtual machine. Thus, since the cloned Linux has recorded the original Linux network card MAC address corresponds to the NIC Eth0, in the cloned Linux due to the MAC address changes, Udev will automatically correspond to the MAC network card eth1, and so on. In fact, the kernel only recognized a network card, and the NIC name related to the configuration has not changed any.
Solution:
Udev saves Mac and Nic name correspondence in/etc/udev/rules.d/70-persistent-net.rules
Record the new Nic MAC address and name.
Cat/etc/udev/rules.d/70-persistent-net.rules
# PCI Device 0x8086:0x100f (e1000)------The address before the copy is commented out
subsystem== "NET", action== "Add", drivers== "? *", attr{address}== "00:0C:29:5F:88:BD", attr{type}== "1", kernel== "eth*" , name= "Eth0"
# PCI Device 0x8086:0x100f (e1000)-----The new address generated after copying, name= "eth1" is modified to Name= "eth0" and attr{address}== "00:0c:29:b6:87:5 6 "Value copied on Ifcfg-eth0
subsystem== "NET", action== "Add", drivers== "? *", attr{address}== "00:0c:29:b6:87:56", attr{type}== "1", kernel== "eth*" , name= "Eth1"
Vi/etc/sysconfig/network-scripts/ifcfg-eth0
Device=eth1 #修改为新的eth1.
hwaddr=00:0c:29:b6:87:56 #用新的MAC替换 00:0c:29:b6:87:56
Type=ethernet
Uuid=fa6bcd84-01ab-4b2d-9dd6-8d4a3a1961ac
Onboot=yes
Nm_controlled=yes
Bootproto=static
ipaddr=192.168.1.56 #修改IP (can not be modified if the original virtual machine is not running at the same time)
netmask=255.255.255.0
gateway=192.168.1.1
To restart the network card:
This article is from the "Silent Dialogue" blog, please be sure to keep this source http://chbinmile.blog.51cto.com/6085145/1879388
Linux virtual machine replication Nic does not start or use