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