The NIC information displayed by ifconfig does not match the configuration file name. ifconfig does not match
For example, in my configuration file, cd/etc/sysconfig/network-scripts/ifcfg-Auto_eth0 is the name, but the information I display with ifconfig is
Eth6 Link encap: Ethernet HWaddr 08: 00: 27: 3F: 55: 54 inet addr: 192.168.137.103 Bcast: 192.168.137.255 Mask: 255.255.255.0 inet6 addr: fe80: a00: 27ff: fe3f: 5554/64 Scope: Link up broadcast running multicast mtu: 1500 Metric: 1 RX packets: 154 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 94 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 1000 RX bytes: 13339 (13.0 KiB) TX bytes: 13889 (13.5 KiB) |
Eth6 is obviously not the name of my configuration file, because many Linux distribution uses udev to dynamically manage the device file and name it persistently Based on the device information. Udev identifies the NIC during system boot, and records the mac address and nic name in the udev rule script. So how to restore it? We want to go to the path cd/etc/udev/rules. d/, and then view the file 70-persistent-net.rules. You will find that some of the previous Nic information is recorded in this file, but now you may no longer use it, if you want to restore ifconfig to display eth0, you only need to delete the file and restart the machine. Rm-r 70-persistent-net.rules and then, reboot-h now can be restored. You can also delete some information in the rm-r 70-persistent-net.rules file.