Re: How to tell if a network interface was renamed (and from what)

From: Mina_Galić <freebsd_at_igalic.co>
Date: Sun, 19 Nov 2023 14:34:23 UTC

> > FreeBSD currently does not preserve the old ( original ) name of
> > interfaces if it is renamed ( either physical or cloned ones ).
> > While there's an attempt https://reviews.freebsd.org/D28247
> > to get the device name (physical
> > ones) but it is not perfect and not completed.
> > 
> > So may I ask why you need to know if a network interface was renamed ?
> 
> 
> Just last week I found this quite a pain as well; once an interface has
> been renamed, if it's not a pseudo-interface with an obvious group
> there's no clear way, AFAICT, to determine which driver created it

I think the main reason that we need to know if and from what an interface has been renamed is if we need to know what driver we're working with.

But given that a rename doesn't change — or even just *alias*
the sysctl dev hierarchy, where a %driver is recorded, we can't
track it back.

(but again, that's just for physical devices, then again virtual devices record what type of device they are in their group which
is essentially the same thing)

As soon as we have more than one interface with different drivers
it's impossible to parse out what we're dealing with without
parsing rc.conf, logs, or worse things I can't think of right now.