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 208.67.222.222 (which must be pinged via ISP1 - it is setup by /ip route add dst-address=Host1A gateway=1.1.1.1 scope=10):
Code: Select all
[admin@MikroTik] > ping 208.67.222.222
SEQ HOST SIZE TTL TIME STATUS
0 208.67.222.222 timeout
1 1.1.1.2 84 64 643ms host unreachable
2 208.67.222.222 timeout
3 208.67.222.222 timeout
4 1.1.1.2 84 64 741ms host unreachable
5 208.67.222.222 timeout
6 208.67.222.222 timeout
7 1.1.1.2 84 64 843ms host unreachable
sent=8 received=0 packet-loss=100%
Mikrotik try to ping 208.67.222.222 via other active route (2.2.2.1), but route to host 208.67.222.222 is only via 1.1.1.1. And cheme should works, as for me.
Why in this situation route via 1.1.1.1 is not marked as unreacheble?
After some experiments, I use Netwatch and action UP, DOWN, everything work.
Something like if 208.67.222.222 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:
Code: Select all
/ip route
add dst-address=1.1.1.1 gateway=208.67.222.222 scope=10 target-scope=10 check-gateway=ping
Or its works, but how to understand why route become active?
Idea of the scripts:
Code: Select all
Google:
Host1A: 8.8.8.8
Host2A: 8.8.4.4
OpenDNS:
Host1B: 208.67.222.222
Host2B: 208.67.220.220
/ip route
add dst-address=8.8.8.8 gateway=1.1.1.1 scope=10
add dst-address=208.67.222.222 gateway=1.1.1.1 scope=10
add dst-address=8.8.4.4 gateway=2.2.2.1 scope=10
add dst-address=208.67.220.220 gateway=2.2.2.1 scope=10
add dst-address=1.1.1.1 gateway=8.8.8.8 scope=10 target-scope=10 check-gateway=ping
add dst-address=1.1.1.1 gateway=208.67.222.222 scope=10 target-scope=10 check-gateway=ping
add dst-address=2.2.2.1 gateway=8.8.4.4 scope=10 target-scope=10 check-gateway=ping
add dst-address=2.2.2.1 gateway=208.67.220.220 scope=10 target-scope=10 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=1.1.1.1 distance=1
add dst-address=0.0.0.0/0 gateway=2.2.2.1 distance=2