Community discussions

MikroTik App
 
mixig
Member
Member
Topic Author
Posts: 315
Joined: Thu Oct 27, 2011 2:19 pm

VRRP tracking interface

Tue Oct 23, 2012 1:30 pm

Hi,

two mikrotik routers on the same lan segment, one master, the second one backup, in lan area it`s working how it should be. How to configured mikrotik to low priority if wan interface is done, or if some ip address from the internet is not up (in cisco in hsrp we can do tracking interface using probe). So when wan interface or anything else we configured is down low prioirty so that second mikrotik become master. Also when on first mikrotik that "probe" become active that mikrotik is going to be master again. I need any kind of script

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

Re: VRRP tracking interface

Tue Oct 23, 2012 2:25 pm

You can increase or decrease the priority of one of the VRRP peers in a scripts, this will achieve what you want. You can monitor the WAN interface with netwatch and use a script in netwatch. Monitor an internet IP through the WAN interface, or the gateway on that interface.

Or you can actually schedule a script to run every 10 sec or so and check if the interface is up. You can check whatever you like really inside of that script, either the running status of the interface, or ping the gateway on that WAN interface, etc.
 
mixig
Member
Member
Topic Author
Posts: 315
Joined: Thu Oct 27, 2011 2:19 pm

Re: VRRP tracking interface

Tue Oct 23, 2012 6:14 pm

I am on DHCP so i cant ping gateway, script which will be ping outside ip it must always be active and even with that it will not automaticaly low priority (if ping is setup e.g. every 10 sec, and there is an extra overhead on mikrotik) on the master mikrotik. So pppoe status will be good, if it is not running change priority, I looked into console but i cant figure out how to monitor interface status? if status disconnected low priority, if status connected again return priority back to origin value..

If anyone could put the code I would be grateful.

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

Re: VRRP tracking interface

Tue Oct 23, 2012 8:59 pm

This should do the trick. Might require some syntax fixes, havent tested.

Replace "VRRP_Name" with your vrrp interface name. Of course, fix your own priorities :)
{
:if ([/interface vrrp get "VRRP_Name" running]) \
	do={[/interface vrrp set "VRRP_Name" priority=9001]} \
	else={[/interface vrrp set "VRRP_Name" priority=1]}
}
 
IanOlivier
just joined
Posts: 1
Joined: Mon Feb 02, 2015 3:45 pm

Re: VRRP tracking interface

Mon Feb 02, 2015 3:53 pm

Hi
Thanks for the info, I am new to Mikrotik and the syntax is alot different. Do you perhaps have the same type of script, but to send a ping every 15 seconds to a specific IP and when that fails/reply it adjust the priority?

It will be much appreciated.

Who is online

Users browsing this forum: akakua, Bing [Bot], GoogleOther [Bot], malks, the2masters and 183 guests