Re: Finding network interface name in different distro

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

 



On Di, 18.10.22 09:10, Greg Oliver (oliver.greg@xxxxxxxxx) wrote:

> On Fri, Oct 14, 2022 at 7:42 PM Etienne Champetier <
> champetier.etienne@xxxxxxxxx> wrote:
>
> > Hi All,
> >
> > When changing distro or distro major versions, network interfaces'
> > names sometimes change.
> > For example on some Dell server running CentOS 7 the interface is
> > named em1 and running Alma 8 it's eno1.
> >
> > I'm looking for a way to find the new interface name in advance
> > without booting the new OS.
> > One way I found is to unpack the initramfs, mount bind /sys, chroot,
> > and then run
> > udevadm test-builtin net_id /sys/class/net/INTF
> > Problem is that it doesn't give me right away the name according to
> > the NamePolicy in 99-default.link
> >
> > Is there a command to get the future name right away ?
> >
>
> I do not like the biosdevname introduced stuff for machines with 4 or less
> interfaces, so another option is to disable the auto-naming:
>
> biosdevname=0 net.ifnames=0

biosdevname is pretty much obsoleted by systemd's own network naming.

Usually, if you have more than a single interface you want the
systemd naming though because otherwise probing order is usually
undefined and thus your "eth0" might sometimes be "eth1" and vice
versa...

> on the kernel cmdline will do it.  Also, the biosdevname package needs to
> be installed.  This will yield the traditional ethX, wlanX, etc interface
> names that are ordered by default the way they used to be.  Of course, this
> does not scale well when you have hotplug devices with many pci ports and
> ethernet cards if you ever need to replace one card.  Just my $.02

Uninstall biosdevname. It's 2022.

It's a bit contradictory to install it explicitly and then turn it off
via biosdevname=0...

Lennart

--
Lennart Poettering, Berlin



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux