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!

I’m trying to think of a way to implement this that would be sufficient yet simple and not confusing for the general population using the script. It would be easy for me to create a new variable in config and give it a value of 0 and tell you to adjust that setting? I am not saying no I’m just thinking about it before I proceed forward, I like to keep the script as user friendly as possible but allow flexibility for all users. It is my opinion we need to test some more things first before jumping to a new setting.
Yes, of course, as it will be convenient for you. The only thing is, tomorrow, if you do something in 8 hours, tomorrow morning I will immediately check. Thank you in advance. Goodbye
 
Yes, of course, as it will be convenient for you. The only thing is, tomorrow, if you do something in 8 hours, tomorrow morning I will immediately check. Thank you in advance. Goodbye
Who is your Provider?
 
Hey @Ranger802004... well, I finally got my 4G USB modem working... I had it running in stock mode using load balancing. So I set it back to failover, and disabled everything. It ends up looking like this after the reboot... Does this look normal? Cold standby?

1658031897659.png


So after I configured your script, I tried running the "switchwan" function... and it didn't work. This is the result I got:

1658032749883.png


Should the modem be connected? What must I do to the modem/settings get the failover to work you think?
 
Hey @Ranger802004... well, I finally got my 4G USB modem working... I had it running in stock mode using load balancing. So I set it back to failover, and disabled everything. It ends up looking like this after the reboot... Does this look normal? Cold standby?

View attachment 42878

So after I configured your script, I tried running the "switchwan" function... and it didn't work. This is the result I got:

View attachment 42880

Should the modem be connected? What must I do to the modem/settings get the failover to work you think?

It’s stating cold standby because it has no DHCP lease from that WAN interface. My router attempts to reboot the interface to get one but check the 4G device.
 
It’s stating cold standby because it has no DHCP lease from that WAN interface. My router attempts to reboot the interface to get one but check the 4G device.
I've hit a brick wall with this thing. For the life of me, it doesn't want to give the router a DHCP address. Guess I'll try to do some testing in stock load balancing mode. :( That's the only thing that seems to work for some reason.
 
Yeah, and maybe load balancing isn't working exactly right either on this thing... :( Dang. I guess I'll look to see if there's a different kind of 4G modem I can borrow. :(

1658035889620.png
 
I've hit a brick wall with this thing. For the life of me, it doesn't want to give the router a DHCP address. Guess I'll try to do some testing in stock load balancing mode. :( That's the only thing that seems to work for some reason.
As far as issuing IPs to the WAN interface from DHCP, that happens with or without my script. You can kinda consider it a dependency....you gotta figure out why your router won't pick up a DHCP lease from the modem.
 
you gotta figure out why your router won't pick up a DHCP lease from the modem.

In my brief playing with dual-wan (both Asus and wan-failover.sh) and my 4G USB stick the other day (Huawei E8372h-608, Telstra Australia) I observed the following, which may or may not be useful to you @Viktor Jaep.
On inserting the stick into my "other" USB 3.0 port (bottom one in GUI) it was recognised and the Icon changed as follows:-
Google Chrome192.168.1.254ASUS Wireless Router RT-AX86U - Network Map - Google ChromeScreen Sh...jpg

I then turned on the Asus "stock" Dual Wan, including Fallback and a Ping Target, Applied and Rebooted.
The secondary port came up as "Cold-Standby", just like your screenshot.
I then unplugged my main WAN (HFC cable modem) and waited. It did switch to the USB Stick and I had connectivity.
I plugged the HFC modem back in, waited, and it did switch back to the main WAN, but now the Secondary stayed on Hot-Standby and it has a WAN IP address.

I then rebooted again and the USB stick again came up as Cold-Standby. But I did observe that if I manually switched "Off" and the "On" the Internet Connection slider in the Secondary WAN Status this ALSO put the USB modem into Hot-Standby and it acquired an IP address.

As you know from your VPNMON-R2 thread I then tried the wan-failover.sh script but rolled back for now when I was having issues with VPNMON, as was another user @JAX1337 , the assumption being that there were clashes/incompatibilities with the @Ranger802004 wan-failover.sh script. Which I think was the main reason you were going to play with your borrowed stick :D

This may or may not have anything to do with what you are seeing with your own 4G USB stick but I was seeing some striking similarities and thought it was worth throwing in my observations.
 
In my brief playing with dual-wan (both Asus and wan-failover.sh) and my 4G USB stick the other day (Huawei E8372h-608, Telstra Australia) I observed the following, which may or may not be useful to you @Viktor Jaep.
On inserting the stick into my "other" USB 3.0 port (bottom one in GUI) it was recognised and the Icon changed as follows:-
View attachment 42882
I then turned on the Asus "stock" Dual Wan, including Fallback and a Ping Target, Applied and Rebooted.
The secondary port came up as "Cold-Standby", just like your screenshot.
I then unplugged my main WAN (HFC cable modem) and waited. It did switch to the USB Stick and I had connectivity.
I plugged the HFC modem back in, waited, and it did switch back to the main WAN, but now the Secondary stayed on Hot-Standby and it has a WAN IP address.

I then rebooted again and the USB stick again came up as Cold-Standby. But I did observe that if I manually switched "Off" and the "On" the Internet Connection slider in the Secondary WAN Status this ALSO put the USB modem into Hot-Standby and it acquired an IP address.

As you know from your VPNMON-R2 thread I then tried the wan-failover.sh script but rolled back for now when I was having issues with VPNMON, as was another user @JAX1337 , the assumption being that there were clashes/incompatibilities with the @Ranger802004 wan-failover.sh script. Which I think was the main reason you were going to play with your borrowed stick :D

This may or may not have anything to do with what you are seeing with your own 4G USB stick but I was seeing some striking similarities and thought it was worth throwing in my observations.
Hmmm, can you send me a printout of your entire NVRAM (Remove what you deem necessary for privacy), I basically want to see how it is set up with the 4G USB stick in there. I bet I can find a way to force it active with the script just need data to work with on this one. See this response here regarding clashes with VPN MON. https://www.snbforums.com/threads/v...-surfshark-perfectprivacy-2.79762/post-777386
 
Hmmm, can you send me a printout of your entire NVRAM (Remove what you deem necessary for privacy)
Sure, happy to help - tell me what you need and how to do it.
My next problem would be I'm not sure what I DO need to remove for privacy ... passwords in there somewhere I guess?
 
Sure, happy to help - tell me what you need and how to do it.
My next problem would be I'm not sure what I DO need to remove for privacy ... passwords in there somewhere I guess?
Send me the output of this, skim through the output and delete what you feel is private info and DM it to me. I need the 4G USB connected and configured in Cold Standby and the way you get it working with the switch, outputs of both separate please.
Code:
nvram show
 
I need the 4G USB connected and configured in Cold Standby and the way you get it working with the switch, outputs of both separate please.
Ok, will do, but may not be until tomorrow sometime. Evening here in Sydney now.
 
A provider of a local scale, it's unlikely that their name will give you something ;) (info-lan.ru ) But it seems to me that my problem is not individual, for sure there will be users who will also encounter such a problem.
@lbtboy i believe is also in Russia and had a similar issue with his provider but we were able to work out this issues.
 
In my brief playing with dual-wan (both Asus and wan-failover.sh) and my 4G USB stick the other day (Huawei E8372h-608, Telstra Australia) I observed the following, which may or may not be useful to you @Viktor Jaep.
On inserting the stick into my "other" USB 3.0 port (bottom one in GUI) it was recognised and the Icon changed as follows:-
View attachment 42882
I then turned on the Asus "stock" Dual Wan, including Fallback and a Ping Target, Applied and Rebooted.
The secondary port came up as "Cold-Standby", just like your screenshot.
I then unplugged my main WAN (HFC cable modem) and waited. It did switch to the USB Stick and I had connectivity.
I plugged the HFC modem back in, waited, and it did switch back to the main WAN, but now the Secondary stayed on Hot-Standby and it has a WAN IP address.

I then rebooted again and the USB stick again came up as Cold-Standby. But I did observe that if I manually switched "Off" and the "On" the Internet Connection slider in the Secondary WAN Status this ALSO put the USB modem into Hot-Standby and it acquired an IP address.

As you know from your VPNMON-R2 thread I then tried the wan-failover.sh script but rolled back for now when I was having issues with VPNMON, as was another user @JAX1337 , the assumption being that there were clashes/incompatibilities with the @Ranger802004 wan-failover.sh script. Which I think was the main reason you were going to play with your borrowed stick :D
Yeah, VPNMON-R2 isn't clashing or incompatible with wan-failover... it was having trouble doing its own thing recognizing the different situations, pinging and reporting back its exit city. I think Beta 7 seems to actually work for the most part, but I would have loved to see it in action to make any possible tweaks I could.
This may or may not have anything to do with what you are seeing with your own 4G USB stick but I was seeing some striking similarities and thought it was worth throwing in my observations.
Very interesting, @Stephen Harrington! My icon definitely didn't change into something recognizable like that. I think it kept its standard "wan globe" icon like the main WAN has. In failover mode, it would just keep saying "cold standby", never getting an IP, and in load balancing mode, it actually gets an IP and seems like it works, but it continues to just say "cold standby", no matter how many times I turn the slider on/off. It may just not be compatible.

Question for you... what kinds of IP addresses do you see on your secondary WAN side when it says "cold standby" or "hot standby"?

1658065285823.png
 
I installed ax88u there again, the first launch is 2 minutes. :)

That is with the 90 second boot delay timer too so not bad. You could maybe consider increasing it to 120 seconds because it looks like your ISP is still doing something with your connection when it comes up because your packet loss is still 20% and then when it comes back around to checking again you're 0% and looking good.
 
That is with the 90 second boot delay timer too so not bad. You could maybe consider increasing it to 120 seconds because it looks like your ISP is still doing something with your connection when it comes up because your packet loss is still 20% and then when it comes back around to checking again you're 0% and looking good.
I have already tried various delay options. In fact, it does not affect the situation in any way.

Code:
364: Jul 17 19:25:00 wan-failover.sh: WAN Status - wan0 enabled
365: Jul 17 19:25:00 wan-failover.sh: WAN Status - Adding default route for wan0 Routing Table via 10.128.131.254 dev eth0
366: Jul 17 19:25:00 wan-failover.sh: WAN Status - Added default route for wan0 Routing Table via 10.128.131.254 dev eth0
367: Jul 17 19:25:00 wan-failover.sh: WAN Status - Adding IP Rule for 1.1.1.1
368: Jul 17 19:25:00 wan-failover.sh: WAN Status - Added IP Rule for 1.1.1.1
                                               15 sec pause!!!!!
369: Jul 17 19:25:08 wan-failover.sh: Debug - wan0 Packet Loss: 100%%
371: Jul 17 19:25:08 wan-failover.sh: Debug - wan0 Status: DISCONNECTED


Code:
490: Jul 17 19:25:25 wan-failover.sh: WAN0 Failback Monitor - Monitoring wan0 via 1.1.1.1 for Failback
                                               15 sec pause !!!!!
491: Jul 17 19:25:37 wan-failover.sh: WAN0 Failback Monitor - Packet Loss Detected - WAN0 Packet Loss: 80%

If possible, please release the beta version with timers of 0 seconds in different places, and I'll experiments :)

However, I really don't like the wan0 Status: DISCONNECTED message, you have already paid attention to it. For some reason wan0 becomes disabled :(

And after I received the message Jul 17 19:27:34 wan-failover.sh : WAN0 Failover Monitor - Monitoring wan0 via 1.1.1.1 for Failure almost 3 hours have already passed and there is not a single message about the loss of at least one ping, only service messages
Jul 17 22:09:10 wan-failover.sh: Debug - Script Mode: cron
Jul 17 22:09:10 wan-failover.sh: Debug - Function: cronjob
 
Last edited:
I have already tried various delay options. In fact, it does not affect the situation in any way.

Code:
364: Jul 17 19:25:00 wan-failover.sh: WAN Status - wan0 enabled
365: Jul 17 19:25:00 wan-failover.sh: WAN Status - Adding default route for wan0 Routing Table via 10.128.131.254 dev eth0
366: Jul 17 19:25:00 wan-failover.sh: WAN Status - Added default route for wan0 Routing Table via 10.128.131.254 dev eth0
367: Jul 17 19:25:00 wan-failover.sh: WAN Status - Adding IP Rule for 1.1.1.1
368: Jul 17 19:25:00 wan-failover.sh: WAN Status - Added IP Rule for 1.1.1.1
                                               15 sec pause!!!!!
369: Jul 17 19:25:08 wan-failover.sh: Debug - wan0 Packet Loss: 100%%
371: Jul 17 19:25:08 wan-failover.sh: Debug - wan0 Status: DISCONNECTED


Code:
490: Jul 17 19:25:25 wan-failover.sh: WAN0 Failback Monitor - Monitoring wan0 via 1.1.1.1 for Failback
                                               15 sec pause !!!!!
491: Jul 17 19:25:37 wan-failover.sh: WAN0 Failback Monitor - Packet Loss Detected - WAN0 Packet Loss: 80%

If possible, please release the beta version with timers of 0 seconds in different places, and I'll experiments :)

However, I really don't like the wan0 Status: DISCONNECTED message, you have already paid attention to it. For some reason wan0 becomes disabled :(

And after I received the message Jul 17 19:27:34 wan-failover.sh : WAN0 Failover Monitor - Monitoring wan0 via 1.1.1.1 for Failure almost 3 hours have already passed and there is not a single message about the loss of at least one ping, only service messages
Jul 17 22:09:10 wan-failover.sh: Debug - Script Mode: cron
Jul 17 22:09:10 wan-failover.sh: Debug - Function: cronjob
Hmmm ok, let me think on this for a few.
 
Hmmm ok, let me think on this for a few.
PINGCOUNT=20
PINGTIMEOUT=4


The only thing I don't understand is why:
88: Jul 17 23:04:35 wan-failover.sh : Debug - wan0 Status: Disconnected

but otherwise it seems to be fine. But it would still be more correct to solve the problem with a set timer.
 

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