[systemd-devel] [EXT] Finding network interface name in different distro
Brian Reichert
reichert at numachi.com
Tue Oct 18 17:39:01 UTC 2022
> > <CAOdf3goQ5+TNf7mTKCix_59AboWeoQWzpGfuWasJhtpr+ZmOwg at mail.gmail.com>:
> > > 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.
This doesn't answer the OP's question, but my trick for enumerating
network devices was to use something like:
egrep -v -e "lo:" /proc/net/dev | grep ':' | cut -d: -f
to get a list of non-loopback interfaces.
In my case, I went on to bury everything under a single bond0
interface, so a) no software had to guess a NIC name, and b) in the
case of physical cabling, they would all Just Work.
This was work done in my kickstart file, and worked through many
releases of Red Hat and CentOS.
I adopted this tactic as Dell kept switching up how they would
probe/name devices...
--
Brian Reichert <reichert at numachi.com>
BSD admin/developer at large
More information about the systemd-devel
mailing list