
© cbpix, 123RF.com
Discovering device names
Find Nemo!
Recently, a customer asked me what was going on with his system. All of a sudden, he no longer had an eth0
; instead, he was seeing strange names like em1
or p3p1
at the console. He wanted to know exactly what was happening.
The explanation is fairly simple. The rule-based udev subsystem is responsible for naming. If all criteria for a rule match a network device found at boot time, the device is typically given the defined name, such as eth<X>
. Here's an example:
# grep eth0 /etc/udev/rules.d/70-persistent-net.rules SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="f0:de:f1:d5:c1:25", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
The rule says that a network device with the stated MAC address should be given a device name of eth0
and thus be the first device visible on the system. The name in the file is arbitrary. If you like, you can call the card public
or private
. This principle works to a certain extent. The downside is that you don't know which card exactly this is on the system. The only thing that is clear is that it is the card with the stated MAC address; whether this is also the first network device on the system remains unclear. For system administrators, this situation has always been a big worry. If you've ever stood in front of a server with a dozen network ports looking for eth0
, you will know exactly what I mean.
Danger of Confusion
The situation is aggravated in network installations where the TFTP boot request is sent on eth0
, but the installer later sends the DHCPDISCOVER
message via a different network card identified as eth0
. This situation is really fun to troubleshoot.
I would like the name I see on the system to be
...Buy ADMIN Magazine
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Most Popular
Support Our Work
ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.
