<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 14, 2022 at 7:42 PM Etienne Champetier <<a href="mailto:champetier.etienne@gmail.com">champetier.etienne@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi All,<br>
<br>
When changing distro or distro major versions, network interfaces'<br>
names sometimes change.<br>
For example on some Dell server running CentOS 7 the interface is<br>
named em1 and running Alma 8 it's eno1.<br>
<br>
I'm looking for a way to find the new interface name in advance<br>
without booting the new OS.<br>
One way I found is to unpack the initramfs, mount bind /sys, chroot,<br>
and then run<br>
udevadm test-builtin net_id /sys/class/net/INTF<br>
Problem is that it doesn't give me right away the name according to<br>
the NamePolicy in 99-default.link<br>
<br>
Is there a command to get the future name right away ?<br></blockquote><div><br></div><div><div style="font-family:monospace,monospace" class="gmail_default">I do not like the biosdevname introduced stuff for machines with 4 or less interfaces, so another option is to disable the auto-naming:</div><div style="font-family:monospace,monospace" class="gmail_default"><br></div><div style="font-family:monospace,monospace" class="gmail_default">biosdevname=0 net.ifnames=0</div><div style="font-family:monospace,monospace" class="gmail_default"><br></div><div style="font-family:monospace,monospace" class="gmail_default">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<br></div><div style="font-family:monospace,monospace" class="gmail_default"><br></div><div style="font-family:monospace,monospace" class="gmail_default"></div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Thanks<br>
Etienne<br>
</blockquote></div></div>