What's new

Rmerlin, please introduce a time delay setting for Wan Connection at boot

  • 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 haven't finalized build 25 yet. Currently testing it on my network.

Drop me a PM tho, along with your router model. I'd like to have a Charter user actually test this DHCP change.

I am in exactly the same boat here. I purchased the router on 03/09/2013 form BestBuy. Asus RT-AC66R and am having the exact same problems concerning the power issues and connecting back to the internet. I did contact Asus and they advised me to exchange the router with BestBuy and try again. Guess what same thing and same problem. I am using Charter as my ISP so RMerlin I am more than happy to be your tester if need be. I did d/l the 270.25b firmware today but it doesn't seem to have made any difference for me. Possibly I have missed someting here. I did notice in the "tools" section of the GUI it thinks I have a RT-AC66U and not the RT-AC66R. All help here would be greatly appreciated. I do power cycle my cable modem and router on a nightly basis and never had any issues with my DIR-655 router.
 
I am in exactly the same boat here. I purchased the router on 03/09/2013 form BestBuy. Asus RT-AC66R and am having the exact same problems concerning the power issues and connecting back to the internet. I did contact Asus and they advised me to exchange the router with BestBuy and try again. Guess what same thing and same problem. I am using Charter as my ISP so RMerlin I am more than happy to be your tester if need be. I did d/l the 270.25b firmware today but it doesn't seem to have made any difference for me. Possibly I have missed someting here. I did notice in the "tools" section of the GUI it thinks I have a RT-AC66U and not the RT-AC66R. All help here would be greatly appreciated. I do power cycle my cable modem and router on a nightly basis and never had any issues with my DIR-655 router.

3.0.0.4.270.25b has the Charter fix implemented, and was confirmed to be working from another Charter user.

Keep in mind that it can take over 5 minutes for the router to successfully reconnect back after a power cycle. That's the price to pay for having to send DHCP queries at a very slow pace to prevent Charter's trigger-happy security from blacklisting you. So just be patient and give it some time.
 
3.0.0.4.270.25b has the Charter fix implemented, and was confirmed to be working from another Charter user.

Keep in mind that it can take over 5 minutes for the router to successfully reconnect back after a power cycle. That's the price to pay for having to send DHCP queries at a very slow pace to prevent Charter's trigger-happy security from blacklisting you. So just be patient and give it some time.


You are exactly right. I turned my router on this morning at 5:00a.m. Made a cup of coffee and fired up my laptop. Viola!! connected like a charm. Patience is a virtue obviously. I have only been a member here for a short time but I do want to congratulate you on the wonderful job you do. Asus needs to look at compensating you because you seem to be right on with the updates and work hard to keep us users going. Thanks once again.
 
Hi everybody,

I'm using Asus RT-AC68U with AsusWRT-Merlin 3.0.0.4_374.42_2 connected to UPC managed cable modem Cisco EPC3208.

Unfortunately I'm experiencing the same issue as described in this thread and most of the time if the router and cable modem is powered off at night and powered on in the morning the WAN connection can't be established. And it won't help even if I wait for more than 2 hours !

I have to manually log in into the router, go to Internet Status and press the Internet Connection button twice to switch it OFF and ON (it shows me the WAN status: DHCP connection failed).

Normally I would say that something is wrong with the cable modem, but I was using the same device since 3 years with Netgear WNR3500Lv2 without any problems. I even did some tests yesterday and after every power-cycle the Netgear quickly reestablishes the connection.

Unfortunately the story is different with Asus RT-AC68U. So another thought was that something might be wrong with the router. I got the new one today and guess what - still the same issue.

Any ideas what I can do to get rid off it ? I can see following error messages in the log: WAN Connection: ISP's DHCP did not function properly

Some logs at the link below. The router is powered on together with cable modem at ~02:00. It gives strange messages like: WAN Connection: ISP's DHCP did not function properly. WAN connection is restored at ~02:08 manually once I press the ON button twice. Sometimes it helps to power off and power on both router and cable modem, but sometimes not. It seems to be related to the fact which device finishes its start-up procedure first.

Any ideas ? This issue drives me crazy, especially as my wife complains in the morning that internet is not working :)

https://www.dropbox.com/s/9d7fe0f2vr46tkh/asuswrt-merlin_poweroff_on_issue.txt
 
Last edited:
mrvain - I'm getting this same issue with my N66U and SB6120 with Charter Internet. When I'm back home, I'm going to see if power cycling with the 5 minute delay between modem powerup and router powerup helps anything. I'll post results.
 
I will also say, that I noticed my router/cable link sometimes came up orange at Mbit speeds rather than Gbit. I'm using a 24" Cat 6 cable, so maybe it's a connector issue.
 
mrvain - I'm getting this same issue with my N66U and SB6120 with Charter Internet. When I'm back home, I'm going to see if power cycling with the 5 minute delay between modem powerup and router powerup helps anything. I'll post results.

With Charter it's critical that you ensure that the DHCP is set to "Normal" and not "Aggressive" on the WAN page. Otherwise, you will blacklist yourself by sending DHCP queries too quickly - Charter is very picky about this.
 
With Charter it's critical that you ensure that the DHCP is set to "Normal" and not "Aggressive" on the WAN page. Otherwise, you will blacklist yourself by sending DHCP queries too quickly - Charter is very picky about this.

Thanks RMerlin. I fixed the issue today. I tried multiple times power cycling both the router and the modem with several minutes of downtime without success.

I finally changed the WAN DCHP settings. Under "Special Requirement from ISP" I changed MAC Address to <blank> and DCHP query frequency from Aggressive to Normal.

That seems to have done the trick, allowing me to write this post. I'll check back if something reverts down the road, but I'm hopeful the problem is solved.
 
I decided to switch to TomatoARM by Shibby. Since yesterday I didn't have any single issue with WAN connection regardless how many times I do power-cycle. So something is definitely wrong with AsusWRT firmware. I will stick with Tomato until someone finds some solution.

BTW, I was just thinking about turning off and on the WAN connection from withing the wan-start script after some time (like 5 mins) ? Any ideas how to do it in an elegant way ?
 
OK, I returned to AsusWRT-Merlin firmware again having some idea in mind. At the end I managed to solve the issue by using nice workaround. Basically I noticed that the issue can be solved by restarting WAN interface:

service restart_wan

Or by splitting it into two commands:

service stop_wan
service start_wan

So I prepared a script which is run after the router is powered on and then by crontab every 5 minutes:

/jffs/scripts/wan-check

Code:
#!/bin/sh

# Uncomment the IP you would like to ping

# ISP default GW
IP_TO_CHECK=$(nvram get wan_gateway)

# ISP first DNS
#IP_TO_CHECK=$(nvram get wan_dns|awk '{ print $1 }')

# Your own IP to check
#IP_TO_CHECK=WWW.XXX.YYY.ZZZ

if ! ping -c 1 -W 5 $IP_TO_CHECK ; then
        logger "****** wan-check ******: IP $IP_TO_CHECK not pingable, restarting WAN connection"
        logger "****** wan-check ******: Stopping WAN connection"
        service stop_wan
        sleep 7
        logger "****** wan-check ******: Starting WAN connection"
        service start_wan
#else
#        logger "****** wan-check ******: IP $IP_TO_CHECK OK"
fi

You can define different IPs to check, depending on your ISP. It can be your ISP default GW, ISP DNS or any IP address you have in mind. Simply check what is pingable and then uncomment appropriate section and ensure there is only one IP_TO_CHECK variable active.

Then you need to add crontab entry to run the script in predefined intervals. I think the best place is to put it into services-start or init-start script.

Below cron will run the script every 5 mins (*/5). In order not to have wait 5 mins to get the WAN up & running again I put the wan-check script invocation also in the beginning of the services-start file, just before crontab entry is created (to avoid a situation where the script is invoked by both services-start script and cron):

/jffs/scripts/services-start

Code:
#!/bin/sh

sleep 20

/jffs/scripts/wan-check

sleep 2

cru a WANCheck "*/5 * * * * /jffs/scripts/wan-check"

After you create the scripts please assign +rx flags:

chmod a+rx /jffs/scripts/*
chmod go-w /jffs/scripts/*

And that's it. I did few rounds of tests and I have internet connection all the time, regardless of power-cycle numbers. You can observe wan-check script invocations in your syslog (uncomment the 'else' statement and line after it if you want to see if it is run by cron also while the connection is OK).

I hope RMerlin will figure out what is the reason for such behaviour, so we don't have to use this workaround.
 
Last edited:
I hope RMerlin will figure out what is the reason for such behaviour, so we don't have to use this workaround.

Have you checked that you had DHCP mode set to Normal rather than Aggressive?
 
Have you checked that you had DHCP mode set to Normal rather than Aggressive?
Yes, I tried that trick as well, but with no success.

I think it is somehow related to the fact that router boots up faster than modem. It tries to get WAN IP and gets into some strange loop as it can't refresh the IP through DHCP. Once I restart the WAN interface from GUI/CLI I get the IP instantaneously and I can do it even few seconds after the boot up. The only condition is that the modem needs to be connected to the cable provider. So if I do power-cycle once the modem is up & running everything works OK.

I guess it is not that common issue because most people leave the router and modem up & running. But I personally turn it off at night and that's why I ran into these issues.
 
Last edited:
Yes, I tried that trick as well, but with no success.

I think it is somehow related to the fact that router boots up faster than modem. It tries to get WAN IP and gets into some strange loop as it can't refresh the IP through DHCP. Once I restart the WAN interface from GUI/CLI I get the IP instantaneously and I can do it even few seconds after the boot up. The only condition is that the modem needs to be connected to the cable provider. So if I do power-cycle once the modem is up & running everything works OK.

I guess it is not that common issue because most people leave the router and modem up & running. But I personally turn it off at night and that's why I ran into these issues.

Does your modem have a management interface? If so, log into it and make sure it doesn't run any DHCP service. That service might be what's confusing the router, by allocating a LAN IP to the router before your ISP starts providing WAN IPs to your DHCP requests.
 
I logged in into the Cisco EPC3208 management interface, but there are no DHCP related settings. There are not too many options you can change to be honest, the modem works in bridge mode and is invisible for the router.
 
Unfortunately it turned out the same issues are present if the modem disconnects for some reason or goes down. Even if the router is up and running it won't be able to connect to the ISP after the modem reconnects/powers up. So I had to move the wan-check script invocation from services-start to wan-start, so it will check the connection every time the WAN interface comes up. This way I don't have to run this script periodically from cron.

As suggested by one user I also put the code to check if another copy of the script is running. It will also return different exit codes depending on the result. So you can use it in conditionals like this:

Code:
if /jffs/scripts/wan-check ; then
       echo "Connection OK"
else
       echo "Connection not OK"
fi

Here is the improved version:

/jffs/scripts/wan-check

Code:
#!/bin/sh

# Uncomment the IP you would like to ping

# ISP default GW
IP_TO_CHECK=$(nvram get wan_gateway)

# ISP first DNS
#IP_TO_CHECK=$(nvram get wan_dns|awk '{ print $1 }')

# Your own IP to check
#IP_TO_CHECK=WWW.XXX.YYY.ZZZ

ME=`basename $0`
RUNNING=`ps | awk '/'"$ME"'/ {++x}; END {print x+0}'`
if [ "$RUNNING" -gt 3 ]; then
        logger "****** wan-check ******: Another instance of \"$ME\" is running, exiting"
        exit 1
fi

if ! ping -c 1 -W 5 $IP_TO_CHECK ; then
        logger "****** wan-check ******: IP $IP_TO_CHECK not pingable, restarting WAN connection"
        logger "****** wan-check ******: Stopping WAN connection"
        service stop_wan
        sleep 8
        logger "****** wan-check ******: Starting WAN connection"
        service start_wan
        sleep 8
        if ! ping -c 1 -W 5 $IP_TO_CHECK ; then
                exit 1
        else
                exit 0
        fi
else
        logger "****** wan-check ******: IP $IP_TO_CHECK OK"
        exit 0
fi

And it is how I invoke it from the /jffs/scripts/wan-start

Code:
#!/bin/sh

logger "****** wan-start script started ******"

sleep 60
/jffs/scripts/wan-check
 

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