hi bpwl......... I think the logic is as follows.......
FARTHEST ROUTE: SCOPE= (doesnt matter) / TARGET SCOPE=Y+2
CLOSER ROUTE: SCOPE= Y+2 or less / TARGET SCOPE=Y+1
CLOSEST ROUTE: SCOPE=Y+1 or less / TARGET SCOPE=Y (
gateway=ISP)
INTERNAL ROUTE: ( within router, scope is not used, no recursive action at all )
Where the farthest route has the highest Target Scope and it decreases by one for each step as you move closer to the router.
Similarly as one gets closer to the direct route on the router (ISP gateway) the
scope on the closer route must be equal to or less than the previous route's
target scope.
Thus we have two relationships to consider for routes that flow into each other.
Flat approach ---> Recursive Route to Resolving Route. (DNS gateway to ISP gateway).
Nested approach --> Recursive Route to Recursive Route to Resolving Route (BOGUS address to DNS Gateway to ISP Gateway).
BASIC: (via one DNS site)
.....................
/ip route
add check-gateway=ping distance=3 dst-address=0.0.0.0/0 gateway=1.0.0.1 scope=10 target-scope=12
add distance=3 dst-address=1.0.0.1/32 gateway=PrimaryISP-gatewayIP scope=10 target-scope=11
add comment=SecondaryISP distance=10 dst-address=0.0.0.0/0 gateway=SecondaryISP-gatewayIP scope=10 target-scope=30
..................................................
{As you can see TS as you get closer to the router decreases by 1, (twelve to eleven) and the scope of the next route is equal to or less than the TS of the previous route (twelve compared to ten).}
{Its also very easy to avoid confusion, simply set all scopes to 10, and ensure the final TS (at the ISP gateway is no less than 10) }
FLAT: (via two DNS sites)
.......................
/ip route
add check-gateway=ping distance=3 dst-address=0.0.0.0/0 gateway=1.0.0.1 scope=10 target-scope=12
add distance=3 dst-address=1.0.0.1/32 gateway=PrimaryISP-gatewayIP scope=12 target-scope=11
+++++++++++++++++++
add check-gateway=ping distance=4 dst-address=0.0.0.0/0 gateway=9.9.9.9 scope=10 target-scope=12
add distance=4 dst-address=9.9.9.9/32 gateway=PrimaryISP-gatewayIP scope=12 target-scope=11
+++++++++++++++++++
add comment=SecondaryISP distance=10 dst-address=0.0.0.0/0 gateway=SecondaryISP-gatewayIP scope=10 target-scope=30
...............................................
NESTED: (via two DNS sites)
.......................
/ip route
dst-address=0.0.0.0/0 gateway=10.10.10.10 scope=10 target-scope=14
++++++++++++++++
dst-address=10.10.10.10/32 gateway=9.9.9.9 scope=14 target-scope=13 check-gateway=ping
add dst-address=9.9.9.9/32 gateway=PrimaryISP-gatewayIP scope=13 target-scope=12
+++++++++++++++
dst-address=10.10.10.10/32 gateway=1.0.0.1 scope=14 target-scope=13 check-gateway=ping
add dst-address=1.0.0.1/32 gateway=PrimaryISP-gatewayIP scope=13 target-scope=12
+++++++++++++++
add comment=SecondaryISP distance=10 dst-address=0.0.0.0/0 gateway=SecondaryISP-gatewayIP scope=10 target-scope=30