Hi,
I've configured rednundant (VRRP) router based on two 16.04.1 Ubuntu. Everything except one thing is working as expected.
I have a few additional external IP addresses defined in /etc/network/interfaces:
Code:
auto eth0
iface eth0 inet static
address x.x.x.53
netmask 255.255.255.224
network x.x.x.32
broadcast x.x.x.63
gateway x.x.x.33
dns-nameservers 127.0.0.1 10.171.3.56 10.172.3.247
dns-search domain.com
up ip addr add x.x.x.34 dev $IFACE
down ip addr del x.x.x.34 dev $IFACE
up ip addr add x.x.x.39 dev $IFACE
down ip addr del x.x.x.39 dev $IFACE
up ip addr add x.x.x.40 dev $IFACE
down ip addr del x.x.x.40 dev $IFACE
up ip addr add x.x.x.48 dev $IFACE
down ip addr del x.x.x.48 dev $IFACE
up ip addr add x.x.x.50 dev $IFACE
down ip addr del x.x.x.50 dev $IFACE
For obvious reason additional external addresses are the same for both routers, and are starting on boot. I've made a script running every 5 seconds on both routers to check if router is active, and in case if it is not then bring additional addresses down. This is working fine, but for some time after additional addresses on non-active router were up, I can't use these IP's on active router.
My idea is to remove that list from /etc/network/interfaces file and put them to the /etc/rc.local:
i.e. ip a a x.x.x.x/32 dev eth0 with delay of about 20 seconds.
But I am not sure when exactly rc.local script is running. Is it at the end of booting process or in the middle? Any idea how to sort it out?