Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Nov 2023 22:23:31 +0100
From:      Franco Fichtner <franco@opnsense.org>
To:        Kristof Provost <kp@FreeBSD.org>
Cc:        Mike Karels <mike@karels.net>, =?utf-8?Q?Mina_Gali=C4=87?= <freebsd@igalic.co>, Zhenlei Huang <zlei@FreeBSD.org>, Kyle Evans <kevans@FreeBSD.org>, freebsd-net@freebsd.org
Subject:   Re: How to tell if a network interface was renamed (and from what)
Message-ID:  <12724698-9B26-4CC2-BDBE-8142675BA4A7@opnsense.org>
In-Reply-To: <B514CB40-036E-442F-98E9-EFCF74EC8BCE@opnsense.org>
References:  <pdHC0ObBkAbx2HfFIhWYaB5-dmQDEUzNTWvVVJAuJV7FWdWWeSwybVFD-uyBUxPlqDRpAW7D1aAZsbrTxEj9kqsq7ESgO41srPmS-PcXGqw=@igalic.co> <E5F5F61E-3827-404A-A46F-BBCF45A29A82@FreeBSD.org> <9eef5488-e8da-4edd-bc00-baeb5aaf4a23@FreeBSD.org> <ptnVEMJ_x48tdYePN4iYRiEW2vWqwulbEOUJ4dQ1cKGkxNXZPPfdEVHdJKNHFfs2onxNipVZKPwDZZKlDv1peS1Xttim1VitMFsdUiTkAKE=@igalic.co> <032BADD4-0A49-42E2-BAAB-40D2F76C64B9@FreeBSD.org> <rvRLOlpJc9xIf67ZwmZ4Si6TN2VtmIuyuguoQgEk5NTOeqsqkAwB_9KvlMbW6y-npSjCC2lmLVXbD4oIqyKJdDboThcWiehF_hU0L9D6GZc=@igalic.co> <31B38FCE-0B67-4122-A202-568150E971E1@karels.net> <F2536F44-5C61-4AE3-BEDA-705DD660A8F7@FreeBSD.org> <B514CB40-036E-442F-98E9-EFCF74EC8BCE@opnsense.org>

next in thread | previous in thread | raw e-mail | index | archive | help
FWIW, here is the relevant ifinfo output of a sample machine:

# ifinfo | grep ^Interface
Interface igb0 (igb0):
Interface igb1 (igb1):
Interface igb2 (igb2):
Interface igb3 (igb3):
Interface enc0 (enc0):
Interface lo0 (lo0):
Interface pflog0 (pflog0):
Interface pfsync0 (pfsync0):
Interface lagg0 (lagg0):
Interface igb2_vlan42 (vlan0):
Interface vlan0.1.23 (vlan1):
Interface vlan0.3 (vlan2):
Interface vlan0.5.6.7 (vlan3):
Interface vlan01. (vlan4):
Interface vlan06 (vlan5):
Interface vlan08 (vlan6):
Interface qinq0.123 (vlan7):
Interface gre2 (gre2):
Interface gre0 (gre0):
Interface gif4 (gif4):
Interface gif1 (gif1):
Interface gif0 (gif0):
Interface l2tp0 (ng0):
Interface bridge0 (bridge0):
Interface lo1 (lo1):
Interface lo2 (lo2):
Interface ovpns2 (tap2):
Interface ovpnc1 (tun1):
Interface ovpnc3 (tun3):
Interface ovpns4 (tun4):
Interface wg0 (wg0):
Interface wg1 (wg1):

> On 20. Nov 2023, at 22:16, Franco Fichtner <franco@opnsense.org> =
wrote:
>=20
>=20
>> On 20. Nov 2023, at 21:56, Kristof Provost <kp@FreeBSD.org> wrote:
>>=20
>> I=E2=80=99d look in the direction of just adding a field to struct =
ifnet with the original interface name (likely easily done in =
if_attach()), along with a new ioctl to retrieve that field.
>=20
> ifconfig_get_orig_name() already exists, but apart from wlandebug
> nothing is using it.
>=20
> The internally used IFDATA_DRIVERNAME also appears in ifinfo
> (not installed in base) and bsnmpd but that's it.
>=20
> if_dname is the target and it exists in ifnet struct along with
> a man page entry in inet(9).
>=20
> All that is really missing is a way to print it via ifconfig command.
>=20
>=20
> Cheers,
> Franco




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?12724698-9B26-4CC2-BDBE-8142675BA4A7>