top | item 2254604

Eth0 no more?

154 points| PassTheAmmo | 15 years ago |lists.us.dell.com | reply

50 comments

order
[+] _b8r0|15 years ago|reply
I can understand why people will resist this, thinking that somehow renaming eth0 to em0 or similar will break stuff, but here's the rub: It'll only break stuff that's badly written.

There's a right way to enumerate network interfaces and a wrong way (which is dependent on the language you're using for enumeration - the wrong way is assuming that eth0 is the only network device).

Bear in mind that the new convention is not entirely dissimilar to how WiFi cards have worked on Linux for some time, so the only things that will break will be things that:

    a) Assume eth0 instead of enumerating devices
    b) Have a legitimate reason for using eth0 only (I can't think of one, but I wouldn't be surprised if one existed)
[+] nl|15 years ago|reply
Documentation that references eth0 isn't badly written.
[+] zdw|15 years ago|reply
Mac OS X and Linux are the only OS's that I'm aware of that put all ethernet nics in the same device namespace.

Everyone else has separate device namespaces for - you might have an fxp0 , rl0, hme0, etc. on any BSD or Solaris machine.

Rather than looking in /dev, they really ought to be parsing the output of ifconfig -a.

[+] nailer|15 years ago|reply
1. Linux gives unique names to each NIC. There are no namespace conflicts, because each NIC alias is unique within devices. I personally do not care about the chipset manufacturer and driver when working on a routing issue.

2. You mean (IIRC) 'ip link show'. ifconfig on linux isn't maintained, and breaks in a bunch of situations (Aliases on VLANs on bonds, for one)

3. And you should of course use python-procfs or your preferred equiv, not parse the output of other tools.

On the article in general: can't you use /dev/by-manufacturer these days or similar? I haven't been working on OS stuff recently so can't remember if that became standard.

[+] CrLf|15 years ago|reply
Having all ethernet devices called "ethX" makes it much easier to parse the output of ifconfig and exclude any non-ethernet interfaces (tunnels and such).
[+] andrewf|15 years ago|reply
My primary network interface has just become "en0" again, after being "en1" for about 8 years (the time between my first iBook with 802.11b, and getting a MacBook Air which doesn't have an ethernet port).
[+] javanix|15 years ago|reply
From the limitations section of the wiki page linked in the article:

Not all add-in cards have a method to expose their Linux interface name(s) to external port mapping. biosdevname may provide incorrect names for such. Discussions are ongoing on the netdev mailing list to standardize a method of exposing such mapping.

Seems like this would be kind of a deal-breaker for any wholesale move like this. I'd be fairly surprised if this got any widespread adoption anytime soon.

[+] eklitzke|15 years ago|reply
There was a pretty good discussion about this on LWN a while back, I recommend it to anyone who wants more information (both the commentary their, as well as the linked article): https://lwn.net/Articles/424859/
[+] 16s|15 years ago|reply
The BSDs have always done this... if I recall correctly, em is an Intel based NIC.

NAME em - Intel PRO/1000 10/100/Gigabit Ethernet device

http://www.openbsd.org/cgi-bin/man.cgi?query=em&apropos=...

Edit: Reading more of that thread I may be off-base here, but naming a network interface em that's not powered by certain Intel chipsets will be very confusing to BSD users. Just my 2 cents.

[+] spydum|15 years ago|reply
People will whine and complain about this, but it's about time some sanity was brought to Linux's network device names. The eth* enumeration has been terrible for quite a long time, especially when dealing with servers housing multiple interfaces. And if you don't like the solution, they explicitly say you can just set biosdevname=0 on the kernel params and carry on with the previous insanity.
[+] beoba|15 years ago|reply
Looks like this could solve the problem of network interfaces renaming themselves after reboots. Hooray!
[+] CrLf|15 years ago|reply
Network interfaces should not rename themselves after reboots. On Red Hat derived distributions, the device name is tied to the MAC address of the interface, so it never changes.

On other distributions, "udev" accomplishes the same thing.

The only point when interface naming is arbitrary is at installation time, then it stays the same forever.

Not only this will add confusion by introducing a bunch of new names for network interfaces, it will also break applications that rely on them being called "ethX".

It will also make it impossible to manually assign names to interfaces. For instance, if you have a configuration that uses an embedded interface and you want to add another interface on a card, you can manually assign the same "ethX" name to it, but not if the names depend on the physical characteristics of the hardware.

[+] e1ven|15 years ago|reply
There are a lot of other solutions to that. The Ububuntu one I favored in the 8.x era was /etc/iftab, it's a shame they retired it in favor of udev.

While udev is more universal, iftab felt elegant and unixy.

[+] samuel1604|15 years ago|reply
From a quick look on a fresh ubuntu small server install it does not seem there is much that reference eth* scheme :

  ~$ sudo egrep -Irl 'eth[0-9]' /etc /usr 2>/dev/null |wc -l
  27
[+] dhughes|15 years ago|reply
With eth changing to em and mile long IPv6 addresses it's going to be a strange world.
[+] d135-1r43|15 years ago|reply
I assume any consumer OS will generate a symlink for compatibility reasons.
[+] sciurus|15 years ago|reply
Network interfaces aren't files, so you can't create symlinks to them. I don't think linux has a facility for referring to a network interface by more than one name.

My hope is that consumer distributions will stop presenting the device name and configuration at all. When I'm trying to show new Ubuntu users how to connect to wired and wireless networks, it's annoying to have to explain what NetworkManager means by "Auto eth0".

https://bugs.launchpad.net/ubuntu/+source/network-manager/+b...

[+] pnathan|15 years ago|reply
I certainly hope so. There's just way too honking much literature out there oriented on ethX to simply make ethX go away.
[+] BlazingFrog|15 years ago|reply
"... something else that know one will recognise ..."

Really??