About the replicated Linux virtual machine can not be networked and eth0 disappear solution __linux

Source: Internet
Author: User
Tags unique id
A. About Linux replication after eth0 become eth1 solution

When using the cloned virtual machine, found that the original network card in the basic system eth0 to the new system is not, using ifconfig-a will find only eth1. Because the basic system of network-related configuration is based on eth0, eth1 No network-related configuration, at this time to normal the network in the virtual machine, only add eth1 network configuration, so that every time to modify the NIC configuration in the long Linux system testing is inconvenient. Further, if you continue to clone or replicate new virtual machines based on this clone virtual machine, the identity card automatically adds 1 each time (the second clone becomes eth2), DMESG shows that the kernel only recognizes the NIC Eth0.

Each virtual machine network card has a unique ID, in Linux is the use of UUID, in order to ensure that the network card only, each copy of the network card ID will automatically add one.

So there are two ways to do this:

Programme I:

Udev the corresponding relationship between the Mac and the name of the network card in/etc/udev/rules.d/z25_persistent-net.rules, in the cloned virtual machine, just delete the line associated with name= "eth0" and restart the system. For example, in the Debian etch, delete the following two lines:

# PCI Device 0x1022:0x2000 (pcnet32) subsystem== "NET", drivers== "? *", attrs{address}
= = "00:0c:29:4c:46:01", Name= "eth0" under my fedora9/etc/udev/rules.d file deletion under 70-persistent-net.rules Delete # Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rule written by Anaconda) subsystem== "NET", action== "Add", drivers== "? *", Attr{addre SS} = = "00:0c:29:ad:06:2a", attr{type}== "1", kernel== "eth*", Name= "eth0" and then the eth1 corresponding line of "eth1" modified to "eth0" can be.


Programme II:

Directly delete the related network card configuration file, restart the system will regenerate the relevant profile (as root user login)

1.[root@localhost ~]# Rm-rf/etc/udev/rules.d/70-persistent-net.rules

2.[root@localhost ~]# Rm-rf/etc/sysconfig/network-scripts/ifcfg-eth0

Bo Main recommended the second: simple and convenient, restart will automatically generate the relevant network card configuration file

two. About Linux can not be online solutions


If you are still unable to access the Internet, proceed to the next step:






Related Article

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.