[ale] eth numbering change

Steve Litt slitt at troubleshooters.com
Sun Feb 12 12:23:21 EST 2017


On Thu, 9 Feb 2017 15:42:18 -0500
Phil Turmel <philip at turmel.org> wrote:

> On 02/09/2017 12:34 PM, DJ-Pfulio wrote:
> > On 02/09/2017 12:15 PM, Phil Turmel wrote:  
> >> Don't use ethX names with modern kernels.  Period.  
> > 
> > Why?  I force the new-name (which is a hassle) into the name I
> > want ... eth[0-9].  
> 
> Because the renaming is also asynchronous, and you can have the name
> you want be temporarily occupied by a device that just showed up, and
> then the renaming fails.
> 
> It's only safe if you only have one network device.

^^^ s/one network/one wired network/

And most computers have zero or one wired networks.

I think "don't use ethX names with modern kernels" is a little
absolute. The new regime can be a real pain in the ass, as you have to
remember device names that could be as much as 10 characters, if you
have a dongle plugged into a USB hub plugged into a USB port. The new
regime can be very inconvenient.

I also don't like the new regime because it comes from Freedesktop.Org,
but, well, that's a personal thing.

Fortunately, a little shellscripting garners you parallel boot
deterministic names AND name simplicity and predictability, because at
least the Freedesktop folks saw fit to start wired nics with "e" and
wireless nics with "wl". So what you can do is, after everything's
started up, have a shellscript do "ip link" and "ip addr" commands to
find all the crazynames of the various NICs. Then, their functions can
be determined by ping commands: For instance, the Internet facing NIC
could ping 8.8.8.8 but not 192.168.100.2, while the LAN facing NIC
would have the opposite results. Finally, either ln commands could be
used to make dje_lan, dje_internet, and djw_lan: Predictable both on
the bus and by functionality.

I know, I know, some new NIC could come online any second, so you'd
need to use inotifywait to rerun this shellscript every time a NIC gets
added, removed or changed. The point is, if one is sufficiently
motivated, one can write a shellscript to always give predictable and
reasonable device names, even if a user removes a wifi dongle and puts
it in a different USB port.

SteveT



More information about the Ale mailing list