The NIC information displayed by ifconfig does not match the configuration file name. ifconfig does not match

Source: Internet
Author: User

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.

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.