Community discussions

MikroTik App
 
smutsnic
newbie
Topic Author
Posts: 48
Joined: Tue Apr 19, 2005 8:49 pm

default gateway failover

Fri Nov 11, 2005 7:12 am

I would like to create a scheduled script for default gateway failover?
Any ideas where to start?
 
yogi
Frequent Visitor
Frequent Visitor
Posts: 63
Joined: Fri May 28, 2004 4:23 pm

Mon Nov 21, 2005 7:13 pm

You can create a script for changing the default gateway whenever you want, but surely you mean a script for when the link goes down? Is netwatch not what you are referring to?

Do you mean removing a specific gateway with load balancing, sorry maybe I am missing the point here.
 
smutsnic
newbie
Topic Author
Posts: 48
Joined: Tue Apr 19, 2005 8:49 pm

Mon Nov 28, 2005 4:14 pm

hi yogi,

thanks for the reply I will look into netwatch.
 
yogi
Frequent Visitor
Frequent Visitor
Posts: 63
Joined: Fri May 28, 2004 4:23 pm

Mon Nov 28, 2005 5:28 pm

/ tool netwatch 
add host=3.3.3.3 timeout=1s interval=1m up-script="/ip route set \[find comment=Default\] gateway=1.1.1.1" \
    down-script="/ip route set \[find comment=Default\] gateway=2.2.2.2" comment="" disabled=no
just add the comment Default to your route in question
 
User avatar
webasdf
Frequent Visitor
Frequent Visitor
Posts: 87
Joined: Mon Jan 26, 2009 6:37 pm

Re: default gateway failover

Mon Jan 26, 2009 10:16 pm

You should also add a static route to the host that you're checking...ie
/ip route
add dst-address=3.3.3.3 gateway=1.1.1.1 comment="Always use this default gateway for netwatch IP"
I had to do this to prevent netwatch from thrashing about when the primary connection was down.
 
egammer
just joined
Posts: 18
Joined: Fri Nov 12, 2010 5:02 pm

Re:

Wed Dec 01, 2010 6:18 pm

/ tool netwatch 
add host=3.3.3.3 timeout=1s interval=1m up-script="/ip route set \[find comment=Default\] gateway=1.1.1.1" \
    down-script="/ip route set \[find comment=Default\] gateway=2.2.2.2" comment="" disabled=no
just add the comment Default to your route in question

i have rb 750 os 4.13 and dont work this script ?

Who is online

Users browsing this forum: kivimart, RobWFS and 10 guests