What's new

WAN0 State Meanings? Router in disconnected state but internet worked...

  • 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!

Viktor Jaep

Part of the Furniture
This morning I found my router (AC86U) in a state where the web UI indicated it was disconnected from the internet.... however the internet was working perfectly fine. Running 386.7_2. So immediately I ran:

Code:
nvram get wan0_state_t

... and the result I got was "3". ???

Now I know:
Code:
0 = Stopped/Disconnected
1 = Connecting
2 = Connected

But what does "3" mean? I've even seen a mention of "4" at times in the forums as well, but I have not found any formal explanations what these codes beyond 2 mean?

In your opinion, would it be safe to assign "2" back to the wan0_state_t in NVRAM if it sees that it's 3 (or 4), and cross your fingers? Or is it just better to reboot at that point? I found a related thread, but it does not seem to apply to the issue I was having: https://www.snbforums.com/threads/status-shows-disconnected-yet-fully-functional.77787/

Thank you in advance for your expert advice! :)
 
0 = INITIALIZING
1 = CONNECTING
2 = CONNECTED
3 = DISCONNECTED
4 = STOPPED
5 = DISABLED
6 = STOPPING
Thanks for sharing that @ColinTaylor! This is really nice to have (saving this!). So I take it there's probably a bug... since the internet was working just fine, but still sitting in some "disconnected" state. What's your take on forcing it back to "2" in cases like this? Or is it more advisable to just reboot? I'm thinking about how to programmatically attack this.
 
I've not encountered this myself so it's not something I've ever looked into. A cursory look at the code suggests the DISCONNECTED state could be caused by many situations. I would be tempted to just restart the WAN interface and forget about it unless it happens again.
 
0 = INITIALIZING
1 = CONNECTING
2 = CONNECTED
3 = DISCONNECTED
4 = STOPPED
5 = DISABLED
6 = STOPPING
Hi, if I setup dual wan in fail-over mode, wan0 is showing "cold standby" and wan1 is showing "connected" in GUI web page, my nvram get wan0_state_t is 3, is "3" means "cold standby" or there are some other codes for dual wan? Thanks, Pseu
 
I am researching an issue with dual-wan and WAN1 being in Cold Standby.
I believe anything other that "2" is a problem.
I have a small script that tests for wan1_state_t. If not "2", then I issue this command:

service "restart_wan_if 1"

i.e.

Code:
if [[ "$(nvram get wan1_state_t)" != "2" ]] >/dev/null;then
       logger -t "switchwan" "WAN1 not connected, attempt restart"
       service "restart_wan_if 1"
       sleep 30
fi

In your case, change the wan1_state_t to wan0_state_t and the service restart to "restart_wan_if 0"

Might help. Worked for me.
 
Thanks!. One quick question: Is it "service 'restart_wan_if 0'" means restart the WAN0 interface, "service 'restart_wan_if 1" restart the WAN1 interface, as I have dual wan and set them to active/standby?

admin@RT-AX56U:/tmp/home/root# nvram show | grep wan[0,1,2,3,4]_state_t
wan0_state_t=2
wan1_state_t=4
wan2_state_t=0

' nvram get wan0_state_t ' value means:
0 = INITIALIZING
1 = CONNECTING
2 = CONNECTED
3 = DISCONNECTED
4 = STOPPED
5 = DISABLED
6 = STOPPING
 
I believe that is the case. The second parameter (0 or 1) restarts that interface.
Frankly, I never checked. My WAN0 (which I did not call with restart_wan_if) seemed to be fine both before and after I reset WAN1.

If/when my WAN1 goes into a Cold Standby state, I will do more observations!
 
I needed to reboot this morning. My WAN1 (AT&T DSL) stayed in the Cold Standby mode.
WAN0 (Starlink) was Connected.

I ran that script and watched Primary/Seconday status on the WebUI.

Primary (WAN0) stayed connected fine, Secondary (WAN1), after ~20 seconds went to Hot Standby.

It looks like the command will only have an effect on which wan_if you want to start.
 
Is there any status code in nvram to show " cold standby" and "hot standby"? From what I'm searching, seems wan0_state_t does not indicate this.
 
I needed to reboot this morning. My WAN1 (AT&T DSL) stayed in the Cold Standby mode.
WAN0 (Starlink) was Connected.

I ran that script and watched Primary/Seconday status on the WebUI.

Primary (WAN0) stayed connected fine, Secondary (WAN1), after ~20 seconds went to Hot Standby.

It looks like the command will only have an effect on which wan_if you want to start.
In your case, if you just simply run "service restart_wan", I believe it will also fix it.
 
I needed to reboot this morning. My WAN1 (AT&T DSL) stayed in the Cold Standby mode.
WAN0 (Starlink) was Connected.

I ran that script and watched Primary/Seconday status on the WebUI.

Primary (WAN0) stayed connected fine, Secondary (WAN1), after ~20 seconds went to Hot Standby.

It looks like the command will only have an effect on which wan_if you want to start.
I don't know if you have your WAN0 (Starlink) and WAN1(AT&T) set to dualwan = lb, will that cause some Internet slowness or timeout to you? I anticipate it will. I setup my dual wan as load balance last year, and my family kept telling me their smart phones were running slow for some apps(tiktok,youtube were good but amazon and eBay some times timeout or page not fully loaded.) I had some research and did some packet analyzing, some TCP connections were failed. I doubt that some packet was sent out in WAN0 but got replied in WAN1 and because the path/routes/IP were different, some apps might consider it "man in the middle" attack or the communication was some what hijacked and it sent a "DISCONNECT" to end the session.

After that, I set my Dual WAN mode as failed over, everybody is happy now.

Further information on that: some providers now have dual dial-up enabled, e.g. if you subscribe a gig DSL bandwidth, you can run two cables from your wireless router to the providers bridge modem(usually there are multiple gig ports on it for Internet,IPTV, ip-phone etc..), and you can dial twice using the same username/pasword, that simulates dual wan connection.You can get double bandwidth from one provider. One thing different is: the dual dial-up will have the same subnet IP addresses because they are from the same provider and the DSL remote peer IPs are usually the same. If you set the two dial-up as load balance, you will still have the same TCP session issue.
 
In your case, if you just simply run "service restart_wan", I believe it will also fix it.
I believe that might restart both WAN interfaces in Dual WAN mode. I have never tried it since the selective restart fixes my Cold Standby mode.
 
I don't know if you have your WAN0 (Starlink) and WAN1(AT&T) set to dualwan = lb, will that cause some Internet slowness or timeout to you? .
No, I have them setup as Dual WAN - failover - but use @Ranger802004 Dual WAN Failover script to actually manage the mode.
My use case is not typical. It’s not that my WAN goes down, it’s that WAN0 (fastpath) runs great from ~2AM until about 7PM. I’m on Starlink roaming so I get 0 QoS or any kind of priority. Hopefully this changes this year when they claim it goes “Available” in my area.

Until then, I relie on wan-failover (and a short speedtest scrip) to at least get ~11-12Mbit after 7PM at night - around the time my wife and I watch Netflix/AppleTV etc.
Without this, streaming is unwatchable.
wan-failover takes care of all the routing tables etc. We usually don’t even notice the change over.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top