From nobody Tue Nov 21 18:55:10 2023 X-Original-To: freebsd-net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SZYTs37Txz526Cb for ; Tue, 21 Nov 2023 18:55:13 +0000 (UTC) (envelope-from mike@karels.net) Received: from mail2.karels.net (mail2.karels.net [3.19.118.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "freebsd", Issuer "freebsd" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SZYTs11RNz4rxk; Tue, 21 Nov 2023 18:55:13 +0000 (UTC) (envelope-from mike@karels.net) Authentication-Results: mx1.freebsd.org; none Received: from mail2.karels.net (localhost [IPv6:0:0:0:0:0:0:0:1]) by mail2.karels.net (8.17.1/8.17.1) with ESMTP id 3ALItBqt078640; Tue, 21 Nov 2023 12:55:11 -0600 (CST) (envelope-from mike@karels.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=karels.net; s=mail2; t=1700592911; bh=+OOhEzo0h82j2lwscD4tK0kA3la062QpR6ehd16cMOU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=S9Hgy7vouQAYwOAtKb+gqazL17+C53ecmpCBgvMRC/6BtJ/wX91VIG3z0l3YY9t3d I7QbUobijYi2G3wwFpjv1YSKFN/ajRRfUshglalYLVfx+/hqZUD3Y4R+ImwrWIik2Z 91caTmdLcJEEhBQpirlw6a8chngi8NEYj3cn+BI0kJFc6JOUQrlnefE7RiyyDnvPdK ClH6zdviCVsXRY+8i2XYnUcA7HgggRTa20pUuGaqIWrehGeFK/sM3Z3eJ76zxQAdfx 4WN+siTfFoN7qxaFPNbUhdssK22fcOWSCNMn1+7RQZ+zRcqtbPMFc0Q2Eo1K2CtpCt /4U7w4f0uGe2w== Received: from [10.0.2.130] ([73.62.165.147]) by mail2.karels.net with ESMTPSA id eGxXCA/9XGUuMwEAs/W3XQ (envelope-from ); Tue, 21 Nov 2023 12:55:11 -0600 From: Mike Karels To: =?utf-8?q?Mina_Gali=C4=87?= Cc: Franco Fichtner , Kristof Provost , freebsd-net@freebsd.org Subject: Re: How to tell if a network interface was renamed (and from what) Date: Tue, 21 Nov 2023 12:55:10 -0600 X-Mailer: MailMate (1.14r5964) Message-ID: <8CC43DBE-A4F5-4871-B454-7C61BBC916B0@karels.net> In-Reply-To: <4jgQsTSP-ojHZF4kFe2z7vD9qYYVO88M8KvpOXXw_t8JzQZwwzNDyO8cNeDoZ1435qQHTEY91IIzPfmBft3FJScfMrxaT-6GyI5P57qDIkg=@igalic.co> References: <032BADD4-0A49-42E2-BAAB-40D2F76C64B9@FreeBSD.org> <31B38FCE-0B67-4122-A202-568150E971E1@karels.net> <3081C679-F5AC-4610-BC6B-00ADA5DC17E7@opnsense.org> <4jgQsTSP-ojHZF4kFe2z7vD9qYYVO88M8KvpOXXw_t8JzQZwwzNDyO8cNeDoZ1435qQHTEY91IIzPfmBft3FJScfMrxaT-6GyI5P57qDIkg=@igalic.co> List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.16.0.0/14, country:US] X-Rspamd-Queue-Id: 4SZYTs11RNz4rxk 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 m= etric 0 mtu 1500 options=3D80028 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 ) status: active nd6 options=3D21 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