in RouterOS 6 I have a running script that checks the status of the main and backup links. It works as follows (the script is quite complex, but it comes down to executing the command):
After upgrading to RouterOS 7, this method no longer works because the ping command no longer has the: routing-table parameter. How in RouterOS 7 can I ping with two different internet connections - use the first one once, and then the second when the first or the second is active?
I fail, I don’t quite understand it yet. Can You write to me how to specifically do this in RouterOS 7: two internet links (if the first ISP is active, the second ISP is disabled), and I’d like to be able to ping any address with each of them.
As I wrote, I don’t know what’s the right way. Ping in v7 doesn’t have routing-table parameter anymore, but it has vrf parameter. So I just came up with a quick way how to use that, and it seems to work. In v7 you have to manually create routing tables in “/routing table”, but you can skip that and create them using VRF instead. That’s the command I posted, which will create dynamic routing table (which can then be used same way as static one). And that’s it. I’m not sure that I like it, and I don’t know if there could be some unexpected problems with it. Hopefully someone more knowledgeable will comment on that.
Here’s my wan checking scripts updated to work with ros v7. It’s not perfect (improvements welcome) and is going to need some adaptation, but maybe some of it helps you
Looking at how much code is needed to achieve this kind of functionality, I feel there should be an easier way to handle this. I know about netwatch, but netwatch does not let you choose the same host for multiple interfaces or have the same customizability of trigger conditions for the ping,
Holy flying spaghetti monster, thanks a lot for that.
It never occurred to me that you could use none as a VRF interface and setting it to anything complete moved all ingress traffic from that interface to the VRF.
Using none I’ve emulated ROS6-style simple routing-table functionality.
And it fails if it can’t reach destination via that interface.
(traceroute tries, but will use whatever is available if doesn’t work via interface though)