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!

appreciate very much the time you have put into it.
No problem, I appreciate the great feedback provided by you and everyone else as well as providing the data needed to make these valuable updates. I'd say we're at a good point now.
 
Please help, are these the correct settings before installing the script?
 

Attachments

  • Screenshot_20220605-081554_Chrome.jpg
    Screenshot_20220605-081554_Chrome.jpg
    37.5 KB · Views: 79
The script does not switch to WAN1 if WAN0 is down, in my case:
Code:
Jun  5 09:49:00 wan-failover.sh: WAN Status - wan0 enabled
Jun  5 09:49:00 wan-failover.sh: WAN Status - Creating route 8.8.8.8 via 88.116.xxx.xx dev eth0
Jun  5 09:50:00 wan-failover.sh: WAN Status - wan0 enabled
Jun  5 09:50:00 wan-failover.sh: WAN Status - Creating route 8.8.8.8 via 88.116.xxx.xx dev eth0
Jun  5 09:50:09 pppd[433]: No response to 10 echo-requests
Jun  5 09:50:09 pppd[433]: Serial link appears to be disconnected.
Jun  5 09:50:09 pppd[433]: Connect time 89.4 minutes.
Jun  5 09:50:09 pppd[433]: Sent 37070888 bytes, received 2044867554 bytes.
Jun  5 09:50:09 lldpd[2019]: removal request for address of 88.116.xxx.xx%25, but no knowledge of it
Jun  5 09:50:09 wsdd2[1141]: error: wsdd-mcast-v4: wsd_send_soap_msg: send
Jun  5 09:50:09 custom_script: Running /jffs/scripts/wan-event (args: 0 disconnected)
Jun  5 09:50:09 custom_script: Running /jffs/scripts/wan-event (args: 0 stopped)
Jun  5 09:50:15 pppd[433]: Connection terminated.
Jun  5 09:50:15 pppd[433]: Sent PADT
Jun  5 09:50:15 pppd[433]: Modem hangup
Jun  5 09:51:00 wan-failover.sh: WAN Status - wan0 enabled
Jun  5 09:51:00 wan-failover.sh: WAN Status - Creating route 8.8.8.8 via 88.116.xxx.xx dev eth0
Jun  5 09:51:00 pppd[433]: Timeout waiting for PADO packets
Jun  5 09:51:30 pppd[433]: Timeout waiting for PADO packets
Jun  5 09:52:00 pppd[433]: Timeout waiting for PADO packets
Jun  5 09:52:30 pppd[433]: Timeout waiting for PADO packets
Any suggestions? Please?
 
The script does not switch to WAN1 if WAN0 is down, in my case:
Code:
Jun  5 09:49:00 wan-failover.sh: WAN Status - wan0 enabled
Jun  5 09:49:00 wan-failover.sh: WAN Status - Creating route 8.8.8.8 via 88.116.xxx.xx dev eth0
Jun  5 09:50:00 wan-failover.sh: WAN Status - wan0 enabled
Jun  5 09:50:00 wan-failover.sh: WAN Status - Creating route 8.8.8.8 via 88.116.xxx.xx dev eth0
Jun  5 09:50:09 pppd[433]: No response to 10 echo-requests
Jun  5 09:50:09 pppd[433]: Serial link appears to be disconnected.
Jun  5 09:50:09 pppd[433]: Connect time 89.4 minutes.
Jun  5 09:50:09 pppd[433]: Sent 37070888 bytes, received 2044867554 bytes.
Jun  5 09:50:09 lldpd[2019]: removal request for address of 88.116.xxx.xx%25, but no knowledge of it
Jun  5 09:50:09 wsdd2[1141]: error: wsdd-mcast-v4: wsd_send_soap_msg: send
Jun  5 09:50:09 custom_script: Running /jffs/scripts/wan-event (args: 0 disconnected)
Jun  5 09:50:09 custom_script: Running /jffs/scripts/wan-event (args: 0 stopped)
Jun  5 09:50:15 pppd[433]: Connection terminated.
Jun  5 09:50:15 pppd[433]: Sent PADT
Jun  5 09:50:15 pppd[433]: Modem hangup
Jun  5 09:51:00 wan-failover.sh: WAN Status - wan0 enabled
Jun  5 09:51:00 wan-failover.sh: WAN Status - Creating route 8.8.8.8 via 88.116.xxx.xx dev eth0
Jun  5 09:51:00 pppd[433]: Timeout waiting for PADO packets
Jun  5 09:51:30 pppd[433]: Timeout waiting for PADO packets
Jun  5 09:52:00 pppd[433]: Timeout waiting for PADO packets
Jun  5 09:52:30 pppd[433]: Timeout waiting for PADO packets
Any suggestions? Please?

Looks like it is not able to create the routes needed and is getting stuck there.
 
@Ranger802004 just a little update. Its been storming on and off all day here. Starlink will lose signal if its hard. The script swapped back and forth flawlessly. The wife was streaming and never missed a beat with 20 switchovers in 40 minutes.
 
No, I haven't tried the beta.
Is this the latest beta? https://raw.githubusercontent.com/Ranger802004/asusmerlin/main/wan-failover_v1.4.6-beta.sh

And would this be the correct terminal install command?
Code:
/usr/sbin/curl -s "https://raw.githubusercontent.com/Ranger802004/asusmerlin/main/wan-failover_v1.4.6-beta.sh" -o "/jffs/scripts/wan-failover.sh" && chmod 755 /jffs/scripts/wan-failover.sh && sh /jffs/scripts/wan-failover.sh install

That would work but I am going to publish 1.4.6 as an official update this evening so you can just use the standard command line afterwards.
 
@Ranger802004 just a little update. Its been storming on and off all day here. Starlink will lose signal if its hard. The script swapped back and forth flawlessly. The wife was streaming and never missed a beat with 20 switchovers in 40 minutes.
Glad to hear :)
 
v1.4.6 has been published.

v1.4.6
- Fixed issue where if Gateway IP Address changed, script would not return to WAN Status to check if route is created for the monitoring target.
- Created an enable / disable function for email (Instructions added to Configuration of Readme).
- Optimized logic for handling no arguments being inputted from the console.
- Configuration options will not allow WAN0 and WAN1 Target IP Addresses to be the same or match their respective Gateway IP Address.
 
What's a typical value for this setting?
- WAN Disabled Timer: This is how many seconds the script pauses and checks again if Dual WAN, Failover Mode, or WAN links are disabled/disconnected.
 
v1.4.6 has been published.

v1.4.6
- Fixed issue where if Gateway IP Address changed, script would not return to WAN Status to check if route is created for the monitoring target.
- Created an enable / disable function for email (Instructions added to Configuration of Readme).
- Optimized logic for handling no arguments being inputted from the console.
- Configuration options will not allow WAN0 and WAN1 Target IP Addresses to be the same or match their respective Gateway IP Address.
I know google took away "allow less secure apps" june 1st.Emaill doesnt seem to work for me now. Do you know if thats why?
 
I know google took away "allow less secure apps" june 1st.Emaill doesnt seem to work for me now. Do you know if thats why?

Mine works, are you using MFA? May need to create a device password and use that for Gmail.
 
don't know what i am looking , which fail over is working ?

Code:
Jun  7 18:46:33 wan-failover.sh: Dual WAN Failover Mode - ASUS Factory Watchdog: Enabled
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - Dual WAN is disabled or not in Failover Mode
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - WAN Failover is currently stopped, will resume when Dual WAN Failover Mode is enabled and WAN Links are enabled with an active connection
Jun  7 18:46:33 kernel: ACCEPT IN=br0 OUT=eth0 MAC=24:4b:fe:f2:6a:10:d4:5d:64:08:ef:2f:08:00 SRC=192.168.1.20 DST=142.251.12.188 LEN=52 TOS=0x00 PREC=0x00 TTL=127 ID=30333 DF PROTO=TCP SPT=3469 DPT=5228 SEQ=1664924403 ACK=0 WINDOW=64240 RES=0x00 SYN URGP=0 OPT (020405B40103030801010402)
Jun  7 18:46:33 kernel: ACCEPT IN=br0 OUT=eth0 MAC=24:4b:fe:f2:6a:10:fe:29:13:50:fb:9f:08:00 SRC=192.168.1.211 DST=52.219.32.141 LEN=64 TOS=0x00 PREC=0x00 TTL=63 ID=0 DF PROTO=TCP SPT=58096 DPT=443 SEQ=3366673445 ACK=0 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (020405B4010303050101080A9C1AC59E0000000004020000)
Jun  7 18:46:33 kernel: ACCEPT IN=br0 OUT=eth0 MAC=24:4b:fe:f2:6a:10:e4:5f:01:47:6e:29:08:00 SRC=192.168.1.3 DST=216.239.32.10 LEN=82 TOS=0x00 PREC=0x00 TTL=63 ID=43911 PROTO=UDP SPT=33004 DPT=53 LEN=62
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - wan0 and wan1 are enabled and connected
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - Returning to check WAN Status
Jun  7 18:46:33 kernel:  *** ERROR: [send_redir_page:625] # redir_url=http://192.168.1.1:80/blocking.asp?cat_id=56&mac=FE291350FB9F&domain=ap-sin-00001.s3.dualstack.ap-southeast-1.amazonaws.com
Jun  7 18:46:33 wan-failover.sh: Dual WAN Failover Mode - ASUS Factory Watchdog: Enabled
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - Dual WAN is disabled or not in Failover Mode
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - WAN Failover is currently stopped, will resume when Dual WAN Failover Mode is enabled and WAN Links are enabled with an active connection
Jun  7 18:46:33 kernel: ACCEPT IN=br0 OUT=eth0 MAC=24:4b:fe:f2:6a:10:fe:29:13:50:fb:9f:08:00 SRC=192.168.1.211 DST=52.219.32.141 LEN=64 TOS=0x00 PREC=0x00 TTL=63 ID=0 DF PROTO=TCP SPT=58097 DPT=443 SEQ=629491366 ACK=0 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (020405B4010303050101080A56949C220000000004020000)
Jun  7 18:46:33 kernel: ACCEPT IN=br0 OUT=eth0 MAC=24:4b:fe:f2:6a:10:d4:5d:64:08:ef:2f:08:00 SRC=192.168.1.20 DST=104.244.42.65 LEN=41 TOS=0x00 PREC=0x00 TTL=127 ID=53810 DF PROTO=TCP SPT=11267 DPT=443 SEQ=3856546213 ACK=1948967891 WINDOW=1020 RES=0x00 ACK URGP=0
Jun  7 18:46:33 kernel: ACCEPT IN=br0 OUT=eth0 MAC=24:4b:fe:f2:6a:10:e4:5f:01:47:6e:29:08:00 SRC=192.168.1.3 DST=216.239.38.10 LEN=80 TOS=0x00 PREC=0x00 TTL=63 ID=35457 PROTO=UDP SPT=22148 DPT=53 LEN=60
Jun  7 18:46:33 kernel: ACCEPT IN=br0 OUT=eth0 MAC=24:4b:fe:f2:6a:10:d4:5d:64:08:ef:2f:08:00 SRC=192.168.1.20 DST=104.244.42.66 LEN=41 TOS=0x00 PREC=0x00 TTL=127 ID=4887 DF PROTO=TCP SPT=11266 DPT=443 SEQ=3114202855 ACK=2539781939 WINDOW=1025 RES=0x00 ACK URGP=0
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - wan0 and wan1 are enabled and connected
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - Returning to check WAN Status
Jun  7 18:46:33 wan-failover.sh: Dual WAN Failover Mode - ASUS Factory Watchdog: Enabled
Jun  7 18:46:33 kernel:  *** ERROR: [send_redir_page:625] # redir_url=http://192.168.1.1:80/blocking.asp?cat_id=56&mac=FE291350FB9F&domain=ap-sin-00001.s3.dualstack.ap-southeast-1.amazonaws.com
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - Dual WAN is disabled or not in Failover Mode
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - WAN Failover is currently stopped, will resume when Dual WAN Failover Mode is enabled and WAN Links are enabled with an active connection
Jun  7 18:46:33 kernel: ACCEPT IN=br0 OUT=eth0 MAC=24:4b:fe:f2:6a:10:fe:29:13:50:fb:9f:08:00 SRC=192.168.1.211 DST=52.219.32.141 LEN=64 TOS=0x00 PREC=0x00 TTL=63 ID=0 DF PROTO=TCP SPT=58098 DPT=443 SEQ=3614472909 ACK=0 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (020405B4010303050101080AEE23AFF80000000004020000)
Jun  7 18:46:33 kernel: ACCEPT IN=br0 OUT=eth0 MAC=24:4b:fe:f2:6a:10:e4:5f:01:47:6e:29:08:00 SRC=192.168.1.3 DST=216.239.34.10 LEN=84 TOS=0x00 PREC=0x00 TTL=63 ID=14559 PROTO=UDP SPT=54942 DPT=53 LEN=64
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - wan0 and wan1 are enabled and connected
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - Returning to check WAN Status
Jun  7 18:46:33 wan-failover.sh: Dual WAN Failover Mode - ASUS Factory Watchdog: Enabled
Jun  7 18:46:33 kernel:  *** ERROR: [send_redir_page:625] # redir_url=http://192.168.1.1:80/blocking.asp?cat_id=56&mac=FE291350FB9F&domain=ap-sin-00001.s3.dualstack.ap-southeast-1.amazonaws.com
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - Dual WAN is disabled or not in Failover Mode
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - WAN Failover is currently stopped, will resume when Dual WAN Failover Mode is enabled and WAN Links are enabled with an active connection
Jun  7 18:46:33 kernel: ACCEPT IN=br0 OUT=eth0 MAC=24:4b:fe:f2:6a:10:e4:5f:01:47:6e:29:08:00 SRC=192.168.1.3 DST=216.239.36.10 LEN=84 TOS=0x00 PREC=0x00 TTL=63 ID=4097 PROTO=UDP SPT=7113 DPT=53 LEN=64
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - wan0 and wan1 are enabled and connected
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - Returning to check WAN Status
Jun  7 18:46:33 wan-failover.sh: Dual WAN Failover Mode - ASUS Factory Watchdog: Enabled
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - Dual WAN is disabled or not in Failover Mode
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - WAN Failover is currently stopped, will resume when Dual WAN Failover Mode is enabled and WAN Links are enabled with an active connection
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - wan0 and wan1 are enabled and connected
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - Returning to check WAN Status
Jun  7 18:46:33 wan-failover.sh: Dual WAN Failover Mode - ASUS Factory Watchdog: Enabled
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - Dual WAN is disabled or not in Failover Mode
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - WAN Failover is currently stopped, will resume when Dual WAN Failover Mode is enabled and WAN Links are enabled with an active connection
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - wan0 and wan1 are enabled and connected
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - Returning to check WAN Status
Jun  7 18:46:33 wan-failover.sh: Dual WAN Failover Mode - ASUS Factory Watchdog: Enabled
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - Dual WAN is disabled or not in Failover Mode
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - WAN Failover is currently stopped, will resume when Dual WAN Failover Mode is enabled and WAN Links are enabled with an active connection
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - wan0 and wan1 are enabled and connected
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - Returning to check WAN Status
Jun  7 18:46:33 wan-failover.sh: Dual WAN Failover Mode - ASUS Factory Watchdog: Enabled
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - Dual WAN is disabled or not in Failover Mode
Jun  7 18:46:33 wan-failover.sh: WAN Failover Disabled - WAN Failover is currently stopped, will resume when Dual WAN Failover Mode is enabled and WAN Links are enabled with an active connection
Jun  7 18:46:34 wan-failover.sh: WAN Failover Disabled - wan0 and wan1 are enabled and connected
Jun  7 18:46:34 wan-failover.sh: WAN Failover Disabled - Returning to check WAN Status
Jun  7 18:46:34 wan-failover.sh: Dual WAN Failover Mode - ASUS Factory Watchdog: Enabled

am i doing everything right ?
 
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)
 
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)
Thanks , i missed it somehow ,Got it working
Amazing script , This should be incorporated into amtm . Wish it had a web UI for simplicity .
Otherwise all is good .Kudos to the dev
 
Last edited:
Thanks , i missed it somehow , do i have to run the script again from scratch ?
No just turn off the ASUS settings and it should detect the change
 

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