[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Predictable Network Interface Names



On Wed, Mar 30, 2022 at 05:35:12PM +0200, basti wrote:
> as I can read here [1] network names should be stable.
> (Stable interface names even when hardware is added or removed)

> [1] https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/

Sorry, but you've been lied to.

> What I see now is:
> 
> When I add or remove a PCIe card (USB card) the name is changed from enp5s3
> to enp6s3 and back for example.

Yes.  You've now seen direct evidence of the lie.  I guess I won't need
to post links to the wiki articles that say the same thing you've already
observed.

For most people, there are two paths forward:

1) If your system has exactly one ethernet interface, and if this is not
   likely to change at any point in the future, you can go back to the
   old old way of doing things -- let the kernel assign "eth0" to the
   first interface it finds, "eth1" to the second interface it finds,
   and so on.  Since it will only ever find one interface, that interface
   will always be named "eth0", and you can configure from there.

2) If you have multiple ethernet interfaces, or the possibility of this
   occurring in the future, take control of their names yourself.  Set
   up systemd.link(5) files to assign a name to each interface based on
   its MAC address, or some other identifying characteristic.


Reply to: