What's new

What to do when WAN disconnects?

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

kapekohicafe

Occasional Visitor
Hi,

Just wanted to ask if there are steps to be done when my WAN connection disconnects? I accidentally powered off my modem earlier and then when i checked the router i wasn't able to establish upstream connection from any of my devices. I wonder if there are best practices when re-establishing WAN connection.

thank you!
 
no best practice really, simply power ON modem first and maybe wait a minute for it to establish a connection with your ISP; then power ON your router and wait another minute or so and you should be good to go.
 
Your WAN being disconnected either it wasn't able to renew the DHCP nor DHCP expired...(which sometimes happens to my RT-AC86U in Normal or Aggressive Mode)...I would advise simply to go to WAN interface and hit Apply without making any change, that would trigger the DHCP request to your ISP again.

OR power ON or OFF router might help , disconnect and reconnect the WAN ethernet cable might help too!!

Good luck!
 
I used to have a similar problem w/ one of my older MIPS routers. Ended up writing a small script to monitor the WAN by pinging a public IP. If it failed three (3) times over the course of about a minute, it would reboot the router. Solved the problem.

Frankly, I'm surprised more routers don't have a built-in "keepalive" that basically does the same thing. I know dd-wrt does, but I was using Shibby tomato at the time.
 
i appreciate your replies! all of these are noted. :D thank you all!
 
Hi,

Just wanted to ask if there are steps to be done when my WAN connection disconnects? I accidentally powered off my modem earlier and then when i checked the router i wasn't able to establish upstream connection from any of my devices. I wonder if there are best practices when re-establishing WAN connection.

thank you!
Not sure if the GUI still supports an automated WAN restart (without the unfortunate cosmetic GUI side effect?)

1612539386748.png


Alternatively there is a crude WAN monitoring ChkWAN script
 
I have a weird situation. My Router will renew its WAN IP, But the "connected" Icon will not illuminate. Clients that are currently connected will get a notice in their browsers "You must log on to this network before you access the internet", but you can still browse on those clients. New clients which connect in this state, will not be able to access the internet. The router will fail if you try to use the Networking Tools to ping either by URL or IP Address (Google, yahoo, etc.). I am running AX88U as router with Merlin 386.1 (but this predates that new firmware).
Any suggestions?

1612884224748.png
 
Last edited:
Are you running in a Double NAT setup? What is showing as WAN IP is actually an IP on what is considered in most cases a LAN IP address.

If you confirm you are in in a double NAT which is fine the solution to your problem might be different than if you are not in a double NAT.
 
Are you running in a Double NAT setup? What is showing as WAN IP is actually an IP on what is considered in most cases a LAN IP address.

If you confirm you are in in a double NAT which is fine the solution to your problem might be different than if you are not in a double NAT.
My ISP is ... well interesting. I live out in the middle of nowhere, so they set up a wireless network with access points / repeaters on water towers, barns etc. In this wireless net, you have what looks like a LAN IP address (Class C? or am i getting my classes mixed up?) At some point you are routed to a cell tower that has copper or fiber back to their home office where you get put on a major carrier's line and you get a shared public IP address. So, yes, this is a double (triple, quadrupled...) Nat scenario.
Never really had this issue with my old AC88U, but it has been pretty prevalent with the AX88U.
More data points: Cycling the internet connection toggle switch in the GUI will fix the problem (until the next time). Waiting anywhere from 15 - 35 minutes sometimes allows the system to "reconnect" (it wasn't fully disconnected to begin with, so I quoted the word) and then it will be fine until next time.
 
The only thing is try varying the DHCP query frequency and see if one of the options results in a more stable WAN connection.
 
I'm seeing the same behaviour. My cable modem is configured as a modem, so does nothing for my network. I randomly get the same situation where performance of network drops (I notice if I'm doing a video conference call), new clients cannot get access to internet, but current clients continue. I have an RT-AX56U. The WAN light on the front goes red.

I put in place a little script to reconnect (/jffs/scripts/wan-event), but the funny thing is that it never gets the disconnect messages:
Code:
#!/bin/sh
echo `date` $1 - $2 >> /jffs/scripts/wan-events.log
if [ "$2" = "disconnected" ]; then
        #killall -USR1 udhcpc
        #sleep 10
        service restart_wan
        echo `date` $1 - $2 called service - restart_wan >> /jffs/scripts/wan-events.log
fi
echo `date` $1 - $2 done >> /jffs/scripts/wan-events.log

In the log file, I do not see any disconnected messages, however, if I manually issue a service restart_wan, I have no loss of connectivity, the red light goes out for the wan and clients start working.

Finally, my cable modem is providing 5 static IPs and the router I have connected to another IP on the same modem never sees the connection loss. This has only happened since upgrading to 386.1.

Any thoughts on diagnosis?
 
I'm seeing the same behaviour. My cable modem is configured as a modem, so does nothing for my network. I randomly get the same situation where performance of network drops (I notice if I'm doing a video conference call), new clients cannot get access to internet, but current clients continue. I have an RT-AX56U. The WAN light on the front goes red.

I put in place a little script to reconnect (/jffs/scripts/wan-event), but the funny thing is that it never gets the disconnect messages:
Code:
#!/bin/sh
echo `date` $1 - $2 >> /jffs/scripts/wan-events.log
if [ "$2" = "disconnected" ]; then
        #killall -USR1 udhcpc
        #sleep 10
        service restart_wan
        echo `date` $1 - $2 called service - restart_wan >> /jffs/scripts/wan-events.log
fi
echo `date` $1 - $2 done >> /jffs/scripts/wan-events.log

In the log file, I do not see any disconnected messages, however, if I manually issue a service restart_wan, I have no loss of connectivity, the red light goes out for the wan and clients start working.

Finally, my cable modem is providing 5 static IPs and the router I have connected to another IP on the same modem never sees the connection loss. This has only happened since upgrading to 386.1.

Any thoughts on diagnosis?

Shouldn't it be ...

Code:
...
if [ "$2" == "disconnected" ]; then
...
 
P.S. Just did a little test. I guess given the context, the interpreter will accept either '=' or '==' for comparison purposes. Just looked a little weird. I'm so used to seeing '=='.
 
Umm, possibly ;-) However, the first "echo" would still show in the log file if a disconnected was sent, I only see the following:
  1. stopping
  2. stopped
  3. init
  4. connecting
  5. connected
So while the script might not perform the reset, even when the red light has turned on, the wan-event script is not called. I believe it is because the WAN is not really disconnected, but some other failure is happening. Unfortunately, I cannot see anything in the log files suggesting what this could be.
 
I'm seeing the same behaviour. My cable modem is configured as a modem, so does nothing for my network. I randomly get the same situation where performance of network drops (I notice if I'm doing a video conference call), new clients cannot get access to internet, but current clients continue. I have an RT-AX56U. The WAN light on the front goes red.

I put in place a little script to reconnect (/jffs/scripts/wan-event), but the funny thing is that it never gets the disconnect messages:
Code:
#!/bin/sh
echo `date` $1 - $2 >> /jffs/scripts/wan-events.log
if [ "$2" = "disconnected" ]; then
        #killall -USR1 udhcpc
        #sleep 10
        service restart_wan
        echo `date` $1 - $2 called service - restart_wan >> /jffs/scripts/wan-events.log
fi
echo `date` $1 - $2 done >> /jffs/scripts/wan-events.log

In the log file, I do not see any disconnected messages, however, if I manually issue a service restart_wan, I have no loss of connectivity, the red light goes out for the wan and clients start working.

Finally, my cable modem is providing 5 static IPs and the router I have connected to another IP on the same modem never sees the connection loss. This has only happened since upgrading to 386.1.

Any thoughts on diagnosis?
Rename wan-event to wan0-disconnected

then create wan-event with
Code:
#!/bin/sh

#For verbose debugging, uncomment the following two lines, and uncomment the last line of this script
#set -x
#(

#    v384.15 Introduced wan-event script, (wan-start) will be deprecated in a future release.

#          wan-event      {0 | 1} {stopping | stopped | disconnected | init | connecting | connected}
#
#                         e.g. scripts called in response to 'service restart_wan' - weird for a non-Dual-WAN router?
#
#                              WAN0-stopping
#                              WAN0-stopped
#                              WAN0-disconnected
#                              WAN0-stopped

#                              WAN1-stopping
#                              WAN1-stopped

#                              WAN0-init
#                              WAN0-connecting
#                              WAN0-disconnected
#                              WAN0-stopped
#                              WAN0-connected
#


Say(){
   echo -e $$ $@ | logger -st "($(basename $0))"
}
SayT(){
   echo -e $$ $@ | logger -t "($(basename $0))"
}
#========================================================================================================================================

#Say "User wan-event running"

scr_name="$(basename $0)"

WAN_IF=$1

WAN_STATE=$2


# Call appropriate script based on script_type
SERVICE_SCRIPT_NAME="wan${WAN_IF}-$WAN_STATE"
SERVICE_SCRIPT_LOG="/tmp/WAN${WAN_IF}_state"

# Execute and log script state
if [[ -f "/jffs/scripts/$SERVICE_SCRIPT_NAME" ]] ; then
    Say "     Script executing.. for wan-event: "$SERVICE_SCRIPT_NAME
    echo "$SERVICE_SCRIPT_NAME" > $SERVICE_SCRIPT_LOG
    sh /jffs/scripts/$SERVICE_SCRIPT_NAME $*
else
    Say "     Script not defined for wan-event: "$SERVICE_SCRIPT_NAME
fi

##@Insert##


#) 2>&1 | logger -t $(basename $0)"[$$_***DEBUG]"

In Syslog you should now see ALL events in sequence.
 
The only thing is try varying the DHCP query frequency and see if one of the options results in a more stable WAN connection.
I've tried normal and aggressive. Not seen any real difference there. Is the any down side to "continuous"? that seems like overkill. Is there an SH scripts that might be tied to a cron job? Check every 15 minutes and if no connection ask to renew DHCP? Just spit balling here.
Thanks for the help. Appreciate it.
 

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