Rules for generating Linux network card names

Source: Internet
Author: User

Eth0, eth1 How did these names come from?

The kernel discovers a PCI network card device and calls the probe function of the NIC driver.

After a certain initialization is done, the probe function invokes the kernel interface Register_netdev registers a new Net_device device with the kernel.


The name of this device, the NIC driver, often determines only a subset of them.
As in this way, the NIC driver provides a name like "eth%d" and then calls the kernel interface Register_netdev.
strcpy (Netdev->name, "eth%d");
Register_netdev (Netdev);


Register_netdev process, according to the existing interface situation in the system, find a minimum number that has not been used, and give the new registered network card.
For example, the system currently has, Eth0, Eth2, eth3 three network card.
Then the newly registered network card, the name is eth1.


Of course, the NIC driver can also provide a full name, but must ensure that the name does not conflict with the existing network card.
This is not possible in the drive. And, a driver, may drive a lot of block network card, how to name, is a problem.


Finally, the user-state program, can be called through the IOCTL system, to modify the name of the network card.

Rules for generating Linux network card names

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.