Web lists-archives.com

Re: New network interface naming scheme [was Re: P.S. Re: Debian 9 in a VM with Proxmox 5 system]




 ❦ 10 juillet 2017 18:37 +0200, Adam Borowski <kilobyte@xxxxxxxxxx> :

>> > The cost of a state file (/etc/udev/rules.d/70-persistent-net.rules) is
>> > extremely small, even in the very worst case where a user continually
>> > plugs in many, many different usb network dongles, which is a very
>> > unrealistic case to begin with.
>> 
>> The state file solution was not perfect either. If you have two brands
>> of NIC (Intel 10G additional NIC and Broadcom 1G integrated NIC for
>> example), it was not uncommon to be left with an interface eth0_rename
>> after boot because the target name was used by the other driver.
>
> Because of a race with the kernel creating eth1 while you're trying to
> rename eth0->eth0_rename->eth1, right?  That's trivially solvable by
> inventing a new scheme, such as e0 e1 (I'm sure someone can sound a scheme
> that sounds better than this).

Yes, that would work. There are still some issues, like random numbering
during the first boot. Note that udev is mostly following this scheme
with "eno1", "eno2", ...

> On the other hand, I use kernel-assigned names on all my machines that don't
> have multiple interfaces, thus I don't know how stable
> 70-persistent-net.rules is on the MAC-less machines.  I guess you guys know
> more.  But even if you take those new "persistent" names as a base for the
> state file, we wouldn't gain stability over kernel upgrades but the names
> would be actually predictable for the user (ie, the admin would know the
> only interface will be "e0").

For a physical machine, the only interface is usually eno1. For a
virtual machine, the numbering may be absent and this case, the
interface name is ensX with X which depends on your provider. Maybe an
exception could have been done for virtio, but there are edge cases they
may be difficult to catch (someone changing virtio to e1000 for example).

This can be checked with:

  udevadm info -p /sys/class/net/eno1 | grep ID_NET_NAME

The default order is onboard, slot, path. Debian has a local
modification to use the MAC address for USB devices.

See also:
 https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/#comeagainwhatgooddoesthisdo
-- 
Don't patch bad code - rewrite it.
            - The Elements of Programming Style (Kernighan & Plauger)

Attachment: signature.asc
Description: PGP signature