Exactly how to use for recursive routes.......... I am guessing that the standard is scope30 target scope 10 but why?'scope' and 'target-scope' are for recursive routes. you don't need them until you know what they are for
for main/backup gateways you just need different 'distance' value
Not me, man. Not me.I think you have that mixed up.
Okay so they are independednt in that target scope is only used for next hop routing rules and scope is used in general for all route rules.Exactly!
There is no relation between distance and scope/target-scope: one is used for route selection, another for nexthop selection.
Sure I have!Haven't you met anav before?
+1So in a typical double recursive setup........
This should be the setup.........
where the default setting for IP routes seems to be scope=30 targetscope=10
Primary ISP
First external check
1 - add check-gateway=ping distance=3 gateway=1.0.0.1 (cloudfare) scope=30 targetscope=10
2 - add distance=3 dst-address=1.0.0.1/32 gateway=ISP_Primary scope=10 targetscope=10
Second exernal check
(L2) add check-gateway=ping distance=4 gateway=208.67.220.220 (opendns) scope=30 targetscope=10
(L4) add distance=4 dst-address=208.67.220.220/32 gateway=ISP_Primary scope=10 targetscope=10
Secondary ISP
(L5) add distance=10 gateway=ISP_Secondary scope=30 target scope=10
/ip route
add check-gateway=ping distance=10 gateway=1.0.0.1
add distance=10 dst-address=1.0.0.1/32 gateway=192.168.1.2 scope=10
add check-gateway=ping distance=11 gateway=208.67.222.222
add distance=11 dst-address=208.67.222.222/32 gateway=192.168.1.2 scope=10
add distance=12 gateway=192.168.1.1
add check-gateway=ping distance=20 gateway=8.8.4.4 routing-mark=Reversed
add distance=20 dst-address=8.8.4.4/32 gateway=192.168.1.1 routing-mark=Reversed scope=10
add check-gateway=ping distance=21 gateway=208.67.220.220 routing-mark=Reversed
add distance=21 dst-address=208.67.220.220/32 gateway=192.168.1.1 routing-mark=Reversed scope=10
add distance=22 gateway=192.168.1.2 routing-mark=Reversed
Can you explain what you mean by "reversed gateway order"? Do you want one group of hosts to prefer one uplink when both are available, and the other group of clients to prefer the other uplink, while both can use their non-preferred uplink if the preferred one is down, or do you mean something completely different?I tried to use this logic to add a reversed gateway order for some clients
...
Is there some other way to accomplish this?
Yes you got it. That is exactly what I mean.Do you want one group of clients to prefer one uplink when both are available, and the other group of clients to prefer the other uplink, while both can use their non-preferred uplink if the preferred one is down
Your nickname has helped me a lot to choose the proper dialect of English for decodingYes you got it. That is exactly what I mean.
/ip route
add dst-address=8.8.4.4/32 gateway=192.168.1.1 scope=10
add dst-address=208.67.220.220/32 gateway=192.168.1.1 scope=10
add dst-address=1.0.0.1/32 gateway=192.168.1.2 scope=10
add dst-address=208.67.222.222/32 gateway=192.168.1.2 scope=10
add check-gateway=ping distance=10 gateway=1.0.0.1
add check-gateway=ping distance=11 gateway=208.67.222.222
add distance=12 gateway=192.168.1.1
add check-gateway=ping distance=20 gateway=8.8.4.4 routing-mark=Reversed
add check-gateway=ping distance=21 gateway=208.67.220.220 routing-mark=Reversed
add distance=22 gateway=192.168.1.2 routing-mark=Reversed
I'm not claiming anything - I use the adjective "immortal" to describe the role (or purpose) in the whole setup, not as a property.How sure are you about the "immortal IP" claim?
{dst-address=a.a.a.a/32 via connected gateway
dst-address=0.0.0.0/0 via a.a.a.a/32 check-gateway=ping}
{dst-address=b.b.b.b/32 via connected gateway
dst-address=0.0.0.0/0 via b.b.b.b/32 check-gateway=ping}
{
{dst-address=a.a.a.a/32 via connected gateway
dst-address=x.x.x.x/0 via a.a.a.a/32 check-gateway=ping}
{dst-address=b.b.b.b/32 via connected gateway
dst-address=x.x.x.x/0 via b.b.b.b/32 check-gateway=ping}
}
dst-address=0.0.0.0 via x.x.x.x
OK. Since I usually don't use Winbox nor WebFig, I haven't noticed that they allow to sort routes by any parameter. In commandline they are always sorted by dst-address.I use distance in this way because I like to sort the routing table by distance and this makes the table more legible for me.
Do I read you right that the default routes via physical gateways are there to address the situation where both "immortal" addresses would be down so you take the availability of the physical gateway as the last chance?In any case here is what I did to fix my routing table:
Code: Select all/ip route add dst-address=8.8.4.4/32 gateway=192.168.1.1 scope=10 add dst-address=208.67.220.220/32 gateway=192.168.1.1 scope=10 add dst-address=1.0.0.1/32 gateway=192.168.1.2 scope=10 add dst-address=208.67.222.222/32 gateway=192.168.1.2 scope=10 add check-gateway=ping distance=10 gateway=1.0.0.1 add check-gateway=ping distance=11 gateway=208.67.222.222 add distance=12 gateway=192.168.1.1 add check-gateway=ping distance=20 gateway=8.8.4.4 routing-mark=Reversed add check-gateway=ping distance=21 gateway=208.67.220.220 routing-mark=Reversed add distance=22 gateway=192.168.1.2 routing-mark=Reversed
If I understand the first question correctly then yes.Do I read you right that the default routes via physical gateways are there to address the situation where both "immortal" addresses would be down so you take the availability of the physical gateway as the last chance?
And, second, in this configuration you check four "immortal" addresses, but use only one per WAN per routing table, so you have the same amount of pings but less redundancy. There is nothing bad about using the same virtual gateway for routes with different routing-marks, as the intermediate routes are not actually used to route the "real" packets - they are used solely to find the physical gateway for the topmost routes and to monitor the transparency of the uplink all the way to the internet.
1. check if 1.0.0.1 is reachable via 192.168.1.2 gatewayCode: Select all/ip route add dst-address=1.0.0.1/32 gateway=192.168.1.2 scope=10 add check-gateway=ping distance=10 gateway=1.0.0.1
2. 1.0.0.1 is not reachable via 192.168.1.2 (for example 1.0.0.1 is dropping pings) -> check if 208.67.222.222 is reachable via 192.168.1.2 gatewayCode: Select all/ip route add dst-address=208.67.222.222/32 gateway=192.168.1.2 scope=10 add check-gateway=ping distance=11 gateway=208.67.222.222
3. both 1.0.0.1 and 208.67.222.222 are unreachable via 192.168.1.2 gateway -> now it is safe to assume that 192.168.1.2 has no internet connectivityCode: Select all/ip route add distance=12 gateway=192.168.1.1
OK, this final remark made me understand your concept. You simply don't monitor the backup path within each group as you see no purpose in it. So in the group which prefers WAN A, you use recursive routing via two "immortal" addresses via WAN A, but you use a direct route via the "physical" gateway of WAN B as a backup; in the group which prefers WAN B, you do the same with accordingly swapped uplink roles.And the same logic applies for the "Reversed" route, just with different "immortal" IPs.
Here are some additional resources, explaining it in different words what may supports to understand it:Returning to the subject.
Hello.Once again, step by step:
1) A route 1 in your config needs a nexthop.
2) It has target-scope=10
3) It then searches the nexthop among the routes that has their scope<=10
4) It finds route 2 that has needed dst-address and scope=10
5) scope=10 (of route 2) <= target-scope=10 (of route 1) ---> route 2 can be used as nexthop for route 1
6) Done!
Thank you very much!@TRNX
Please read para I ( it explains recursive, provides rules of thumb, and has examples )
viewtopic.php?t=182373
add distance=1 gateway=8.8.8.8
add distance=2 gateway=1.1.1.1
add check-gateway=ping distance=1 dst-address=1.1.1.1/32 gateway=192.168.9.1 scope=10
add check-gateway=ping distance=1 dst-address=8.8.8.8/32 gateway=192.168.1.1 scope=10
Why it works at picture 2, where scope = target scope (both value = 11) but at picture 3, where scope = target scope (but value = 10) it doesn´t work?
What am I doing wrong?
Thanks for any help.
Code: Select alladd distance=1 gateway=8.8.8.8 add distance=2 gateway=1.1.1.1 add check-gateway=ping distance=1 dst-address=1.1.1.1/32 gateway=192.168.9.1 scope=10 add check-gateway=ping distance=1 dst-address=8.8.8.8/32 gateway=192.168.1.1 scope=10
add distance=1 gateway=8.8.8.8
add check-gateway=ping distance=1 dst-address=8.8.8.8/32 gateway=192.168.1.1 scope=10