I updated my router to ROS 7 and configure failover from ether1 to lte1 based on the official Mikrotik website guide. In addition to this, I also made a small script to notify me in Telegram, based on periodically checking the main channel (ether1) via ping. The problem is that the notifications are triggered, but for some reason the channel (routes) doesn’t switch and work.
Here is my current config at the moment:
Well its not clear from your description the purposes of the WANS.
Assuming you use WAN1 as a primary and WAN2 as a failover, why are you mangling etc..… no need for basic scenario.
The problem is that you are simply copying information from the MT website and its rarely accurate to ones specific needs and is a generic example. They expect you to know ROS and adjust the config accordingly.
In other words avoid the complication of recursive routing, which is what you were looking at and using but without any knowledge on what it means or how to use it, and thus stay with simple.
To explain the above,
Routes work on the premise of tables. The primary table is the MAIN TABLE. This is where the router looks to see where to send traffic based on several factors.
a. Is the route active or not.
b. If two routes are active, within the same table, the router will choose the smallest destination
c. if the destinations are equal then the router looks at distance…
So in the example provided above you will see that the destinations are equal both state dst-address=0.0.0.0/0 which is basically a catch all for the www ( all possible addresses ).
Thus we use distance to ensure the primary is ISP1 and the secondary is ISP2.
The addition of check-gateway=ping is a way for the router to determine if a route is AVAILABLE ( some say ACTIVE). The ping occurs every 10 secs and if two pings result in no return the router makes the route inactive and thus the router will look for the next available route within the same table.
We dont use check-gateway=ping on the backup, because if thats not available, there are no other options to go to…
The problem is that you are simply copying information from the MT website and its rarely accurate to ones specific needs and is a generic example. They expect you to know ROS and adjust the config accordingly.
In other words avoid the complication of recursive routing, which is what you were looking at and using but without any knowledge on what it means or how to use it, and thus stay with simple.
To explain the above,
Routes work on the premise of tables. The primary table is the MAIN TABLE. This is where the router looks to see where to send traffic based on several factors.
a. Is the route active or not.
b. If two routes are active, within the same table, the router will choose the smallest destination
c. if the destinations are equal then the router looks at distance…
So in the example provided above you will see that the destinations are equal both state dst-address=0.0.0.0/0 which is basically a catch all for the www ( all possible addresses ).
Thus we use distance to ensure the primary is ISP1 and the secondary is ISP2.
The addition of check-gateway=ping is a way for the router to determine if a route is AVAILABLE ( some say ACTIVE). The ping occurs every 10 secs and if two pings result in no return the router makes the route inactive and thus the router will look for the next available route within the same table.
We dont use check-gateway=ping on the backup, because if thats not available, there are no other options to go to…
Sometimes I faced a strange situation on my ISP, their gateway is available, but there is no Internet. Initially, I thought that their DNS was not working, but after changing the DNS to Google (8.8.8.8 and 8.8.4.4) I realized that the problem was of a completely different nature andI don’t know what exactly their problems are, so that’s all I came up with , this is to ping the availability of any address on the Internet, for example, DNS from Google - 8.8.8.8. After I changed the gateway check to 8.8.8.8, notifications began to arrive in Telegram, but the route still didn’t switch.
Well then if you have a flaky ISP in terms of connectivity then suggest you call them and ask why so?
In addition in your case recursive makes sense in that the router will be checking a WWW address such as 9.9.9.9 to confirm if there is connectivity or not and if not then switch to the other WAN.
The router is doing the work no need to mangle for pinging…
In this case…the proper format is as follows:.
Basically what we are saying is that we check the farthest hop DNS gateway to WWW (recursive route ) by utilizing the intermediary hop from router to DNS (resolving route)
The important items are to ensure the target scope is greater for the farther hops for each route
The scope has to be equal or less than the target scope of the next farthest hop.
anav, it works fine, thank you so much for your help! Damn, I even didn’t think that it was so easy to do in ROS 7.
p.s. I don’t think it’s necessary to create a new topic for this question, so I’ll ask it here. Is it possible to somehow catch route flags status changes from AS to USHI and pass it to the notification script?