Community discussions

MikroTik App
 
User avatar
andrewluck
Forum Veteran
Forum Veteran
Topic Author
Posts: 700
Joined: Fri May 28, 2004 9:05 pm
Location: Norfolk, UK

Feature request: VRRP sync groups

Wed Apr 18, 2012 12:26 pm

Alternative products such as Vyatta enable me to configure VRRP interfaces on a router in a group such that failure of a single interface in a group causes all interfaces in that group to go offline. This helps ensure that a virtual router with multiple VRRP instances will fail over correctly in the event of the failure of one of those interfaces.

I've tried and failed to set this up using scripting.

Regards

Andrew
 
5nik
Member Candidate
Member Candidate
Posts: 104
Joined: Thu Dec 08, 2011 3:15 am
Location: Czech Republic

Re: Feature request: VRRP sync groups

Tue May 22, 2012 4:19 am

+1
Yes, in case of many networks and interfaces (VLANs etc.), it should be very useful.
 
ediaz
Frequent Visitor
Frequent Visitor
Posts: 59
Joined: Tue May 22, 2012 10:38 am

Re: Feature request: VRRP sync groups

Wed May 23, 2012 12:39 am

+1

It would help to get configurations more readable.
 
User avatar
tomaskir
Trainer
Trainer
Posts: 1162
Joined: Sat Sep 24, 2011 2:32 pm
Location: Slovakia

Re: Feature request: VRRP sync groups

Wed May 23, 2012 12:49 pm

Alternative products such as Vyatta enable me to configure VRRP interfaces on a router in a group such that failure of a single interface in a group causes all interfaces in that group to go offline. This helps ensure that a virtual router with multiple VRRP instances will fail over correctly in the event of the failure of one of those interfaces.

I've tried and failed to set this up using scripting.

Regards

Andrew
I will help ;)
:foreach i in=[/interface vrrp find] do={ :if ([/interface vrrp get \$i priority] != 210) do={ [/interface vrrp set \$i priority=210] } }
Where 210 is the new wanted priority for the backup router.

Simply add this scripts as the on-master event on the backup router.
 
gyorgy
just joined
Posts: 2
Joined: Mon Jan 28, 2013 1:05 pm

Re: Feature request: VRRP sync groups

Mon Jan 28, 2013 1:22 pm

Hello everybody,

+1 for such feature

@tomaskir:

Do you have any guesses why your code would not work on my pair of RB1100AH with RouterOS 5.22?
Nothing happens when the script is run manually.

Regards,
gyorgy
 
User avatar
tomaskir
Trainer
Trainer
Posts: 1162
Joined: Sat Sep 24, 2011 2:32 pm
Location: Slovakia

Re: Feature request: VRRP sync groups

Mon Jan 28, 2013 9:57 pm

No idea, but post these and we can figure it out :)

/int vrrp exp com
/sys scr exp com
 
gyorgy
just joined
Posts: 2
Joined: Mon Jan 28, 2013 1:05 pm

Re: Feature request: VRRP sync groups

Tue Apr 02, 2013 10:05 am

Sorry for late reply, I haven't got any notification about your answer (forgot to set).

Finally, I could make scripting work. Here is the code:
:log info "ManualToMaster script run";
:foreach j in=[/interface vrrp find] do={ 
:put ("checking VRRP priority " . $j);
:if ([/interface vrrp get $j priority] != 200) do={ 
/interface vrrp set $j priority=200 
:put ("setting priority 200 on " . $j);
} 
}
It is basically your code slightly edited, but it didn't execute until I have put the log command. Perhaps, I was missing a new line somewhere.

On the other hand, a feature comparable to pfSense CARP, which provides for all sessions to be kept alive would be nice.
 
ixsystem
just joined
Posts: 3
Joined: Fri Oct 12, 2012 12:25 pm

Re: Feature request: VRRP sync groups

Tue Aug 20, 2013 1:14 pm

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?

Who is online

Users browsing this forum: Ahrefs [Bot], askarot, jaclaz, marsando and 207 guests