The following Netplan config results in only one of those IPs becoming primary (the other one becomes secondary):
vlans:
vlan10:
addresses:
- 1.1.1.1/24
- 1.1.1.2/24
dhcp4: false
dhcp6: false
id: 10
link: eth1
How do I have 2 primary IPs in that subnet/VLAN? (obviously not on a single interface, which is impossible) E.g. with pre-Netplan networking config I was able to create what looked like 2 subinterfaces on the same VLAN, each with its own (primary) IP in the same subnet showing up in ifconfig output:
eth1 Link encap:Ethernet HWaddr 00:0C:29:DB:27:4F
inet6 addr: fe80::20c:29ff:fedb:274f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth1.10 Link encap:Ethernet HWaddr 00:0C:29:DB:27:4F
inet addr:50.0.10.254 Bcast:50.0.10.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fedb:274f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth1.10:0 Link encap:Ethernet HWaddr 00:0C:29:DB:27:4F
inet addr:50.0.10.253 Bcast:50.0.10.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
But a similar config with Netplan adds only one of those subinterfaces/IPs, ignoring/rejecting the other for some reason. Defining those 2 IPs as VRRP VIPs could be done but perhaps there's a more natural way?
Thanks in advance!
Update: looks like virtual interface like eth1.10:0 above is a feature supported through labels starting with Netplan v0.100 / Ubuntu 20.04 (mine's v0.99 with Ubuntu 18 and I'm not allowed to upgrade it to give it a try): https://bugs.launchpad.net/ubuntu/+source/nplan/+bug/1743200
That partially answers my question, so other ideas on how to have 2 primary IPs in a subnet/VLAN on a single server are welcome.