Hi,
I saw it reported elsewhere that recursive routes and gateway tracking don’t work in RoS 7.x, and I can see a thread here where someone is having the same issue with no actual fix reported. Is this still an issue? At the moment I rely on this feature on my RB4011 to fail over between ADSL on a Zyxel router, and LTE on a Mikrotik SXT.
Thanks. Can I just be clear as I’m not sure which is which, but it looks like the target scope needed to be at least equal in RoS 6, but now needs to be greater. Could you give a concrete example, for example in my network ..
(1) Remote gateway has scope=10 and target-scope=10
(2) Route via that gateway has scope=10 and target-scope=30
If I understand correctly one of those 10 figures needs to be 11, but I’m not quite clear which. The description "In ROS 7 “target scope > target scope resolving route” doesn’t quite make sense, and in my example the target-scope of the route (30) is already greater than the target-scope of the gateway (10).
Again if I understand correctly, in RoS 6 the match is between target-scope of the gateway, and scope (not target-scope) of the route.
In ROSv6, everythig was easy and logical:
Now, MT came up with V7 and made everything overly complicated…
The same config doesnt work anymore:
Thats because they invented a hidden +1 for each recursive route, you can see this under Route->Nexthop, the 11:
This means you have to go from the point of the exit-interface back to the 0.0.0.0/0 route and add alway +1:
The next route got now a 12, so we have to define a 12 for the next route:
This makes it clearer (or not):
0.0.0.0/0 goes through 10.0.0.1 = +1 (10+2 or 10+1+1)
10.0.0.1 goes through 8.8.8.8 = +1 (10+1)
8.8.8.8 goes through 10.88.20.2 = base (10)
PS: I cant express my feeling in words how much I hate MT for doing such s*it!! For not saying a single word, for not documenting such essential things and for even have the (not automatically refreshing) Nexthop-window now separated from the Route-Window. And over all, WHY DO NOT SIMPLY IMPLEMENT A WAN CHECK LIKE ANY OTHER VENDOR? Just my 5ct…
The RoS gateway tracking and recursive route function is miles more useful. For example I have some traffic routed to ADSL as first choice, some routes via LTE, and both will fail over if either of those Internet connections goes down. You can’t do anything remotely like that with Detect Internet.
Cisco’s IP SLA and Object Tracking is better still, with inherent support for multiple and/or targets and configurable polling, failover and fail back timing. I had hoped that Mikrotik might have added some of these into RoS 7.x
I’ve just done some testing with a CHR in GNS3 using 7.1.1 and I must say it doesn’t work or look like your screenshots. In fact it appears to work exactly the same as in RoS 6, gateway has Scope=10 and Target-Scope=10. And the default route relying on the gateway has the default values of 10 and 30.
There’s no Next Hop tab on the gui, nor can it be accessed from the terminal.
Route failover does work, the only issue being the display where in normal mode the active default route is flagged “AS” and the failover is flagged “S” and shown in blue. In failover, when the gateway is unreachable the preferred default route changes from “AS” to “IUSH” and shows in red. The failover route which is now in service still shows “S” and in blue.
A change from 7.1 to 7.1.1 maybe?
Or is it platform dependant, so what works on the CHR may not work for say RB4011 or Hap AC.
Regardless can I make the changes now on my version 6, without detrimental effects so when I switch to 7.12 etc. It will keep working? In other words no harming in adding greater values for Target Scope on vers6?
I’m actually wondering is Guscht’s example is a bit more complex as has three layers. To put it simply in my case I have two ..
Gateway 8.8.8.8 routes via a local next hop
Route 0.0.0.0 routes via 8.8.8.8
He has three layers …
Gateway 8.8.8.8 routes via local next hop
Gateway 10.0.0.1 routes via 8.8.8.8
Route 0.0.0.0/0 routes via 10.0.0.1
It’s not clear to my why not have 0.0.0.0/0 via 8.8.8.8 and cut out the middleman, or to put it another way what does 10.0.0.1 add to the mix. He’s also set Target Scope to 10 for everything, where I have only set that for the gateways.
Route failover does work, the only issue being the display where in normal mode the active default route is flagged “AS” and the failover is flagged “S” and shown in blue. In failover, when the gateway is unreachable the preferred default route changes from “AS” to “IUSH” and shows in red. The failover route which is now in service still shows “S” and in blue.
The route flags seem to be just a glitch in Winbox not refreshing the display. If you switch away and then back the failover route is flagged “AS” and is no longer blue.
but my recursive routes are invalid for some reason. Can someone help me figure out what is going on? At ROS6 didn’t had problems with mangle and static routing.
In my opinion it is buggy in 7.1.1 in that the values needed for Scope and Target Scope seem inconsistent between one configuration and another. Just simulating your routing, the routes can up when I changed Target Scope on all four 0.0.0.0/0 routes to be 11 rather than 10.
Whether that will achieve what you want is another matter. I can’t understand why you don’t just have one route via 8.8.8.8 and one via 8.8.4.4
Recursive routing from ros 6 to ros7.
I’ve made some changes in scope and target scope for this to work. It is working now but every 2-3 minutes I have a small lost of internet connection, maybe a second or two, but enough to stop my streaming…
I have 2 WAN, 1 DSL line and 1 LTE. I want failover only, if the DSL is down then route at internet from LTE.
I tried both setups with scopes 11, they are valid but i don’t have internet at all. Also tried only routes from 8.8.8.8 and 8.8.4.4 but still no internet. Now I left 1 route 0.0.0.0/0 with the gateway from the DSL it works, internet connectivity is up.
Can you describe your network in a bit more detail? Your screenshot shows two next-hop gateways, one 91.138.169.236 via ether5, is that your DSL gateway. And one 192.168.88.1 via ether1, is that LTE via a separate router?
Once you changed the scope settings, and all your routes were up then if it worked the same as my test you would have had two default routes live, with the same preference, one via 91.138.169.236 and one via 192.168.88.1. So it would have been sending packets indiscriminately via or either of those paths. It doesn’t sound as if that’s what you want. What you should have is your 0.0.0.0/0 route via 8.8.8.8 set as distance=1, and the route via 8.8.4.4 as distance=2. You only need one of each.
Alternatively, if your LTE is purely a backup then there’s no need to test whether it’s up or not. You will be sending data there only if your DSL is down and there is no other option. So just add the route as a normal static route with a higher distance.
Just as a matter of good practice I wouldn’t use 8.8.8.8 or 8.8.4.4 as recursive gateways, for a couple of reasons. (1) Google’s DNS servers are known to deprioritise ping replies, so you may get some false alarms. (2) In your case you are forcing 8.8.8.8 over DSL only, so it will be inaccessible if the DSL is down, meaning it can’t be used for DNS during failover. Instead I suggest using something specific to your DSL provider, that you don’t mind losing access to if the DSL is down. For example their own DNS, or NTP server or a gateway or something.
So you have an active route to each ISP, both with Distance=1, and a standby route also to each ISP both with Distance=2. No wonder your router is confused!
And I didn’t notice, or maybe you didn’t say, that you are also using separate routing tables. Are you marking or classifying your traffic so that it knows when to use “to_ISP1” or “to_ISP2” rather than “main”? Can you describe the function that you are trying to achieve? Earlier you said “I have 2 WAN, 1 DSL line and 1 LTE. I want failover only, if the DSL is down then route at internet from LTE.” but separate routing tables look like you’re trying to steer some traffic preferentially to ISP1 and some to ISP2.
I also note your comment “Every route has 2 DNS checks, 8.8.8.8 and 8.8.4.4” again that is not correct for failover. If either of the two checks pass then both routes will be active, if they both fail then both routes will go down. That is not a failover configuration, what you want is one route to stay up if the check(s) pass, and the other to take its place if the checks fail.
Can you paste your full configuration, so we can see if there are any other funnies lurking?
I suspect those mangle rules are not doing anything very useful. The egress interface is not determined until after the routing decision has been made, to use ADSL or LTE So a mangle rule matching on egress interface is effectively too late. I can’t see what action you have set for those rules either. You are matching “chain=output” which is packets originating from the router, not packets passing through it.
You don’t need them for routing failover in any case. All you need are the two routes as I showed before, plus the route for your chosen remote gateway via ADSL.