I have a Ubuntu 18.04 vm running in Azure. I have added a secondary public ip to this vm, because I need to serve a webservice from a specific ip with different ssl certificates.
10.0.3.4 with public ip ... is configured primary in Azure portal.
10.0.3.5 with public ip ... is configured secondary in Azure portal.
If I login to the server and i do ip addr show eth0
. I see the following
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:0d:3a:ac:e5:aa brd ff:ff:ff:ff:ff:ff
inet 10.0.3.5/24 brd 10.0.3.255 scope global eth0
valid_lft forever preferred_lft forever
inet 10.0.3.4/24 brd 10.0.3.255 scope global secondary eth0
valid_lft forever preferred_lft forever
The weird part is that 10.0.3.4 is configured as secondary while in Azure portal it's configured as primary.
I need 10.0.3.4 to be configured in Ubuntu as primary, because docker uses the primary ip for outgoing traffic.
My /etc/netplan/50-cloud-init.yaml looks like:
network:
ethernets:
eth0:
addresses:
- 10.0.3.5/24
dhcp4: true
dhcp4-overrides:
route-metric: 100
dhcp6: false
match:
driver: hv_netvsc
macaddress: 00:0d:3a:ac:e5:aa
set-name: eth0
version: 2
I already tried to add 10.0.3.4 to the addresses option, but this also doesn't seem to work. Does anyone know how to accomplish this?