Well, the actual idea behind both recursive routing and netwatch checking is to use a “remote” (and likely reliable) DNS server (such as 8.8.8.8, 8.8.4.4.4, 9.9.9.9, 1.1.1.1, etc.) to check the connection to the internet by pinging it.
This is done through a “narrow” additional route (a /32 one) to the chosen DNS server.
A recursive set is made of TWO routes, the narrow one telling the router what the next hop (let’s call “next hop” the “gateway=” setting) to reach the DNS server ( I will use two, 1.1.1.1/32 and 9.9.9.9 for the example) is and a wide 0.0.0.0/0 route with a check-gateway for the same 1.1.1.1 and 9.9.9.9, simplified (anav’s example has only 1.1.1.1) :
.
set#1 (checked address 1.1.1.1 with distance=1 and next hop set to ISP1):
Route#1 distance=1 dst-address=1.1.1.1/32 gateway=ISP1-gatewayIP
Route#2 check-gateway=ping distance=1 dst-address=0.0.0.0/0 gateway=1.1.1.1
set#2 (checked address 9.9.9.9 with distance=2 and next hop set to ISP2)
Route#3 distance=2 dst-address=9.9.9.9/32 gateway=ISP2-gatewayIP
Route#4 check-gateway=ping distance=2 dst-address=0.0.0.0/0 gateway=9.9.9.9
When BOTH ISP1 AND ISP2 are working:
Route#1 is active as it is the ONLY route leading to 1.1.1.1
Route#2 is active because has the lowest distance among the routes leading to 0.0.0.0
Route#3 is active as it is the ONLY route leading to 9.9.9.9
Route#4 is NOT active as there is Route#2 leading to the same 0.0.0.0 but with a lower distance
IF you switch off (or disconnect LAN side) your ISP1 router:
Route#1 becomes NOT active as the ISP1 router is not reachable
Route#2 becomes NOT active as the 1.1.1.1 is not reachable
Route#3 is still active
Route#4 becomes active because it is the ONLY route to 0.0.0.0 (actually the one with the smaller distance among active routes)
IF you disconnect your ISP1 router from the fibre/dsl/whatever: (thus simulating an interruption anywhere between your ISP router and 1.1.1.1):
Route#1 is active as it is the ONLY route leading to 1.1.1.1
Route#2 becomes NOT active as the 1.1.1.1 is not reachable
Route#3 is still active
Route#4 becomes active because it is the ONLY route to 0.0.0.0 (actually the one with the smaller distance among active routes)
As soon as 1.1.1.1 becomes reachable again Route#2 (or Routes#1 and #2) will be active again.
More detailed explanation (including scope and target scope) here:
http://forum.mikrotik.com/t/trying-to-understand-this-config-mikrotik-automatic-isp-fail-over-without-scripts-or-route-marking/177349/1
Hope that this way it is easier to understand the general idea, but have a look at this:
http://forum.mikrotik.com/t/simpler-failover-for-two-gateways-i-found-working/169108/1
in the even more simplified version here:
http://forum.mikrotik.com/t/simpler-failover-for-two-gateways-i-found-working/169108/1
it is as simple as it can be.