Hi.
I have two Mikrotiks. First - main, secondary - reserve.
I use vrrp and have 3 vrrp interfaces:
-vrrp_lan
-vrrp-wan
-vrrp-vlan91
I want creat sync group, but ros not support it.
So, I finde here small script end modified it.
Mikrotik-1 have priority 200, Mikrotik-2 have priority-100.
On Mikrotik-2 f have two scripts.
If any vrrp interface is down:
:log info "ManualToMaster script run";
:local j
:foreach j in=[/interface vrrp find] do={
:put ("checking VRRP master " . $j);
:if ([interface vrrp get $j backup ] = true) do={
:put ("checking VRRP priority " . $j);
:if ([/interface vrrp get $j priority] != 250) do={
/interface vrrp set $j priority=250
:put ("setting priority 250 on " . $j);
}
}
}
If any vrrp interface is up:
:log info "ManualToBackup script run";
:local j
:foreach j in=[/interface vrrp find] do={
:put ("checking VRRP backup " . $j);
:if ([interface vrrp get $j master ] = true) do={
:put ("checking VRRP priority " . $j);
:if ([/interface vrrp get $j priority] != 100) do={
/interface vrrp set $j priority=100
:put ("setting priority 100 on " . $j);
}
}
}
For example, on Mikrotik-1 interface vrrp_lan is down. Then script on Mikrotik-2 change priority for interfaces vrrp-wan and vrrp-vlan91 from 100 to 250 and. Priority for interface vrrp-lan will 100. It help if vrrp-lan up on first router. If vrrp-lan up on first router, secondary script on Mikrotik-2 executed and make priority for vrrp-wan and vrrp-vlan91 100.
But I have any problems.
Simetimes, when some interface on Mikrotik-1 is down, I have priority for all vrrp-interfaces on Mikrotik-2 is 250. It prevents switch on Mikrotik-1 when all is well.
Do you have any ideas?