@CGGXANNX
Yes, exactly , that is why I say not 100% correct, the scope "always" 10, add one for target-scope 11 (+1) for the narrow route and add again one for target-scope 12 (+1) for the main route is only much simpler to remember, as long as it works, though of course the "proper" way is the one you explained.
@slimprize
Yes, those would be seemingly fine for the original (but more complex) "simple" approach by Filo, the "further simplified" one:
need not the added routing table and mangling.
A word of general warning, Dos/Windows are generally speaking case insensitive, Unix/Linux - again generally speaking - are instead case sensitive, so it is always a good idea (no idea if it matters in this case, pardon me the pun) to respect case, namely:
The "simpler" approach also uses dst-address and gateway as search parameter, this way you have not the issue (numbers are the same small or capital) but more than that you do not depend on the comment(s) of the route(s) (that three, six, or twelve months in the future you may decide to change without thinking that they are relevant for the failover).
Lets set the rules straight here!!!
TWO RULES OF THUMB (scope & target scope): First Rule. The resolving route (DIRECT - connected route) with dst-address TO the “real WWW IP (dns site)” and with local ISP gateway IP, has Target-Scope=X and the recursive route (INDIRECT - external route) with gateway IP VIA the “real work WWW gateway IP (dns site)” has Target-Scope=X+1. In other words, the farther one gets from the router, the TS increases by one.
Second Rule. Between the same two routes being compared, the Direct , connected route, with local ISP gateway IP (resolving route) has to have a SCOPE that is equal to or less than the TARGET SCOPE of the recursive route. In other words, the scope of the route must be equal or less than the target scope of the next farthest route.
To keep it simple, an easy approach is to provide the same scope for all routes, and it has to be equal to or less than the closest recursive route.
Thus if we know we are starting TS with 12 and there is one recursive route, we can set all scopes to 11.
Since in the past I used to use two recursive routes, is kinda where I ended up with 10 as my defacto scope setting 12,11,10 for TS and thus 10 for all scopes.
As far as heads up…
My primary IP is dynamic and when the IP changes I get an email… and a telegram… :if ($bound=1) do={
:local gw $“gateway-address”
/ip route set [ find comment=“PrimaryRecursive” gateway!=$gw ] gateway=$gw
/tool e-mail send to=“emailaddress@gmail.ca” subject=([/system identity
get name]) body=" This is your new gateway IP: $gw";
:local sub3 ([/system clock get time])
/tool fetch “https://api.telegram.org/text=At+$sub3+BellFibre+Changed+WANIP”
:log info “Telegram notification sent PrimaryWAN IP Changed”
}
Yep , since what probably 99% of people need is one recursive route (or maybe two), one can simply bypass the extensive, but complex, explanation on how it works and why it works and just remember three steps with 10, 11 and 12 and implement them as an act of faith:
I.e., easily condensed in a 12 points numbered list: :
1. Imagine here a complex explanation of how recursive works, then ignore it.
2. Imagine here a complex explanation of how recursive works, then ignore it.
3. Imagine here a complex explanation of how recursive works, then ignore it.
4. Imagine here a complex explanation of how recursive works, then ignore it.
5. Imagine here a complex explanation of how recursive works, then ignore it.
6. Imagine here a complex explanation of how recursive works, then ignore it.
7. Imagine here a complex explanation of how recursive works, then ignore it.
8. Imagine here a complex explanation of how recursive works, then ignore it.
9. Imagine here a complex explanation of how recursive works, then ignore it. 10. Both routes must have scope=10
11. The “narrow” (/32) route to the canary must have target-scope=11
12. The “wide” (0.0.0.0/0) route must have target scope=12
Easy to remember and good enough for the 99%, the 1 % can take their time reading (and hopefully understanding) the extensive and complex explanations by anav, Chupaka or CGGXANNX, before implementing steps 10-12 .
If you think the two rules are complex, I imagine you don’t do the cooking at home ;-PP
I dont disagree with the simple approach, but nothing wrong with knowing how one gets there and thus able to adjust if required.