Example is http://wiki.mikrotik.com/wiki/Advanced_ ... _Scripting.
When I unplug cable from mikrotik (1 on picture), route become unactive, failover works. I even thing that it is not failover, but just one of the 0.0.0.0/0 routes changes to down manually.
But when I unplug cable 2 - failover does not works.
While cable 2 unpluged I try to ping 188.8.131.52 (which must be pinged via ISP1 - it is setup by /ip route add dst-address=Host1A gateway=184.108.40.206 scope=10):
So, timeout - answer to ping via ISP1 (220.127.116.11). This forces mikrotik to think, that this route via 18.104.22.168 is down.
[admin@MikroTik] > ping 22.214.171.124 SEQ HOST SIZE TTL TIME STATUS 0 126.96.36.199 timeout 1 188.8.131.52 84 64 643ms host unreachable 2 184.108.40.206 timeout 3 220.127.116.11 timeout 4 18.104.22.168 84 64 741ms host unreachable 5 22.214.171.124 timeout 6 126.96.36.199 timeout 7 188.8.131.52 84 64 843ms host unreachable sent=8 received=0 packet-loss=100%
Mikrotik try to ping 184.108.40.206 via other active route (220.127.116.11), but route to host 18.104.22.168 is only via 22.214.171.124. And cheme should works, as for me.
Why in this situation route via 126.96.36.199 is not marked as unreacheble?
After some experiments, I use Netwatch and action UP, DOWN, everything work.
Something like if 188.8.131.52 is down:
/ip route disablee [find comment="ISP1"]
/ip route enable [find comment="ISP2"]
But I very interested why isnt works example from http://wiki.mikrotik.com/wiki/Advanced_ ... _Scripting.
How to understand why rules like:
/ip route add dst-address=184.108.40.206 gateway=220.127.116.11 scope=10 target-scope=10 check-gateway=ping
Or its works, but how to understand why route become active?
Idea of the scripts:
Google: Host1A: 18.104.22.168 Host2A: 22.214.171.124 OpenDNS: Host1B: 126.96.36.199 Host2B: 188.8.131.52 /ip route add dst-address=184.108.40.206 gateway=220.127.116.11 scope=10 add dst-address=18.104.22.168 gateway=22.214.171.124 scope=10 add dst-address=126.96.36.199 gateway=188.8.131.52 scope=10 add dst-address=184.108.40.206 gateway=220.127.116.11 scope=10 add dst-address=18.104.22.168 gateway=22.214.171.124 scope=10 target-scope=10 check-gateway=ping add dst-address=126.96.36.199 gateway=188.8.131.52 scope=10 target-scope=10 check-gateway=ping add dst-address=184.108.40.206 gateway=220.127.116.11 scope=10 target-scope=10 check-gateway=ping add dst-address=18.104.22.168 gateway=22.214.171.124 scope=10 target-scope=10 check-gateway=ping add dst-address=0.0.0.0/0 gateway=126.96.36.199 distance=1 add dst-address=0.0.0.0/0 gateway=188.8.131.52 distance=2