Community discussions

MikroTik App
 
plani
newbie
Topic Author
Posts: 35
Joined: Sat Jan 02, 2021 12:32 pm

WAN Failover detection

Thu Nov 04, 2021 5:14 pm

Hi all,

I'm unsure where to start the next project step and hope someone can give me an advise or give me a direction.

Searching: A mechanism that helps me report/detect/monitor when the failover has been initiated/taken place.

Given: A router with WAN-Failover configured, default-WAN goes via ether1 to a DSL-Router and backup-WAN goes via ether2 to a SXT for LTE backup
Additionaly: Prometheus/Grafana with alarming, Raspi-Boxes with Shell / Script capabilities....

Ideas:
- Monitor in Prometheus when the Default-Gateway changes --> not feasible as I can't extract/see what the default gateway is in Prometheus, neither using mikrotik_exporter nor snmp_exporter
- Script: Write a script on the Router that is triggered when a switch of the gateway occurs --> haven't found a clue where to trigger scripts on events
- Alternatives: I can monitor the availability of the DSL-Line or the DSL-Router, or I can monitor if the traffic on the LTE-interface is > 0. --> But both examples don't show the fact, whether the default route has changed or not. Maybe due to a bad configuration, traffic leaks through the LTE device, although DSL is available. Or maybe the failover didn't work although the monitoring shows that the DSL-Line is down

Goal: I would like to monitor the fact that the default route has changed and not a series of data that conclude that it is highly probable that the default route might have changed.

Does anybody know of such a solution or have any ideas where to start implementing?

Cheers,
plani
 
ConnyMercier
Forum Veteran
Forum Veteran
Posts: 725
Joined: Tue Dec 17, 2019 1:08 pm

Re: WAN Failover detection

Sat Nov 06, 2021 11:50 am

Guten Morgen Plani,

I had to solve a similar WAN-Failover for a Phone-System Network.
Because of the High requirements of the Client, we used a Scheduler (every 60 seconds on Startup)

Basic Parameters of Failover:
- ISP1 default, ISP2 as automatic Failover after MAX 60sec.
- Manually be able to set ISP2 as Default for the Day or Week (for maintenance)
- Expandable for possible WAN3
- Notification via Email
- Notification via Log / Syslog
- HTTP-Post to change Settings on Phone-Gateway-Server
- Update DynDNS
- No ISP Ping-Pong
if ISP2 is active and ISP1 is back online, it will only automatic switch back if ISP2 is offline
At the end of the day, the Router would always reset back to ISP1.



I attached to this Post my old Scheduler-Code...
It isn't perfect, but maybe it can help you find a better Solution!
You do not have the required permissions to view the files attached to this post.
 
ConnyMercier
Forum Veteran
Forum Veteran
Posts: 725
Joined: Tue Dec 17, 2019 1:08 pm

Re: WAN Failover detection

Sun Nov 07, 2021 11:12 pm

Found another Script, maybe it can help !

viewtopic.php?t=177917

Who is online

Users browsing this forum: VadymMasiuk and 83 guests