After the image is cloned from a vmware or kvm xen Vm, the network cannot be started for the new Centos instance. The system prompts Device eth0 does not seem to be present, delaying initialization.
Two known solutions:
-
(1)
-
Mv/etc/sysconfig/network-scripts/ifcfg-eth0/etc/sysconfig/network-scripts/ifcfg-eth1
-
Vi/etc/sysconfig/network-scripts/ifcfg-eth0
-
Directly change
-
DEVICE = eth1
-
TYPE = Ethernet
-
ONBOOT = YES
-
NM_CONTROLLED = yes
-
BOOTPROTO = static
-
IPADDR = YourIP
-
GATEWAY = YourGateWay
-
NETMASK = 255.255.255.0
-
Servicenetworkrestart is up, and the NIC is eth1
-
-
(2)
-
Vi/etc/sysconfig/network-scripts/ifcfg-eth0
-
DEVICE = eth0
-
TYPE = Ethernet
-
ONBOOT = YES
-
NM_CONTROLLED = yes
-
BOOTPROTO = static
-
IPADDR = YourIP
-
GATEWAY = YourGateWay
-
NETMASK = 255.255.255.0
-
# Device ipaddr must be capitalized
-
Rm-f/etc/udev/rules. d/70-persistent-net.rules
-
Reboot