RHEL6.3 resolution of NIC startup failure after cloning Virtual Machine

Source: Internet
Author: User

RHEL6.3 failed to start the NIC After cloning the VM. The company installed RHEL6.3 in the test environment. After cloning the VM, the cloned VM Nic cannot start. The following error is reported: www.2cto.com [root @ localhost Desktop] # service network restartShutting down loopback interface: [OK] Bringing up loopback interface: [OK] Bringing up interface eth0: Error: No suitable device found: no device found for connection 'System eth0 '. [FAILED] When you execute the ifconfig command, you will find that the configuration file of the eth1 Nic is/etc/sysconfig/network-script. S/ifcfg-eth0. [Root @ localhost network-scripts] # ifconfig | grep addreth1 Link encap: Ethernet HWaddr 00: 0c: 29: f4: 95: e3 inet6 addr: fe80: 20c: 29ff: fe5c: 65b7/64 Scope: Link Interrupt: 19 Base address: 0x2024 inet addr: 127.0.0.1 Mask: 255.0.0.0 inet6 addr: 1/128 Scope: host [root @ localhost network-scripts] # lsifcfg-eth0 ifdown-isdn ifup-aliases ifup-plusb init. ipv6-globalifcfg-lo ifdown-post ifup-bnep ifup-post net. hotplu Gifdown ifdown-ppp ifup-eth ifup-ppp network-functionsifdown-bnep ifdown-routes ifup-ippp ifup-routes network-functions-ipv6ifdown-eth ifdown-sit ifup-ipv6 ifup-sitifdown-ippp ifdown-tunnel ifup-isdn ifup-tunnelifdown-ipv6 ifup-plip ifup-wireless [root @ localhost network-scripts] # the cause of this problem is that the virtual machine assigned to the operating system's virtual network card MAC address is different. The MAC address of the network adapter of the first system is recorded in/etc/udev/rules. d/70-persistent-net.rules and named eth0. The MAC address of the NIC of the newly cloned system is also recorded in this file, which is the same as that of the previous system, so there is a conflict. You can check the content of the 70-persistent-net.rules file of the two machines. First System: [root @ localhost rules. d] # cat 70-persistent-net.rules # This file was automatically generated by the/lib/udev/write_net_rules # program, run by the persistent-net-generator.rules rules file. # You can modify it, as long as you keep each rule on a single # line, and change only the value of the NAME = key. # PCI device 0x1022: 0x2000 (pcnet32) SUBSYSTEM = "ne T ", ACTION =" add ", DRIVERS = "? * ", ATTR {address} =" 00: 0c: 29: f4: 95: e3 ", ATTR {type} =" 1 ", KERNEL = "eth *", NAME = "eth0" cloned system: [root @ localhost rules. d] # cat 70-persistent-net.rules # This file was automatically generated by the/lib/udev/write_net_rules # program, run by the persistent-net-generator.rules rules file. # You can modify it, as long as you keep each rule on a single # line, and change only the value of the NAME = key. # PCI Device 0x1022: 0x2000 (pcnet32) SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 00: 0c: 29: f4: 95: e3 ", ATTR {type} =" 1 ", KERNEL = "eth *", NAME = "eth1", we can see that the MAC addresses in these two systems are the same. Solution: Delete the cloned/etc/udev/rules in the system. d/70-persistent-net.rules file. After restart, the system will generate a new MAC address for the virtual network card, and change eth1 of NAME = "eth1" in this file to eth0, you also need to modify the mac address in ATTR {address} and the mac address of the/etc/sysconfig/network-scripts/ifcfg-eth0 file, and keep it consistent with the MAC address of the new virtual Nic. For example, convert the SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 00: 0c: 29: f4: 95: e3 ", ATTR {type} =" 1 ", KERNEL = "eth *", NAME = "eth1" changed to SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 00: 0c: 29: 5c: 65: b7 ", ATTR {type} =" 1 ", KERNEL = "eth *", NAME = "eth0" Modify/etc/sysconfig/network-scripts/ifcfg-eth0 file DEVICE = "eth0" Listen 6init = "yes" NM_CONTROLLED = "yes" ONBOOT = "yes" TYPE =" ethernet "UUID =" login "DEFROUTE = yesIPV4_FAILURE_FATAL = yesIPV6_AUTOCONF = yesIPV6_DEFROUTE = yesIPV6_FAILURE_FATAL = noNAME =" System eth0 "HWADDR = 00: 0c: 29: 5c: 65: b7 and then restart the network service to find everything is normal. [Root @ localhost Desktop] # service network restartShutting down interface eth0: Device state: 3 (disconnected) [OK] Shutting down loopback interface: [OK] Bringing up loopback interface: [OK] Bringing up interface eth0: Active connection state: activatingActive connection path:/org/freedesktop/NetworkManager/ActiveConnection/1 state: activatedConnection activated [OK] After setting the IP address, check [root @ localhost Desktop] # ifconfig | grep addreth0 Link encap: Ethernet HWaddr 00: 0C: 29: 5C: 65: B7 inet addr: 192.168.0.129 Bcast: 192.168.0.255 Mask: 255.255.255.0 inet6 addr: fe80 :: 20c: 29ff: fe5c: 65b7/64 Scope: Link Interrupt: 19 Base address: 0x2024 inet addr: 127.0.0.1 Mask: 255.0.0.0 inet6 addr: 1/128 Scope: Host note: if you find that eth1 is still displayed instead of eth0 when executing the ifconfig command, you can restart the system and change it.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.