Re: Finding network interface name in different distro

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

 



Le ven. 14 oct. 2022 à 20:41, Etienne Champetier
<champetier.etienne@xxxxxxxxx> a écrit :
>
> 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 think I found what I need:
bash-4.4# udevadm test /sys/class/net/em1 2>/dev/null | awk  -F=
'/ID_NET_NAME=/ {print $2}'
eno1




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

  Powered by Linux