Page 1 of 1

script failover with 3 ISP

Posted: Tue Feb 28, 2017 9:31 pm
by vturceniuc
Hello everybody.

I have the following problem, if anyone knows please help me.

I have a hex which has 3 ISP router.
1 ISP Metronet
1 ADSL ISP
1 ISP VODAFONE (on USB)

I need to do failover level script to check in 8.8.8.8 is interrupted when an ISP to give the next.
The order would be
Metronet distance = 1
ADSL 2 = distance
Vodafone stik = distace3

Thank you,

Re: script failover with 3 ISP

Posted: Wed Mar 01, 2017 1:47 am
by AldoJimenez
You can achieve this with Netwatch.

https://wiki.mikrotik.com/wiki/Manual:Tools/Netwatch

Re: script failover with 3 ISP

Posted: Thu Mar 02, 2017 1:11 am
by FlavioCamacho
Make a static route for 8.8.8.8 with each gateway and mark check-gateway with ping to determine if the ISP is UP.

/ip route add dst-address=8.8.8.8 gateway=METRONET distance=1 check-gateway=ping
/ip route add dst-address=8.8.8.8 gateway=ADSL distance=2 check-gateway=ping
/ip route add dst-address=8.8.8.8 gateway=VODAFONE distance=3 check-gateway=ping

With this when one of the gateways is off the default route will be disable.

/ip route add dst-address=0.0.0.0/0 gateway=METRONET distance=1
/ip route add dst-address=0.0.0.0/0 gateway=ADSL distance=2
/ip route add dst-address=0.0.0.0/0 gateway=VODAFONE distance=3

You will see only one black the others will be blue and inactive.

Re: script failover with 3 ISP

Posted: Sat Mar 04, 2017 1:19 pm
by jarda
Testing the gateway accessibility does not say anything about Internet access.