Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Nov 2023 12:55:10 -0600
From:      Mike Karels <mike@karels.net>
To:        =?utf-8?q?Mina_Gali=C4=87?= <freebsd@igalic.co>
Cc:        Franco Fichtner <franco@opnsense.org>, Kristof Provost <kp@FreeBSD.org>, freebsd-net@freebsd.org
Subject:   Re: How to tell if a network interface was renamed (and from what)
Message-ID:  <8CC43DBE-A4F5-4871-B454-7C61BBC916B0@karels.net>
In-Reply-To: <4jgQsTSP-ojHZF4kFe2z7vD9qYYVO88M8KvpOXXw_t8JzQZwwzNDyO8cNeDoZ1435qQHTEY91IIzPfmBft3FJScfMrxaT-6GyI5P57qDIkg=@igalic.co>
References:  <pdHC0ObBkAbx2HfFIhWYaB5-dmQDEUzNTWvVVJAuJV7FWdWWeSwybVFD-uyBUxPlqDRpAW7D1aAZsbrTxEj9kqsq7ESgO41srPmS-PcXGqw=@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> <BA3A28C2-5F39-48D8-B0FF-520DE2F441F7@karels.net> <3081C679-F5AC-4610-BC6B-00ADA5DC17E7@opnsense.org> <C76B1C71-EE24-4B30-A7B6-50602F98C9E5@karels.net> <4jgQsTSP-ojHZF4kFe2z7vD9qYYVO88M8KvpOXXw_t8JzQZwwzNDyO8cNeDoZ1435qQHTEY91IIzPfmBft3FJScfMrxaT-6GyI5P57qDIkg=@igalic.co>

next in thread | previous in thread | raw e-mail | index | archive | help
On 21 Nov 2023, at 12:16, Mina Gali=C4=87 wrote:

> Hi Mike,
>
>> Mina, do you care about epair, or is the behavior I described sufficie=
nt
>> for your purposes?
>
> I do deeply care about epair, but for me, ifinfo does the
> right thing for me:
>
> root@irc:~ # ifinfo | grep Interface
> Interface vnet0 (epair30):
> Interface lo0 (lo0):

That's not the whole story for epair.  For example, I get this:

Interface bhyve (vtnet0):
Interface lo0 (lo0):
Interface lo1 (lo1):
Interface foo0a (epair0):
Interface foo0b (epair0):

But if you only need the driver name, it will do.

A problem with ifinfo is that it is not normally installed.
I think it is worth adding a similar feature for the driver name
to ifconfig.

> for one. For the other. For the main purpose, figuring out
> in cloud-init what the driver of an interface is / if the
> interface has been renamed, this is more than sufficient.

Currently I have this for ifconfig -D:

bhyve: flags=3D1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> m=
etric 0 mtu 1500
        options=3D80028<VLAN_MTU,JUMBO_MTU,LINKSTATE>
        ether 58:9c:fc:0b:0c:10
        inet 10.0.3.1 netmask 0xffffff00 broadcast 10.0.3.255
        inet6 fe80::5a9c:fcff:fe0b:c10%bhyve prefixlen 64 scopeid 0x1
        inet6 2001:470:c202:3::1 prefixlen 64
        media: Ethernet autoselect (10Gbase-T <full-duplex>)
        status: active
        nd6 options=3D21<PERFORMNUD,AUTO_LINKLOCAL>
        drivername: vtnet0

It's a little more work to parse, but I decided that it was useful
for humans, and works with -a.

		Mike
>
> Thank you very much,
>
> Mina



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8CC43DBE-A4F5-4871-B454-7C61BBC916B0>