Q: After backup in the recovery system, the NIC number becomes eth1 instead of eth0
A: Modify the Udev rules file, delete the 70-persistent-net.rules file under the/ETC/UDEV/RULE.D directory, and then restart
For some special applications, such as a USB stick Linux system, after deleting the file, you can create a folder with the same name in the directory mkdir 70-persistent-net.rules so that no Udev rule file will be generated after each boot.
Q: Set multiple IP addresses for a single NIC
A: You need to create a new two configuration file under/etc/sysconfig/network-scripts
ifcfg-eth0:0 content is as follows:
device=eth0:0
Bootproto=static
ipaddr=192.168.168.2
netmask=255.255.255.0
Onboot=yes
ifcfg-eth0:1 content is as follows:
Device=eth0:1
Bootproto=static
ipaddr=192.168.168.3
netmask=255.255.255.0
Onboot=yes
Q: Manually Change the network number
A: For some single-card motherboard, if due to the need to plug in a PCIe network card. Because Udev assigns the network number according to the PCIe root port, the onboard network card is assigned as eth0 and the external PCIe NIC is assigned to ETH1.
The onboard network card is eth1 if the external plug-in PCIe adapter is eth0 due to need to be specified. This can be done by writing a script to modify the network card number, and then adding the statement that executes the script in/etc/init.d/rc.local.
The script can be written as: (This example does a binding motherboard operation)
#!/bin/bash
#默认UUID
uuid1= "################################"
# Querying the motherboard UUID
Uuid2= ' (dmidecode-t 1|grep-i uuid|sed ' s/^.*://g ' |sed ' s/-//g ') '
If ["$uuid 1" = "$uuid 2"]; then
IP link set eth0 name eth2
IP link Set eth1 name eth0
IP link Set eth2 name eth1
Fi
# Make a network label replacement
Ifconfig eth0 192.168.1.102
Ifconfig eth1 192.168.10.100
A summary of network card problems under Linux