What's new

WANFailover Dual WAN Failover ***v2 Release***

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

I have observed wan-failover sending notification emails at random while in failover state. I was able to capture the logs (attached) for one such event. I captured a couple monitor loops before and after the e-mail (below). I do see some warnings about a tainted process in there, could that be the cause of the issue?

***WAN Failover Notification***
----------------------------------------------------------------------------------------
Hostname: RT-AX86U_Pro-E890
Event Time: Jun 8 13:59:22
WAN0 Status: DISCONNECTED
WAN1 Status: CONNECTED
Active ISP: T-Mobile USA, Inc.
Primary WAN: wan1
WAN IPv4 Address: 192.168.12.97
WAN Gateway IP Address: 192.168.12.1
WAN Interface: eth0
DNS Server 1: 8.8.8.8
DNS Server 2: 8.8.4.4
QoS Status: Enabled
QoS Mode: Automatic Settings
----------------------------------------------------------------------------------------
 

Attachments

  • wan-failover log - tainted and bad email.txt
    77.6 KB · Views: 35
I have observed wan-failover sending notification emails at random while in failover state. I was able to capture the logs (attached) for one such event. I captured a couple monitor loops before and after the e-mail (below). I do see some warnings about a tainted process in there, could that be the cause of the issue?

***WAN Failover Notification***
----------------------------------------------------------------------------------------
Hostname: RT-AX86U_Pro-E890
Event Time: Jun 8 13:59:22
WAN0 Status: DISCONNECTED
WAN1 Status: CONNECTED
Active ISP: T-Mobile USA, Inc.
Primary WAN: wan1
WAN IPv4 Address: 192.168.12.97
WAN Gateway IP Address: 192.168.12.1
WAN Interface: eth0
DNS Server 1: 8.8.8.8
DNS Server 2: 8.8.4.4
QoS Status: Enabled
QoS Mode: Automatic Settings
----------------------------------------------------------------------------------------
It appears your WAN0 lost connection, possibly physical link between your router and whatever device it's connected to because it also automatically removed IP Rules for that interface (based on the logs).

Code:
Jun  8 13:58:08 wan-failover: Debug - Function: wan0failbackmonitor
Jun  8 13:58:08 wan-failover: WAN0 Failback Monitor - Monitoring wan1 via 8.8.4.4 for Failure
Jun  8 13:58:08 wan-failover: WAN0 Failback Monitor - Monitoring wan0 via 8.8.8.8 for Restoration
Jun  8 13:58:17 wan-failover: Failure Detected - WAN0 Packet Loss: 100%
Jun  8 13:58:17 wan-failover: Debug - WAN0 Target IP Rule Missing or Default Route for 100 is invalid
Jun  8 13:58:17 wan-failover: Debug - Function: setwanstatus
Jun  8 13:58:17 wan-failover: Debug - WAN Status Mode: 2
Jun  8 13:58:17 wan-failover: Debug - ***WAN0 Failback Monitor Loop Ended***
 
It appears your WAN0 lost connection, possibly physical link between your router and whatever device it's connected to because it also automatically removed IP Rules for that interface (based on the logs).

Code:
Jun  8 13:58:08 wan-failover: Debug - Function: wan0failbackmonitor
Jun  8 13:58:08 wan-failover: WAN0 Failback Monitor - Monitoring wan1 via 8.8.4.4 for Failure
Jun  8 13:58:08 wan-failover: WAN0 Failback Monitor - Monitoring wan0 via 8.8.8.8 for Restoration
Jun  8 13:58:17 wan-failover: Failure Detected - WAN0 Packet Loss: 100%
Jun  8 13:58:17 wan-failover: Debug - WAN0 Target IP Rule Missing or Default Route for 100 is invalid
Jun  8 13:58:17 wan-failover: Debug - Function: setwanstatus
Jun  8 13:58:17 wan-failover: Debug - WAN Status Mode: 2
Jun  8 13:58:17 wan-failover: Debug - ***WAN0 Failback Monitor Loop Ended***
Thanks for your prompt response :)

wan0 is connected to a cable modem, which has been down for several days. It's just sitting there constantly trying to reestablish the connection but failing. I see "WAN0 Target IP Rule Missing or Default Route for 100 is invalid" printed nearly every second, but it doesn't send an e-mail every second. I tried unplugging and replugging the Ethernet cable on wan0 to try to generate one of these emails, and it did nothing.

See attached logs from today where the e-mail was sent around 13:12:21
 

Attachments

  • syslog (3).txt
    417 KB · Views: 26
Thanks for your prompt response :)

wan0 is connected to a cable modem, which has been down for several days. It's just sitting there constantly trying to reestablish the connection but failing. I see "WAN0 Target IP Rule Missing or Default Route for 100 is invalid" printed nearly every second, but it doesn't send an e-mail every second. I tried unplugging and replugging the Ethernet cable on wan0 to try to generate one of these emails, and it did nothing.

See attached logs from today where the e-mail was sent around 13:12:21
So here are a couple things to consider given your situation.
- The router won’t email if the statuses are the same as they were when WAN Failover initialized.
- if it does change and an email is sent, it will not send another unless the status changes again.
 
***v2.0.5 has been officially published to prod and beta channels***

v2.0.5 Release Notes:

Fixes:
- Corrected minor issue when retrieving WAN NVRAM Parameters
- Corrected issue if WAN Failover would be stuck in a continuous loop if a router didn't have WAN USB capability.
- Corrected issue that causes WAN Failover to exit in Load Balance mode during failover events.
- Corrected issue where DDNS Hostname being blank would cause the script to hang in a loop while collecting System Settings.
- Corrected issue during install where the existing monitor target value was a domain and being used as the WAN0 Target IP default value.
 
Update from V2.0.5-beta3 to V2.0.5-Final, appears to be working.
 
***v2.0.6-beta1 is available on the beta channel***
Release Notes:
v2.0.6-beta1 - 07/06/2023
Enhancements:
- General Optimization
- WireGuard clients will restart during failover to recreate the default routes in each WireGuard Route Table.

Fixes:
- Minor bugs
 
Updated and all smooth.

Had to exit amtm and re-enter wf for Option 1 to show the current version. It was indicating an update available while the main menu showed current status correctly.
 
Hey there I keep getting this error in my logs and my status is unresponsive

Code:
Jul 18 20:16:01 wan-failover: Failover - ***Error*** Unable to delete default route via ****** dev ppp1
Jul 18 20:16:03 wan-failover: Failover - ***Error*** Unable to delete default route via ****** dev ppp1

Not sure what to do about it.
 
Hey there I keep getting this error in my logs and my status is unresponsive

Code:
Jul 18 20:16:01 wan-failover: Failover - ***Error*** Unable to delete default route via ****** dev ppp1
Jul 18 20:16:03 wan-failover: Failover - ***Error*** Unable to delete default route via ****** dev ppp1

Not sure what to do about it.
It appears it is failing to delete an existing default route, did you try restarting the router?
 
It appears it is failing to delete an existing default route, did you try restarting the router?
Hey,

Yeah i did it seemed to clear itself then, for some reason I just setup email notification and I am getting spammed every few minutes even though the information between the emails in the same except for the time

it looks like this in the system logs

Code:
Jul 20 15:38:26 wan-failover: Failover - Switching wan1 to Primary WAN
Jul 20 15:38:31 wan-failover: Failover - Switched wan1 to Primary WAN
Jul 20 15:40:32 wan-failover: Failover - Switching wan1 to Primary WAN
Jul 20 15:40:38 wan-failover: Failover - Switched wan1 to Primary WAN
Jul 20 15:42:32 wan-failover: Failover - Switching wan1 to Primary WAN
Jul 20 15:42:38 wan-failover: Failover - Switched wan1 to Primary WAN
Jul 20 15:44:28 wan-failover: Failover - Switching wan1 to Primary WAN
Jul 20 15:44:34 wan-failover: Failover - Switched wan1 to Primary WAN

it seems to be sending emails nearly every minute at the moment.

thanks I am running v2.0.6-beta1

EDIT:

It is messing with my internet a bit so I had to kill it and just force WAN1 offline as I can use WAN0 for now while it can get sorted. not sure what is happening though
 
Last edited:
Hey,

Yeah i did it seemed to clear itself then, for some reason I just setup email notification and I am getting spammed every few minutes even though the information between the emails in the same except for the time

it looks like this in the system logs

Code:
Jul 20 15:38:26 wan-failover: Failover - Switching wan1 to Primary WAN
Jul 20 15:38:31 wan-failover: Failover - Switched wan1 to Primary WAN
Jul 20 15:40:32 wan-failover: Failover - Switching wan1 to Primary WAN
Jul 20 15:40:38 wan-failover: Failover - Switched wan1 to Primary WAN
Jul 20 15:42:32 wan-failover: Failover - Switching wan1 to Primary WAN
Jul 20 15:42:38 wan-failover: Failover - Switched wan1 to Primary WAN
Jul 20 15:44:28 wan-failover: Failover - Switching wan1 to Primary WAN
Jul 20 15:44:34 wan-failover: Failover - Switched wan1 to Primary WAN

it seems to be sending emails nearly every minute at the moment.

thanks I am running v2.0.6-beta1

EDIT:

It is messing with my internet a bit so I had to kill it and just force WAN1 offline as I can use WAN0 for now while it can get sorted. not sure what is happening though
What model router is this? Initially it looks like it has some sort of NVRAM issue overwriting values. I would recommend enabling debug logging and collecting logs when it is having these issues.
 
Just dusted off my GT-AX6000 again to try newer versions of the script but unfortunately both 2.0.5 and the 2.0.6-beta1 are still no go for me with the status changing from "Not running" to then an endless loop of "Initializing" and then "Failover monitoring" every several seconds. Not sure if these are the useful logs
 

Attachments

  • Jul 23 111841 wan-failover Debug - .txt
    143.2 KB · Views: 26
Last edited:
Just dusted off my GT-AX6000 again to try newer versions of the script but unfortunately both 2.0.5 and the 2.0.6-beta1 are still no go for me with the status changing from "Not running" to then an endless loop of "Initializing" and then "Failover monitoring" every several seconds. Not sure if these are the useful logs
Review the readme please.

Code:
Jul 23 11:18:42 wan-failover: WAN Status - ASUS Factory Watchdog: Enabled
 
Ranger802004 Thanks for your failover / Fallback script have it up and running on Asus RtAx 86u and its working great and seems to have stabilized my internet connection also. Its a Godsend!
I had to make slight tweaks to the ping count and ping timeout to make it work for me.

My question is about setting up email alerts when a failover or failback occurs. I note the default is enabled in the script configuration page. But how do you actually set up the email credentials email address etc. i’m sorry but i cannot seem to find information on it.
 
Ranger802004 Thanks for your failover / Fallback script have it up and running on Asus RtAx 86u and its working great and seems to have stabilized my internet connection also. Its a Godsend!
I had to make slight tweaks to the ping count and ping timeout to make it work for me.

My question is about setting up email alerts when a failover or failback occurs. I note the default is enabled in the script configuration page. But how do you actually set up the email credentials email address etc. i’m sorry but i cannot seem to find information on it.
It uses amtm email configuration or AIProtection email configuration as a secondary if either or both are configured.
 
Trying to install but getting stuck at "getting systems settings..." I'm using the latest Merlin build 3004.388.4. It keeps trying to determine VPN status (don't have a VPN). Every few seconds repeats the same error.
"Aug 22 05:40:52 wan-failover: Debug - Script Mode: install
Aug 22 05:40:52 wan-failover: Debug - Function: Install
Aug 22 05:40:58 wan-failover: Debug - failed to set OVPNSERVERINSTANCES
Aug 22 05:40:59 wan-failover: Debug - failed to set OVPNSERVERINSTANCES
Aug 22 05:41:00 wan-failover: Debug - failed to set OVPNSERVERINSTANCES"

Edit: I've tried both version 2.05 and the 2.06 beta...same issue when installing.

Any suggestions on how to resolve?
 
Last edited:
Trying to install but getting stuck at "getting systems settings..." I'm using the latest Merlin build 3004.388.4. It keeps trying to determine VPN status (don't have a VPN). Every few seconds repeats the same error.
"Aug 22 05:40:52 wan-failover: Debug - Script Mode: install
Aug 22 05:40:52 wan-failover: Debug - Function: Install
Aug 22 05:40:58 wan-failover: Debug - failed to set OVPNSERVERINSTANCES
Aug 22 05:40:59 wan-failover: Debug - failed to set OVPNSERVERINSTANCES
Aug 22 05:41:00 wan-failover: Debug - failed to set OVPNSERVERINSTANCES"

Edit: I've tried both version 2.05 and the 2.06 beta...same issue when installing.

Any suggestions on how to resolve?
I figured out a workaround. I'm a novice with linux scripts, but appears it expects the vpn_server states to be something other null?
Since I don't have VPN enabled, I added the below two lines at the top of the script and it installs and runs now.

nvram set vpn_server1_state=0
nvram set vpn_server2_state=0
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top