This may occur when you use a linux system. when you install a NIC driver or a program related to the NIC. The network card may experience so-called drift. (Note: it is not elegant ). The possible appearance is: (1): the network card order is reversed, for example, the network connecting your network cable... this may occur when you use a linux system. when you install a NIC driver or a program related to the NIC.
The network card may experience so-called drift. (Note: it is not elegant ). The possible appearance is:
(1): The Nic sequence is reversed. for example, if your network port is eth0 and the driver of a Nic is installed, its name may change to eth0 or eth3.
(2): The nic name is changed. this is not a change from eth0 to eth1, but a very strange change. for example, eth0 cannot be found, the name of an Eni is _ tmp3183941582193 __
This is really annoying. Someone may obtain information through ifconfig | grep eth to complete some development work. if the nic name becomes invalid, the program will definitely fail.
(3): optical network card and electrical network card are in disorder or crosstab.
In short, our goal is to specify the name of a network card as the physical device we want. The procedure is as follows:
Step 1: Identify who is.
To use the network card, you must first know which physical device corresponds to the name. the practice is to pull a network cable from the switch and connect it from top to bottom to the network card, note that only one network adapter can be connected at a time. then, run the ethtool command to check whether the network adapter is connected. for example
[Root @ AS5 ~] # Ethtool eth0
Settings for eth0:
Supported ports: [MII]
Supported link modes: 10 baseT/Half 10 baseT/Full
100 baseT/Half 100 baseT/Full
1000 baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10 baseT/Half 10 baseT/Full
100 baseT/Half 100 baseT/Full
1000 baseT/Full
Advertised auto-negotiation: Yes
Speed: 100 Mb/s
Duplex: Full
Port: MII
PHYAD: 2
Transceiver: external
Auto-negotiation: on
Supports Wake-on: g
Wake-on: d
Link detected: yes
The eth0 status is connected to the network cable. If Linked detected: no, the network cable is not connected.
Mark the name of the device that is separated in this way.
Step 2: obtain the MAC address of each Nic
Ifconfig-a can view all network devices.
Use ifconfig-a | grep HWaddr to obtain the MAC address of each device.
After binding all NICs, the reboot system should be ready.
Note the following:
/Etc/modprobe. conf
To modify the file, make sure that a device uses the corresponding driver, for example:
Cat/etc/modprobe. conf
Alias eth0 forcedeth
Alias eth1 forcedeth
Alias scsi_hostadapter aic79xx
Alias scsi_hostadapter1 sata_nv
Alias scsi_hostadapter2 usb-storage
Alias eth2 e1000
Alias eth3 e1000
The forcedeth driver is used for eth0 and eth1, and eth2 and eth3 are driven by e1000.
Solution:
Cd/etc/udev/rules. d
Find 60-net.rules and back up the file.
Mv 60-net.rules 60-net.rules.bak
Create a file named 60-net.rules with the following content:
[Root @ localhost rules. d] # cat 60-net.rules
SUBSYSTEM = "net", ACTION = "add", SYSFS {address} = "mac address of your Nic 1 ",
IMPORT = "/lib/udev/rename_device % k eth0"
SUBSYSTEM = "net", ACTION = "add", SYSFS {address} = "mac address of your Nic 2 ",
IMPORT = "/lib/udev/rename_device % k eth1"
Note that you need to change the mac address of your network card.
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