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!

So far so good, there are still CPU usage spikes (definitely larger than in version 1.6), but so far there is no problem with switching WAN
Are you seeing any debug log failures or do you have NVRAM Checks enabled? This will generate more CPU Usage and depending on your router model it may not be necessary.
 
Are you seeing any debug log failures or do you have NVRAM Checks enabled? This will generate more CPU Usage and depending on your router model it may not be necessary.
Nothing suspicious can be seen in the logs, I have turned off NVRAM checks and I am not sure if CPU usage spikes have decreased, but on the other hand, there have been no unexpected WAN switches so far and there are no 100% lost pings in the status.
 
Nothing suspicious can be seen in the logs, I have turned off NVRAM checks and I am not sure if CPU usage spikes have decreased, but on the other hand, there have been no unexpected WAN switches so far and there are no 100% lost pings in the status.
What model router do you have? The AC86U / GT-AC2900 are highly prone to have stuck commands from NVRAM calls getting halted so this is why that feature exists.
 
AX58U installed Diversion, Skynet an AI Protection runing.
Gotcha, as far as I'm aware this router isn't prone to the stuck commands problem but if you experience the script locking up you may want to re-enable this feature.
 
What would be the purpose of nvram check? This is probably a dumb question but would what features can be left disabled (like a lite version) within the script that would minimize any CPU spikes? Last time I used it, I did noticed slows downs when trying to surf the web. Thanks.
 
What would be the purpose of nvram check? This is probably a dumb question but would what features can be left disabled (like a lite version) within the script that would minimize any CPU spikes? Last time I used it, I did noticed slows downs when trying to surf the web. Thanks.
It is intended to prevent what this entire thread was discussing: https://www.snbforums.com/threads/stuck-commands.71870/
 
Awesome job on the script!!! Trying the script now; the official release kept throwing these error:

Code:
Mar 22 10:53:00 wan-failover: Debug - failed to set WAN1GWIFNAME
Mar 22 10:53:00 wan-failover: Debug - failed to set WAN1GWIFNAME

I'm trying latest beta (2.0.1_beta4) currently and I'm no longer seeing the error above. While updating to the latest beta I did get the error message (last line) below:
Code:
admim@GT-AX11000-xxxx:/tmp/home/root# /jffs/scripts/wan-failover.sh update
***Dev Mode is Enabled***
wan-failover is out of date - Current Version: v2.0.0 Available Version: v2.0.1-beta4
Do you want to update to the latest beta version? v2.0.1-beta4 ***Enter Y for Yes or N for No***
> Y
wan-failover: Update - wan-failover has been updated to version: v2.0.1-beta4
wan-failover: Restart - Restarting wan-failover ***This can take up to approximately 1 minute***
wan-failover: Restart - Killing wan-failover Process ID: 17039
wan-failover: Restart - Killed wan-failover Process ID: 17039
wan-failover: Restart - Killing wan-failover Process ID: 8867335
kill: can't kill pid 8867335: No such process
wan-failover: Restart - ***Error*** Unable to kill wan-failover Process ID: 8867335
wan-failover: Restart - Killing wan-failover Process ID: 17040
wan-failover: Restart - Killed wan-failover Process ID: 17040
Cannot find device ""
wan-failover: Restart - Waiting for wan-failover to restart from Cron Job
wan-failover: Restart - Successfully Restarted wan-failover Process ID(s): 03867 8867335 03868 8867335
Successfully Restarted wan-failover Process ID(s): 03867,8867335,03868,8867335
/jffs/scripts/wan-failover.sh: line 6072: syntax error: unterminated quoted string

So far so good, no errors to report.
Code:
Mar 22 11:00:03 wan-failover: Debug - Log Level: 7
Mar 22 11:00:03 wan-failover: System Check - Process ID: 7448
Mar 22 11:00:03 wan-failover: System Check - Version: v2.0.1-beta4
Mar 22 11:00:03 wan-failover: System Check - Checksum: 663c9bbe627f0adbc262fa247cccdf5c9f77aa206767f327b09cf9bacdf998d8
Mar 22 11:00:03 wan-failover: Debug - Firmware: 388.1
Mar 22 11:00:03 wan-failover: System Check - IP Version: 5.11.0
Mar 22 11:00:03 wan-failover: Debug - JFFS custom scripts and configs: 1
Mar 22 11:00:03 wan-failover: Debug - Checking Alias in /jffs/configs/profile.add
Mar 22 11:00:03 wan-failover: Debug - Checking for Configuration File: /jffs/configs/wan-failover.conf
Mar 22 11:00:03 wan-failover: Debug - Function: update
Mar 22 11:00:03 wan-failover: wan-failover is up to date - Version: v2.0.1-beta4
Mar 22 11:00:03 wan-failover: Debug - Function: cleanup
Mar 22 11:00:03 wan-failover: Debug - Setting parameters for wan0
Mar 22 11:00:03 wan-failover: Debug - Checking wan0 for IP Rule to 8.8.8.8
Mar 22 11:00:03 wan-failover: Debug - Checking wan0 for Default Route in 100
Mar 22 11:00:03 wan-failover: Debug - Setting parameters for wan1
Mar 22 11:00:03 wan-failover: Debug - Checking wan1 for IP Rule to 8.8.4.4
Mar 22 11:00:03 wan-failover: Debug - Checking wan1 for Default Route in 200
Mar 22 11:00:03 wan-failover: Debug - Checking for Lock File: /var/lock/wan-failover.lock
Mar 22 11:00:03 wan-failover: Cleanup - Deleting /var/lock/wan-failover.lock
Mar 22 11:00:03 wan-failover: Cleanup - Deleted /var/lock/wan-failover.lock
Mar 22 11:00:03 wan-failover: Debug - Checking for /tmp/wan0packetloss.tmp
Mar 22 11:00:03 wan-failover: Debug - Checking for /tmp/wan1packetloss.tmp

For those running Fail-over mode, on the secondary ISP, are you guys disabling the NAT option or what's the recommended option (enabled by default)?
 

Attachments

  • Screenshot (41).png
    Screenshot (41).png
    38.3 KB · Views: 43
Last edited:
Awesome job on the script!!! Trying the script now; the official release kept throwing these error:

Code:
Mar 22 10:53:00 wan-failover: Debug - failed to set WAN1GWIFNAME
Mar 22 10:53:00 wan-failover: Debug - failed to set WAN1GWIFNAME

I'm trying latest beta (2.0.1_beta4) currently and I'm no longer seeing the error above. While updating to the latest beta I did get the error message (last line) below:
Code:
admim@GT-AX11000-xxxx:/tmp/home/root# /jffs/scripts/wan-failover.sh update
***Dev Mode is Enabled***
wan-failover is out of date - Current Version: v2.0.0 Available Version: v2.0.1-beta4
Do you want to update to the latest beta version? v2.0.1-beta4 ***Enter Y for Yes or N for No***
> Y
wan-failover: Update - wan-failover has been updated to version: v2.0.1-beta4
wan-failover: Restart - Restarting wan-failover ***This can take up to approximately 1 minute***
wan-failover: Restart - Killing wan-failover Process ID: 17039
wan-failover: Restart - Killed wan-failover Process ID: 17039
wan-failover: Restart - Killing wan-failover Process ID: 8867335
kill: can't kill pid 8867335: No such process
wan-failover: Restart - ***Error*** Unable to kill wan-failover Process ID: 8867335
wan-failover: Restart - Killing wan-failover Process ID: 17040
wan-failover: Restart - Killed wan-failover Process ID: 17040
Cannot find device ""
wan-failover: Restart - Waiting for wan-failover to restart from Cron Job
wan-failover: Restart - Successfully Restarted wan-failover Process ID(s): 03867 8867335 03868 8867335
Successfully Restarted wan-failover Process ID(s): 03867,8867335,03868,8867335
/jffs/scripts/wan-failover.sh: line 6072: syntax error: unterminated quoted string

So far so good, no errors to report.
Code:
Mar 22 11:00:03 wan-failover: Debug - Log Level: 7
Mar 22 11:00:03 wan-failover: System Check - Process ID: 7448
Mar 22 11:00:03 wan-failover: System Check - Version: v2.0.1-beta4
Mar 22 11:00:03 wan-failover: System Check - Checksum: 663c9bbe627f0adbc262fa247cccdf5c9f77aa206767f327b09cf9bacdf998d8
Mar 22 11:00:03 wan-failover: Debug - Firmware: 388.1
Mar 22 11:00:03 wan-failover: System Check - IP Version: 5.11.0
Mar 22 11:00:03 wan-failover: Debug - JFFS custom scripts and configs: 1
Mar 22 11:00:03 wan-failover: Debug - Checking Alias in /jffs/configs/profile.add
Mar 22 11:00:03 wan-failover: Debug - Checking for Configuration File: /jffs/configs/wan-failover.conf
Mar 22 11:00:03 wan-failover: Debug - Function: update
Mar 22 11:00:03 wan-failover: wan-failover is up to date - Version: v2.0.1-beta4
Mar 22 11:00:03 wan-failover: Debug - Function: cleanup
Mar 22 11:00:03 wan-failover: Debug - Setting parameters for wan0
Mar 22 11:00:03 wan-failover: Debug - Checking wan0 for IP Rule to 8.8.8.8
Mar 22 11:00:03 wan-failover: Debug - Checking wan0 for Default Route in 100
Mar 22 11:00:03 wan-failover: Debug - Setting parameters for wan1
Mar 22 11:00:03 wan-failover: Debug - Checking wan1 for IP Rule to 8.8.4.4
Mar 22 11:00:03 wan-failover: Debug - Checking wan1 for Default Route in 200
Mar 22 11:00:03 wan-failover: Debug - Checking for Lock File: /var/lock/wan-failover.lock
Mar 22 11:00:03 wan-failover: Cleanup - Deleting /var/lock/wan-failover.lock
Mar 22 11:00:03 wan-failover: Cleanup - Deleted /var/lock/wan-failover.lock
Mar 22 11:00:03 wan-failover: Debug - Checking for /tmp/wan0packetloss.tmp
Mar 22 11:00:03 wan-failover: Debug - Checking for /tmp/wan1packetloss.tmp

For those running Fail-over mode, on the secondary ISP, are you guys disabling the NAT option or what's the recommended option (enabled by default)?
That is based on how your WAN1 is set up, if you are performing NAT for traffic going over WAN1 then you would need to enable it.
 
That is based on how your WAN1 is set up, if you are performing NAT for traffic going over WAN1 then you would need to enable it.
Thank you...made a small contribution. I appreciate everything!
 
@Ranger802004,

Earlier this evening, I found a bug in the wan-failover.sh script ("v2.0.0" version) while helping a friend with some setup issues on his ASUS router.

Bug in line #3974:
Bash:
nvram set "$wan1"_state_t="2"
FIX:
Bash:
nvram set "$WAN1"_state_t="2"
The same bug exists in the most recent "v2.0.1-beta5" version, line #4069.

FYI.
 
@Ranger802004,

Earlier this evening, I found a bug in the wan-failover.sh script ("v2.0.0" version) while helping a friend with some setup issues on his ASUS router.

Bug in line #3974:
Bash:
nvram set "$wan1"_state_t="2"
FIX:
Bash:
nvram set "$WAN1"_state_t="2"
The same bug exists in the most recent "v2.0.1-beta5" version, line #4069.

FYI.
Will resolve ASAP.

EDIT:
Published a minor fix to v2.0.1-beta5 for this change, if you're already running this version you'll get a checksum failure when checking for updates, allow WAN Failover to perform a repair update.
 
Last edited:
Are you seeing any debug log failures or do you have NVRAM Checks enabled? This will generate more CPU Usage and depending on your router model it may not be necessary.
I enabled NVRAM checks just to test it (running latest 2.0.1-beta5). I am noticing the detection notification msg below:

Code:
Mar 23 18:20:30 wan-failover: NVRAM Check - ***NVRAM Check Failure Detected***

The script is working flawlessly! :)
 
Last edited:
I enabled NVRAM checks just to test it (running latest 2.0.1-beta5). I am noticing the detection notification msg below:

Code:
Mar 23 18:20:30 wan-failover: NVRAM Check - ***NVRAM Check Failure Detected***

The script is working flawlessly! :)
That means it caught a stuck PID from an nvram call and killed it so it did what it was suppose to do.
 
That means it caught a stuck PID from an nvram call and killed it so it did what it was suppose to do.
Thanks for the explanation.

What would happen if the stuck PIDs are not killed/terminated? Would these eventually slowed down the router (memory gets full) or cause a reset/lag issues?

And this whole time I always assumed this issued was only specific to other routers.
 
Thanks for the explanation.

What would happen if the stuck PIDs are not killed/terminated? Would these eventually slowed down the router (memory gets full) or cause a reset/lag issues?

And this whole time I always assumed this issued was only specific to other routers.
They could cause the script to be halted from the stuck PID as seen mostly on the RT-AC86U / GT-AC2900.
 
Hi, is there any configuration guides ? I'm just a regular non-tech user trying to keep his connection alive using dual wan failover for my Asus RT-AC68U, 1 PPPoE connection and 1 4G modem, both with ethernet and DHCP dynamic IP.

Just flashed my firmware with asuswrt-merlin successfully

SSH into the router with key and also installing entware currently on a usb-stick

edit
finally able to install and I think the cron job is running

reading the readme in https://raw.githubusercontent.com/Ranger802004/asusmerlin/main/wan-failover-readme.txt too

Is there any best practice to recommend?

this is my current status window, I don't really get why it says unresponsive


wan status.png



Code:
Do you want to install WAN Failover? ***Enter Y for Yes or N for No***
> Invalid Selection!!! ***Enter Y for Yes or N for No***
Do you want to install WAN Failover? ***Enter Y for Yes or N for No***
> y
Getting System Settings...
Successfully acquired System Settings
Getting WAN Parameters...
Successfully acquired WAN Parameters
/jffs/configs/wan-failover.conf already exists...
wan-event script already exists...
wan-failover already added to wan-event...
/jffs/configs/profile.add already exists...
Creating Cron Job...
Created Cron Job
Dual WAN is Enabled.
Factory WAN Failover Disabled.
Administration > System > Enable JFFS custom scripts and configs is enabled...
 
Last edited:
if I want to view the status in realtime updates, do I open the monitor?
 

Attachments

  • wan monitor.png
    wan monitor.png
    19.7 KB · Views: 41

Similar threads

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