Re: How to tell if a network interface was renamed (and from what)
- In reply to: Mina_Galić : "Re: How to tell if a network interface was renamed (and from what)"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 19 Nov 2023 16:41:08 UTC
Hi Mina, Let's explain with a small example: In this scenario, we are going to add two alternate names for the "lo" interface. And then we can access to the interface using all of the names: lo, test1, test2 # ip link show lo 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 # ip link property add dev lo altname test1 # ip link property add dev lo altname test2 # ip link show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 altname test1 altname test2 2: enp4s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000 link/ether b0:7b:25:31:6c:92 brd ff:ff:ff:ff:ff:ff # ip link show lo 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 altname test1 altname test2 # ip link show test1 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 altname test1 altname test2 # ip link show test2 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 altname test1 altname test2 # ping -I test2 127.0.0.1 ping: Warning: source address might be selected on device other than: test2 PING 127.0.0.1 (127.0.0.1) from 127.0.0.1 test2: 56(84) bytes of data. 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.023 ms By the altname feature, the interface name doesn't change, but you can assign many altnames. So you can access them using these altnames. Mina Galić <freebsd@igalic.co>, 19 Kas 2023 Paz, 17:36 tarihinde şunu yazdı: > > > Hi Özkan, > > > It would be better if FreeBSD could have "interface altname feature" > > like Linux has. > > even tho I'm writing this email from a Linux laptop, and often > have to understand Linux specific code to see how I can (or if I > need to) replicate that on FreeBSD, I'm not familiar enough > with Linux. > > Can you describe the altname feature, and how it works? > > Kind regards, > > Mina