What's new

WANFailover Dual WAN Failover Script

  • 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 worked, testing now


don't know what this means

View attachment 42787

Edit:

Other than that

Tested all kinds of Fail-Overs Manually : Everything works as intended. Now, only real life will tell if anything will break down.

Another wonderful upgrade to an already smooth running script

Nothing really, just a visual glitch is all.
 
YazFi is triggered post Failover already in the service restarts.

Sounds good. I will just have to remember to trigger "sh /jffs/scripts/YazFi check" in my environment.

Tested it again this morning on Failover and Failback since network was quiet and it worked perfectly. Thanks @Ranger802004 for a great script!
 
Sounds good. I will just have to remember to trigger "sh /jffs/scripts/YazFi check" in my environment.

Tested it again this morning on Failover and Failback since network was quiet and it worked perfectly. Thanks @Ranger802004 for a great script!

Is it not being triggered by service restart from WAN Failover or is it perhaps a timing issue?
 
Is it not being triggered by service restart from WAN Failover or is it perhaps a timing issue?
It must be a timing issue. When the network becomes quiet again, I'll give it another try with notice logs on, and with debug logs and capture them to compare. Could be a while as WFH, and family network requirements ramping up.
 
I’ll have to review these tomorrow, give me a synopsis of what is not working?
In one of my locations, I changed the router, but still immediately after switching, often 100% loss is obtained on the main channel. After everything switches (back and forth several times) everything works stably. I can only change the Internet provider wan0 ;)

And I also encountered an interesting glitch, turned off the wan1 modem and instantly there was 100% loss on wan0. and this is clearly not accidental :(
 
Make sure ALL of these requirements are met, especially the last one.

Requirements:
- ASUS Merlin Firmware v386.5.2
- JFFS custom scripts and configs Enabled
- Dual WAN Enabled
- Dual WAN to be in Failover Mode
- ASUS Factory Failover Disabled (Network Monitoring Options, Allow Failback Option under WAN > Dual WAN)
@Ranger802004 ... I'm confused with this item: "Asus Factory Failover Disabled". With mine, I can either select "Fail over" or "Load Balance"... I can't disable it. Would I need to set it to "Load Balance" in this case? Also, DNS/Ping query need to be disabled as well, right?
 
In one of my locations, I changed the router, but still immediately after switching, often 100% loss is obtained on the main channel. After everything switches (back and forth several times) everything works stably. I can only change the Internet provider wan0 ;)

And I also encountered an interesting glitch, turned off the wan1 modem and instantly there was 100% loss on wan0. and this is clearly not accidental :(
In all of your scenarios where you are experiencing issues, please gather the output of these commands and send them to me.
Code:
ip rule list
ip route show default table 100
ip route show default table 200
 
@Ranger802004 ... I'm confused with this item: "Asus Factory Failover Disabled". With mine, I can either select "Fail over" or "Load Balance"... I can't disable it. Would I need to set it to "Load Balance" in this case? Also, DNS/Ping query need to be disabled as well, right?
it is the Network Monitoring Options under Dual WAN page, just make sure they are unchecked.
 
v1.5.6-beta1 Release: ***Disclaimer: This is a beta release and has been untested***

Manually upgrade to this beta by running the following command" ***Allow for cronjob to relaunch the script***
Code:
/usr/sbin/curl -s "https://raw.githubusercontent.com/Ranger802004/asusmerlin/main/wan-failover_v1.5.6-beta1.sh" -o "/jffs/scripts/wan-failover.sh" && chmod 755 /jffs/scripts/wan-failover.sh && sh /jffs/scripts/wan-failover.sh restart

To revert back to Production Release:
Code:
/jffs/scripts/wan-failover.sh update

***WARNING: IPv6 issues may occur from new service restart logic during failover, please test and provide debug logging data if you experience issues***

Release Notes:
v1.5.6-beta1
- Added a confirmation prompt to Restart Mode.
- Fixed visual bugs when running Restart Mode.
- Load Balance Monitor now triggers Service Restart function during failover events.
- IPv6 services are restarted for Failover events.
- YazFi trigger during service restart will no longer run process in the background to prevent issues with script execution of YazFi.
 
it is the Network Monitoring Options under Dual WAN page, just make sure they are unchecked.
Sorry... I don't see a way to disable failover... are these settings right to use before I run your script?

1657997019907.png
 
v1.5.6-beta1 Release: ***Disclaimer: This is a beta release and has been untested***

Manually upgrade to this beta by running the following command" ***Allow for cronjob to relaunch the script***
Code:
/usr/sbin/curl -s "https://raw.githubusercontent.com/Ranger802004/asusmerlin/main/wan-failover_v1.5.6-beta1.sh" -o "/jffs/scripts/wan-failover.sh" && chmod 755 /jffs/scripts/wan-failover.sh && sh /jffs/scripts/wan-failover.sh restart

To revert back to Production Release:
Code:
/jffs/scripts/wan-failover.sh update

***WARNING: IPv6 issues may occur from new service restart logic during failover, please test and provide debug logging data if you experience issues***

Release Notes:
v1.5.6-beta1
- Added a confirmation prompt to Restart Mode.
- Fixed visual bugs when running Restart Mode.
- Load Balance Monitor now triggers Service Restart function during failover events.
- IPv6 services are restarted for Failover events.
- YazFi trigger during service restart will no longer run process in the background to prevent issues with script execution of YazFi.
With a configured 6in4 tunnel, switching to ipv6 takes 9 seconds, previously it was 9-11 minutes. Great job, I'm delighted. Thank you for your work.
 
Here's another one. Today I restarted the router, the script tried to start for 10 minutes. Moreover, there are definitely no problems with the Internet, because after it gets into working mode there are no errors at all, the connection is super ping up to 1.1.1.1 10ms, there is no lags on the line, speed 1gb


The router used to be ax86u, now tuf is ax5400. I understand that the problem is exactly in the provider. But apart from the script, everything works perfectly
I have another router with the same provider, but with a static IP, everything is OK. Another router with a different provider (but also with a static ip) also everything is ok.

It is used everywhere as a backup line GL.int GL-MT300N V2 with USB 4G stick
 

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