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!

Wow... Fast ... Anyways what should it do?
It should remove down WAN links from the load balancing and then bring them back whenever a connection is restored.
 
You know that eventually you are going to need a catchy name for your script like all the other ones out there. :)

Diversion
Skynet
Flex-QoS

WAN-Ranger
DWR ( Dual WAN Ranger)
 
Hi,
In my case it stopped working.
I changed the connection from static + USB dongle to PPPoE + USB dongle.

Now I have:

Bash:
/jffs/scripts/wan-failover.sh manual
wan-failover.sh - Manual Mode
RTNETLINK answers: Network is unreachable


I tried with v1.4.3, v1.4.6.

My wan-failover.conf:
Bash:
WAN0TARGET=1.1.1.1
WAN1TARGET=1.1.1.1
PINGCOUNT=7
PINGTIMEOUT=3
WANDISABLEDSLEEPTIMER=10
WAN0_QOS_IBW=
WAN1_QOS_IBW=
WAN0_QOS_OBW=
WAN1_QOS_OBW=
WAN0_QOS_OVERHEAD=
WAN1_QOS_OVERHEAD=
WAN0_QOS_ATM=
WAN1_QOS_ATM=

Could you please help?
Thank you in advance,
amplatfus
 
Hi,
In my case it stopped working.
I changed the connection from static + USB dongle to PPPoE + USB dongle.

Now I have:

Bash:
/jffs/scripts/wan-failover.sh manual
wan-failover.sh - Manual Mode
RTNETLINK answers: Network is unreachable


I tried with v1.4.3, v1.4.6.

My wan-failover.conf:
Bash:
WAN0TARGET=1.1.1.1
WAN1TARGET=1.1.1.1
PINGCOUNT=7
PINGTIMEOUT=3
WANDISABLEDSLEEPTIMER=10
WAN0_QOS_IBW=
WAN1_QOS_IBW=
WAN0_QOS_OBW=
WAN1_QOS_OBW=
WAN0_QOS_OVERHEAD=
WAN1_QOS_OVERHEAD=
WAN0_QOS_ATM=
WAN1_QOS_ATM=

Could you please help?
Thank you in advance,
ampla

I think the recommended config would be similar to:

WAN0TARGET=1.1.1.1
WAN1TARGET=1.0.0.1
PINGCOUNT=3
PINGTIMEOUT=1
WANDISABLEDSLEEPTIMER=10


Using the same monitoring IP for both WAN interfaces will not work due to static routes created by the script.
 
Thank you for reply.
Besire the error posted, it seems that is still working when I unplug PPPoE it switches to Secondary WAN.
I hope that it will work also when ping will go down.

BR,
amplatfus
 
Hi,
In my case it stopped working.
I changed the connection from static + USB dongle to PPPoE + USB dongle.

Now I have:

Bash:
/jffs/scripts/wan-failover.sh manual
wan-failover.sh - Manual Mode
RTNETLINK answers: Network is unreachable


I tried with v1.4.3, v1.4.6.

My wan-failover.conf:
Bash:
WAN0TARGET=1.1.1.1
WAN1TARGET=1.1.1.1
PINGCOUNT=7
PINGTIMEOUT=3
WANDISABLEDSLEEPTIMER=10
WAN0_QOS_IBW=
WAN1_QOS_IBW=
WAN0_QOS_OBW=
WAN1_QOS_OBW=
WAN0_QOS_OVERHEAD=
WAN1_QOS_OVERHEAD=
WAN0_QOS_ATM=
WAN1_QOS_ATM=

Could you please help?
Thank you in advance,
amplatfus
Smokey already gave you the correct advice. Targets need to be different and the readme also points this out.
 
Smokey already gave you the correct advice. Targets need to be different and the readme also points this out.
Thank you. I did like you suggested me.

It seem that it was still working with my config too, but the message while executing the script in manual mode (even after killing it) is OK?
I am still seeing it with suggested config. Please, is OK?
RTNETLINK answers: Network is unreachable

BR,
amplatfus
 
Thank you. I did like you suggested me.

It seem that it was still working with my config too, but the message while executing the script in manual mode (even after killing it) is OK?
I am still seeing it with suggested config. Please, is OK?
RTNETLINK answers: Network is unreachable

BR,
amplatfus
It’s an error coming from the routing table, after you set the targets different make sure you run the kill command to kill all existing instances and let it kick back off from the cron job.
 
You know that eventually you are going to need a catchy name for your script like all the other ones out there. :)

Diversion
Skynet
Flex-QoS

WAN-Ranger
DWR ( Dual WAN Ranger)
Lol maybe one day
 
If I want to switch over to a load balancing setup, will the new beta script run okay on my ax86u or is it for the ac86u?
 
If I want to switch over to a load balancing setup, will the new beta script run okay on my ax86u or is it for the ac86u?
If you install 1.4.8-beta, just switch your router to load balancing and let the script run, no configuration change necessary for the script. It should run on both.

Make sure you guys are renaming the beta script names to “wan-failover.sh” replacing the production version.

EDIT: I need feedback on Load Balancing Failover so I can make necessary changes and update documentation.
 
Last edited:
Hi,
Please, in low balance how it suppose to work?
10x,
amplatfus
 
Executing this command, show the whole script in terminal, before the install prompt shows up:

Code:
/usr/sbin/curl -s "https://raw.githubusercontent.com/Ranger802004/asusmerlin/main/wan-failover_v1.4.8-beta.sh" && chmod 755 /jffs/scripts/wan-failover.sh && sh /jffs/scripts/wan-failover.sh install
 
Executing this command, show the whole script in terminal, before the install prompt shows up:

Code:
/usr/sbin/curl -s "https://raw.githubusercontent.com/Ranger802004/asusmerlin/main/wan-failover_v1.4.8-beta.sh" && chmod 755 /jffs/scripts/wan-failover.sh && sh /jffs/scripts/wan-failover.sh install

You shouldn’t have to use install command to swap to a beta, just add kill parameter instead of install.
 
Hi,
Please, in low balance how it suppose to work?
10x,
amplatfus

It will monitor both WAN interfaces for failure and remove them from the load balancing while they are down and add them when they are back online.
 
Hi,

When I discovered this script I had Static IP + USB dongle.
Now I swicthed to PPPoE + USB dongle.

After fresh instal (v1.4.6) with config sugested by you it works only if Primary WAN is down.
Code:
WAN0TARGET=1.1.1.1
WAN1TARGET=1.0.0.1
PINGCOUNT=3
PINGTIMEOUT=1
WANDISABLEDSLEEPTIMER=10
After Primary WAN is back UP, the connection remains on Secondary.

It switch to Primary only if I check the Allow failback bock on Asus Dual WAN tab.
I am wondering what it could be the fix. Please share if you have any idea why.

Thanks in advance,
amplatfus
 
Hi,

When I discovered this script I had Static IP + USB dongle.
Now I swicthed to PPPoE + USB dongle.

After fresh instal (v1.4.6) with config sugested by you it works only if Primary WAN is down.
Code:
WAN0TARGET=1.1.1.1
WAN1TARGET=1.0.0.1
PINGCOUNT=3
PINGTIMEOUT=1
WANDISABLEDSLEEPTIMER=10
After Primary WAN is back UP, the connection remains on Secondary.

It switch to Primary only if I check the Allow failback bock on Asus Dual WAN tab.
I am wondering what it could be the fix. Please share if you have any idea why.

Thanks in advance,
amplatfus

Grab the logs from monitor mode and let me take a look.
 
The problem that seems to be with load balancing is that the sessions don't stick to a client.
I didn’t observe that behavior so, it worked as expected where sessions stuck with the same route. I had mine with a 9:1 ratio, most of my connections were going out my Primary WAN and some were going out my Secondary WAN.
 
Last edited:
Grab the logs from monitor mode and let me take a look.

Thank you.
Because I have moved the logs via syslog-ng, I guess monitoring have this output:
Bash:
/tmp/home/root#:/jffs/scripts/wan-failover.sh monitor
wan-failover.sh - Monitor Mode
tail: /tmp/syslog.log has been replaced; following end of new file
tail: /tmp/syslog.log has been replaced; following end of new file

I monitored my messages log for wan-failover.sh while being in monitor mode:

Code:
Jun 19 19:25:42 src@B88X wan-failover.sh: WAN Status - wan1 enabled
Jun 19 19:25:42 src@B88X wan-failover.sh: WAN Status - Route already exists for 1.0.0.1 via 192.168.7.1 dev eth8
Jun 19 19:25:44 src@B88X wan-failover.sh: WAN Status - wan1 has 0% packet loss
Jun 19 19:25:44 src@B88X wan-failover.sh: WAN1 Active - Verifying WAN1
Jun 19 19:25:44 src@B88X wan-failover.sh: WAN0 Failback Monitor - Monitoring WAN0 via 1.1.1.1 for Failback
Jun 19 19:25:44 src@B88X wan-failover.sh: WAN Status - wan0 enabled
Jun 19 19:25:44 src@B88X wan-failover.sh: WAN Status - wan0 is disconnected.  IP Address: 0.0.0.0 Gateway: 0.0.0.0
Jun 19 19:25:44 src@B88X wan-failover.sh: WAN Status - wan1 enabled
Jun 19 19:25:44 src@B88X wan-failover.sh: WAN Status - Route already exists for 1.0.0.1 via 192.168.7.1 dev eth8
Jun 19 19:25:46 src@B88X wan-failover.sh: WAN Status - wan1 has 0% packet loss
Jun 19 19:25:46 src@B88X wan-failover.sh: WAN1 Active - Verifying WAN1
Jun 19 19:25:46 src@B88X wan-failover.sh: WAN0 Failback Monitor - Monitoring WAN0 via 1.1.1.1 for Failback
Jun 19 19:25:46 src@B88X wan-failover.sh: WAN Status - wan0 enabled
Jun 19 19:25:46 src@B88X wan-failover.sh: WAN Status - Creating route 1.1.1.1 via 10.0.0.1 dev eth0
Jun 19 19:26:00 src@B88X wan-failover.sh: WAN Status - wan0 enabled
Jun 19 19:26:01 src@B88X wan-failover.sh: WAN Status - Creating route 1.1.1.1 via 10.0.0.1 dev eth0
Jun 19 19:27:00 src@B88X wan-failover.sh: WAN Status - wan0 enabled
Jun 19 19:27:00 src@B88X wan-failover.sh: WAN Status - Creating route 1.1.1.1 via 10.0.0.1 dev eth0

PS: wan0 = PPPoE, wan1 = USB Dongle
During this time:
wan0 remains stucked in Hot-Standby with public IP stored in wan0_ipaddr and wan_ipaddr.
wan1 connected with IP stored in wan1_ipaddr

Later edit:

Please find some nvram values:
Code:
wan_ifnames=eth0 usb
wan1_ifname=eth8
wan0_ifname=eth0

Thank you!
 
Last edited:

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