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!

It seems as if the IP Rule or Routes are not being added back on some models after this condition. I will review this tomorrow.
 
Hello Ranger,
I restored my router from factory and tested your script on my AC88U.
Unfortunately it didn't work correctly.
The CPU load was high (between 2) and lot of internet disconnection.
Hope new stable version of script will be available and tested.
 
Code:
ASUSWRT-Merlin RT-AX88U 386.8_0 Sat Aug 13 20:54:16 UTC 2022
admin@XXAX88U:/tmp/home/root# /jffs/scripts/wan-failover.sh update
wan-failover is up to date - Version: v2.0.0-beta6
***Checksum Failed***
Current Checksum: 7f0f22cae20ff65fbefc0d58ea37509194748e135f3a1ad2b57de4f0cb4a8bc6  Valid Checksum: 1b0043d6c11c3aaa693be99d60daf85492f2eba3edab80c7466e8fba606aa695
wan-failover is up to date. Do you want to reinstall wan-failover Version: v2.0.0-beta6? ***Enter Y for Yes or N for No***
> Y
wan-failover: Update - wan-failover has reinstalled version: v2.0.0-beta6
wan-failover: Restart - Restarting wan-failover ***This can take up to approximately 1 minute***
wan-failover: Restart - Killing wan-failover Process ID: 9654
wan-failover: Restart - Killed wan-failover Process ID: 9654
wan-failover: Restart - Killing wan-failover Process ID: 9656
wan-failover: Restart - Killed wan-failover Process ID: 9656
wan-failover: Restart - Killing wan-failover Process ID: 19772
wan-failover: Restart - Killed wan-failover Process ID: 19772
wan-failover: Restart - Killing wan-failover Process ID: 19773
wan-failover: Restart - Killed wan-failover Process ID: 19773
wan-failover: Restart - Waiting for wan-failover to restart from Cron Job
wan-failover: Restart - Successfully Restarted wan-failover Process ID(s): 21111 21116
Successfully Restarted wan-failover Process ID(s): 21111,21116
admin@XXAX88U:/tmp/home/root#

No errors at the end of script this time. Unfortunately I won't be able to test failover and failback until Monday at the earliest.
 
v2.0.0 has been published as an official release, if you are on a beta release you may get a Checksum error when trying to update, this is fine and just allow it to reinstall the script.
 
Code:
ASUSWRT-Merlin RT-AX88U 386.8_0 Sat Aug 13 20:54:16 UTC 2022
admin@XXAX88U:/tmp/home/root# /jffs/scripts/wan-failover.sh update
wan-failover is up to date - Version: v2.0.0-beta6
***Checksum Failed***
Current Checksum: 1b0043d6c11c3aaa693be99d60daf85492f2eba3edab80c7466e8fba606aa695  Valid Checksum: 3825260ca7330a35ca65de43aab9ad60d1e71fbad7f9663061a0b1243b76f1d5
wan-failover is up to date. Do you want to reinstall wan-failover Version: v2.0.0-beta6? ***Enter Y for Yes or N for No***
> Y
wan-failover: Update - wan-failover has reinstalled version: v2.0.0-beta6
wan-failover: Restart - Restarting wan-failover ***This can take up to approximately 1 minute***
wan-failover: Restart - Killing wan-failover Process ID: 8602
wan-failover: Restart - Killed wan-failover Process ID: 8602
wan-failover: Restart - Killing wan-failover Process ID: 8603
wan-failover: Restart - Killed wan-failover Process ID: 8603
wan-failover: Restart - Killing wan-failover Process ID: 21111
wan-failover: Restart - Killed wan-failover Process ID: 21111
wan-failover: Restart - Killing wan-failover Process ID: 21116
wan-failover: Restart - Killed wan-failover Process ID: 21116
wan-failover: Restart - Waiting for wan-failover to restart from Cron Job
wan-failover: Restart - Successfully Restarted wan-failover Process ID(s): 9811 9812
Successfully Restarted wan-failover Process ID(s): 9811,9812
admin@XXAX88U:/tmp/home/root#

Testing TBD.
 
Testing V2.0.0 Final Dual WAN Script in a Dual WAN FailBack mode: (errors in BOLD)

Test01:
- ISP01 goes down, ISP02 takes over in FailOver mode
- ISP01 comes back up, ISP02 continues to be the main WAN, FailBack does NOT work, as Primary WAN stays as Hot-Standby.
- Run the "switchwan" argument with the script, and the FailBack works
 
Last edited:
Testing V2.0.0 Final Dual WAN Script in a Dual WAN FailBack mode: (errors in BOLD)

Test01:
- ISP01 goes down, ISP02 takes over in FailOver mode
- ISP01 comes back up, ISP02 continues to be the main WAN, FailBack does NOT work, as Primary WAN stays as Hot-Standby.
Let me guess. On the status page for wan-failover. The WAN0 packet loss stays at 100%? . And to fix it you need to restart the script?

How did the ISP 1 went down ? Was it the internet that went down but the modem didn't go down? Or was it a full power down where the Asus didn't detect the WAN0 Ethernet?
 
Let me guess. On the status page for wan-failover. The WAN0 packet loss stays at 100%? . And to fix it you need to restart the script?

How did the ISP 1 went down ? Was it the internet that went down but the modem didn't go down? Or was it a full power down where the Asus didn't detect the WAN0 Ethernet?

Full Power OFF of ISP01 modem, wait until FAILOVER occurs, and system logs are complete, and all other addons are working again, then Power ON ISP01 modem to bring it backup, where the ASUS AX88U router shows on the TAB "Network Map | Primary WAN" is in "Hot-Standby", but never changes over until I issue a "/jffs/scripts/wan-failover.sh switchwan" command from SSH.

Just working on getting @Ranger802004 logs from his "/jffs/scripts/wan-failover.sh" script, to submit to him for analysis.
 
Full Power OFF of ISP01 modem, wait until FAILOVER occurs, and system logs are complete, and all other addons are working again, then Power ON ISP01 modem to bring it backup, where the ASUS AX88U router shows on the TAB "Network Map | Primary WAN" is in "Hot-Standby", but never changes over until I issue a "/jffs/scripts/wan-failover.sh switchwan" command from SSH.

Just working on getting @Ranger802004 logs from his "/jffs/scripts/wan-failover.sh" script, to submit to him for analysis.
When it is stuck . Check the status for the script. Is the WAN0 packet loss stuck at 100% or not
 
When it is stuck . Check the status for the script. Is the WAN0 packet loss stuck at 100% or not
Yes, WAN0 packet loss is stuck at 100% via "/jffs/scripts/wan-failover.sh status" script
 
Had to add the following command:

Code:
ip rule add from all iif lo to 8.8.8.8 lookup wan0 priority 100

which once added at SSH command line, it allowed the following ping to occur:

Code:
ping -I eth0 8.8.8.8

which then the FAILOVER occurred.

Once FAILOVER occurred, ran command:

Code:
ip rule del from all iif lo to 8.8.8.8 lookup wan0 priority 100

My notes show that I did not need to run the "ip rule add" and "ip rule del" command back in V1.5.6-beta9
 
Last edited:
Had to add the following command:

Code:
ip rule add from all iif lo to 8.8.8.8 lookup wan0 priority 100

which once added at SSH command line, it allowed the following ping to occur:

Code:
ping -I eth0 8.8.8.8

which then the FAILOVER occurred.

Once FAILOVER occurred, ran command:

Code:
ip rule del from all iif lo to 8.8.8.8 lookup wan0 priority 100

My notes show that I did not need to run the "ip rule add" and "ip rule del" command back in V1.5.6-beta9
Send me debug logs so I can take a look at where the IP rule readd breaks down. That should be an easy fix if I can see where it is sitting in the stuck state.
 
Send me debug logs so I can take a look at where the IP rule readd breaks down. That should be an easy fix if I can see where it is sitting in the stuck state.
In a few hours. If it does change IP and gets stuck. I'll try all of the things like the ping etc. Last before restarting the script I'll try this same command too. Maybe it's the same issue
 
In a few hours. If it does change IP and gets stuck. I'll try all of the things like the ping etc. Last before restarting the script I'll try this same command too. Maybe it's the same issue
Make sure you have debug logging enabled for your router otherwise the debug events won't be logged :)
 
Send me debug logs so I can take a look at where the IP rule readd breaks down. That should be an easy fix if I can see where it is sitting in the stuck state.

Debug Logs sent
 
Had to add the following command:

Code:
ip rule add from all iif lo to 8.8.8.8 lookup wan0 priority 100

which once added at SSH command line, it allowed the following ping to occur:

Code:
ping -I eth0 8.8.8.8

which then the FAILOVER occurred.

Once FAILOVER occurred, ran command:

Code:
ip rule del from all iif lo to 8.8.8.8 lookup wan0 priority 100

My notes show that I did not need to run the "ip rule add" and "ip rule del" command back in V1.5.6-beta9
Interesting, so your script is able to use Ping Method 1 (Specifying Outbound Interface in IP Rule) and then afterwards it can only work with Ping Method 2 (Without Specifying Outbound Interface). I'll have to see how to compensate that in the next release.
 
Last edited:
Hello,

Thanks for this script, it is working great. I am confused how to configure to receive email alerts if there is a WAN failover event or failback. I saw to set it up under the AI Protection alert preferences but nothing more.

Thanks again!
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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