Community discussions

 
ik3umt
Member Candidate
Member Candidate
Topic Author
Posts: 248
Joined: Tue Jul 08, 2014 3:58 pm

How to disable a non working NATted route ?

Fri Sep 30, 2016 5:12 pm

PCC environment:

I have four DSL routers natted to four routerboard WAN ethernet
Each DSL router LAN ip address is configured as gateway in routerboard
if a DSL line fails routerboard is not aware of, so that gateway is still considered valid

How can it automatically disable that route when DSL fails (or internet is no more available on that route) ??

Should I ping time to time an internet ip address and chech if it is alive ? how to configure this ?

thank you
 
pe1chl
Forum Guru
Forum Guru
Posts: 5928
Joined: Mon Jun 08, 2015 12:09 pm

Re: How to disable a non working NATted route ?

Fri Sep 30, 2016 5:52 pm

This is always a bit tricky... you can setup some netwatch entries that ping a host behind each line.
Of course you need to set static routes for that host via the correct line. So you need 4 hosts that do not
mind to be pinged all day and that you can statically route. (they will be unreachable when the corresponding line is down).
Note that when the hosts goes offline that corresponding line is considered to be down, so you add another point of failure.

Then in the netwatch entries you can add scripts that disable the default route via that line. Of course you must
make sure the static route to the single host remains there so the netwatch can detect the line comes back up.

Expect at least as many "incorrect decisions" and "unexpected events" as you now have "failed DSL" events :-)
 
ik3umt
Member Candidate
Member Candidate
Topic Author
Posts: 248
Joined: Tue Jul 08, 2014 3:58 pm

Re: How to disable a non working NATted route ?

Mon Oct 03, 2016 10:05 am

I'll give it a try,
thank you
 
ik3umt
Member Candidate
Member Candidate
Topic Author
Posts: 248
Joined: Tue Jul 08, 2014 3:58 pm

Re: How to disable a non working NATted route ?

Wed Oct 12, 2016 10:01 am

I've found http://wiki.mikrotik.com/wiki/Advanced_ ... _Scripting very useful, expecially second example :

/ip route
add dst-address=Host1A gateway=GW1 scope=10
add dst-address=Host1B gateway=GW1 scope=10
add dst-address=Host2A gateway=GW2 scope=10
add dst-address=Host2B gateway=GW2 scope=10

/ip route
add dst-address=10.1.1.1 gateway=Host1A scope=10 target-scope=10 check-gateway=ping
add dst-address=10.1.1.1 gateway=Host1B scope=10 target-scope=10 check-gateway=ping
add dst-address=10.2.2.2 gateway=Host2A scope=10 target-scope=10 check-gateway=ping
add dst-address=10.2.2.2 gateway=Host2B scope=10 target-scope=10 check-gateway=ping

/ip route
add distance=1 gateway=10.1.1.1 routing-mark=ISP1
add distance=2 gateway=10.2.2.2 routing-mark=ISP1
add distance=1 gateway=10.2.2.2 routing-mark=ISP2
add distance=2 gateway=10.1.1.1 routing-mark=ISP2


I like the way virtual hops can be used to get recursive resolution of routes
That route remains active as long as one or more hosts are pingable....nice !!

A question: is there a way to extend ping interval for those hosts , or system ping interval is used ?
A ping check every some tens of seconds would be enough...
 
pe1chl
Forum Guru
Forum Guru
Posts: 5928
Joined: Mon Jun 08, 2015 12:09 pm

Re: How to disable a non working NATted route ?

Wed Oct 12, 2016 3:22 pm

Ok that looks nice (although it appears like a trick, it probably needs good testing with current RouterOS version).
With this solution you still need reliable external hosts, of course.
It also seems like a good idea to write some script that checks the situation once an hour or so and mails about
reachable/unreachable hosts and links that it has decided not to use.

Who is online

Users browsing this forum: No registered users and 20 guests