How to modify the NIC eth1 to eth0 under Linux

Source: Internet
Author: User

Normally, the first time that Linux recognizes a NIC is eth0, and the second one is eth1. Sometimes we use the virtual machine cloning technology after the network card information will change, the newly cloned virtual host network card name may become eth1. No matter how we modify it, this is a problem when we use N virtual machines for ha-heartbeat experiments.


In this case it is because the replication system in the process of copying files already have a network card in/etc/udev/rules.d/70-persistent-net.rules is recognized as eth0, and the virtual machine is recognized as eth1.


Workaround:


1. Edit/etc/udev/rules.d/70-persistent-net.rules, find the same line as Ifconfig-a's Mac (name= ' eth1 ' line) and change it to "Name=eth0", Then remove the above line (name= ' eth0 ').


Vim/etc/udev/rules.d/70-persistent-net.rules


subsystem== "NET", action== "Add", drivers== "? *", attr{address}== "00:0c:29:bb:41:2b", attr{type}== "1", kernel== "eth*" , name= "Eth0"


2. Edit the/etc/sysconfig/network-script/ifcfg-eth0, change the Mac to correct, and delete the UUID.


3. Edit the/etc/sysconf/network and change the hostname.


4. Reboot is in effect!

This article is from the "small White love life" blog, please be sure to keep this source http://sf1314.blog.51cto.com/13295031/1978475

How to modify the NIC eth1 to eth0 under Linux

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.