Eth0 in Linux and eth1 network card Exchange

Source: Internet
Author: User

This article explains: If you have installed multiple network card drivers, but you need to adjust the order of multiple network cards (such as eth0 and eth1 Exchange name Exchange).

Method One:

1, first view the driver name of the network adapter

#dmesg |grep ETH

The following words will appear:

Skge Eth0:link is up in Mbps, full duplex, flow control TX and RX

Atl2:eth1 NIC Link is up<100 Mbps full duplex>

From the two lines above, you can see that the drivers for the installation are Skge and ATL2.

or #cat/etc/modprobe.conf by looking at the file

The following words appear:

Alias Eth0 Skge

Alias Eth1 ATL2

You can also see the driver name.

After the query, you can check to see if it is correct by command, and note the case.

# lsmod |grep-e "Atl2|skge"

ATL2 37656 0

Skge 40017 0

2, directly delete the loaded driver.

#rmmod Skge

#rmmod ATL2

This article URL address: http://www.bianceng.cn/OS/Linux/201410/45511.htm

3, Reload Drive order (first load driver, Nic name is eth0, after loading drive, name is eth1, ...) )。

Switch to the driver installation path first. shown in the following format

# cd/lib/modules/2.6.18-164.el5xen/kernel/drivers/net

You can see the driver

#ls |grep-e "Atl2|skge"

Then select the load driver order.

#insmod Atl2/atl2.ko

#insmod Skge.ko

After you reconfigure the IP address, you can.

Method Two:

Directly modify the configuration file this is the fastest way

1, first stop network services

#/etc/init.d/network stop or #service network stop

2, switch to the configuration file directory

#cd/etc/sysconfig/network-scripts

3. Exchange ETHX Documents

Such as: There are two cards eth0 and eth1

#mv Ifcfg-eth0 Ifcfg-eth5

#mv ifcfg-eth1 Ifcfg-eth0

#mv Ifcfg-eth5 ifcfg-eth1

After you swap the file, you also need to edit the device=ethx in the Ifcfg-ethx file, such as: DEVICE in the Ifcfg-eth0 file eth0, ifcfg-eth1 the DEVICE file.

After the modification is complete, restart the network service.

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.