Community discussions

MikroTik App
 
mendez
just joined
Topic Author
Posts: 3
Joined: Wed Jan 06, 2010 6:40 pm

Check and disable route if internet link going down

Tue Jan 25, 2011 12:56 pm

Hi to all.

I have this topology:
Image

The 192.168.1.1 on eth2 and 192.168.40.1 on eth3 are the load balanced gateway for the LAN (according to: http://wiki.mikrotik.com/wiki/Improved_ ... e_Gateways).

Packet marked "odd" going across eth2 and packed marker "even" across eth3, everything works good if both internet link are UP and running...


What i need is that:
- If "Radio Link" going down, disable the mangle rules that mark packet for this gateway eth3, enable a default route only over "ADSL Router"
- If "ADSL Link" going down, disable the mangle rules that mark packet for this gateway eth2, enable a default route only over "Radio LINK"
- Re-enable disabled rules when a link come up.

I think is necessary a script to ping a external host specifying outgoing interface, then according to ping response make apropriate action...

I have no idea on how to achieve this, someone I can 'help?

thanks
 
User avatar
sariao
Frequent Visitor
Frequent Visitor
Posts: 92
Joined: Thu Jul 08, 2004 10:55 am
Location: Saudi Arabia

Re: Check and disable route if internet link going down

Fri Jan 28, 2011 12:49 am

post an export of your Mangle, NAT, and Routing Table
 
spookman
Frequent Visitor
Frequent Visitor
Posts: 56
Joined: Sun Nov 15, 2009 3:01 pm

Re: Check and disable route if internet link going down

Thu Mar 03, 2011 12:14 pm

Did you ever figure this out ?
 
CyberT
Member Candidate
Member Candidate
Posts: 172
Joined: Tue Feb 01, 2011 1:39 pm
Location: Johannesburg, South Africa
Contact:

Re: Check and disable route if internet link going down

Thu Mar 03, 2011 2:21 pm

For the wireless link its rather easy, I would use the net watch command, and let it fire a script to kill of all the Mangle rules for the one side, and then on net watch up, make them live again, Might have to monitor the endpoint of the wireless link for that, But thats all the same, On the Local side it might get more tricky, esp if you can see the host that you need to monitor via both gateways.

I would look at doing something like

:foreach i in [/ip firewall mangle find] do {If [/ip firewall mangle number=$i = "packet destined for wirelless] do [/ip firewall mangle number=$i disable]}

Check the scripting and the net watch, but its most likely the starting point that you need.
 
spookman
Frequent Visitor
Frequent Visitor
Posts: 56
Joined: Sun Nov 15, 2009 3:01 pm

Re: Check and disable route if internet link going down

Wed Mar 09, 2011 7:14 am

I found an easier way and it works without scripts, incase you are intrested

http://wiki.mikrotik.com/wiki/Advanced_ ... _Scripting

Who is online

Users browsing this forum: Fogga, jmszuch1, MartinT, normis and 112 guests