Multiple IPv4 addresses per NIC (w/o aliases, VLANs, etc.)
Ken D'Ambrosio
ken at jots.org
Mon Sep 17 16:08:14 EDT 2018
So, I didn't know this was "a thing." And, apparently, "ifconfig"
doesn't know it, either. However, with "ip addr add", you can assign
multiple IPv4 addresses to a given interface:
methusalah # ifconfig tun0
tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 192.168.23.50 netmask 255.255.255.255 destination
192.168.23.49
inet6 fe80::6d4d:9731:4512:1f75 prefixlen 64 scopeid
0x20<link>
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
txqueuelen 100
(UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9 bytes 432 (432.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
methuselah FAQ # ip addr add 10.20.30.40/32 dev tun0
methuselah FAQ # ip addr show tun0
4: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc
fq_codel
state UNKNOWN group default qlen 100
link/none
inet 192.168.23.50 peer 192.168.23.49/32 scope global tun0
valid_lft forever preferred_lft forever
inet 10.20.30.40/32 scope global tun0
valid_lft forever preferred_lft forever
And yet ifconfig doesn't even show the new info. Note that this is
dinstinct from "tun.0" or "tun:0" (VLAN and alias, respectively).
Is the ability to have multiple v4 addresses against a given NIC a new
feature? Is it somehow bogus? Maybe it's an extension of the way that
v6 works, since v6 has always allowed multiple addresses/NIC -- perhaps
aliases are deprecated?
Just wondering if anyone else has noticed this...
-Ken
More information about the gnhlug-discuss
mailing list