I did a new test of vrrp on two brand new RB2011, ROS 5.20
From the default settings I did these changes to the settings:
Master
Master:
/interface bridge port remove [find interface=ether5]
/interface bridge port remove [find interface=ether4]
/interface bridge port remove [find interface=ether3]
/interface ethernet set 4 master-port=ether5
/ip address add address=192.168.2.2/24 interface=ether5
/ip address add address=192.168.6.1/24 interface=ether3
/interface vrrp add name=vrrp1 interface=ether5 priority=200 vrid=9 on-backup="/ip address disable [find interface=ether3]" on-master="/ip address enable [find interface=ether3]"
/ip address add address=192.168.2.1/32 interface=vrrp1
Standby:
/interface bridge port remove [find interface=ether5]
/interface bridge port remove [find interface=ether4]
/interface bridge port remove [find interface=ether3]
/interface ethernet set 4 master-port=ether5
/ip address add address=192.168.2.3/24 interface=ether5
/ip address add address=192.168.6.1/24 interface=ether3
/interface vrrp add name=vrrp1 interface=ether5 priority=100 vrid=9 on-backup="/ip address disable [find interface=ether3]" on-master="/ip address enable [find interface=ether3]"
/ip address add address=192.168.2.1/32 interface=vrrp1
Now I connected them together with a cable in ether5 on both.
Then I connected a pc to ether4 on each of them and watched status in winbox.
Then I tried various ways to make them fail:
Power off the master - wait 30 sec and power it back on. Repeated 10 times - no failure
Power off the master - and imidiatly power it back on. Repeated 10 times - 1 failure for the slave to run on-master script
Unplug the cable between the routers - wait until winbox show status M on both and plug back in. - Repeated 20 times - no failure
Set priority=250 of vrrp on the slave to make them swap roles. I then repeated the tests above on the new master (the one that started out as slave) - no failures
Set priority=150 of vrrp on the slave to make them swap roles again.
Power off the master - wait 30 sec and power it back on. Repeated 10 times - no failure
Power off the master - and imidiatly power it back on. Repeated 10 times - no failure
Unplug the cable between the routers - wait until winbox show status M on both and plug back in. - slave fail to run on-master script EVERY TIME!
Set priority=250 of vrrp on the slave to make them swap roles again.
Results turned out to be the same as above - the new slave fail to run on-master when cable is unplugged
Set priority=251 of vrrp on the slave (the one that started out as master) to make them swap roles again.
Then I repeated the tests, and now they didn't fail at all.
So all I can conclude is that there is some unexpected behavior when it comes to running the on-master/on-backup scripts.
How can it be that I'm the only to experience this? As I've now experienced this on ROS 4.14, ROS 5.19 and ROS 5.20, so there should be plenty of others doing vrrp during this time. And I've only setup VRRP three times. That means I've experienced this on all my setups!
There must be something I'm doing wrong with the vrrp setup?