What's new

N66U losing WAN after modem reboot

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

cowst

Senior Member
Hi,
I am experiencing this issue for a long while (I am afraid it started when other people on previous threads pointed the same issue to a particular release over one year ago) but now it is exacerbated by my new modem rebooting each time I accept a phone call.

Basically whenever the modem reboots, the router is able to get WAN connection again but only for a few seconds and then remains disconnected, although LAN still works (log attached).

I have 380.58 and I am going to update to 380.59, but I am afraid there might be more here requiring specific attention.
 

Attachments

  • syslog.txt
    34.4 KB · Views: 431
Happened again, new log attached.
 

Attachments

  • syslog(1).txt
    131.5 KB · Views: 720
I know it's not a real fix but have you tried John's fork? It works well on our 66u routers.
 
I'll check merlin changelog since John's fork.
If there is nothing I cannot miss, I'll give it a try.
However I hope for a fix :)

In version .58 this is the only bug i can think of.

Do I have jffs scripts with John?
 
I'll check merlin changelog since John's fork.
If there is nothing I cannot miss, I'll give it a try.
However I hope for a fix :)

In version .58 this is the only bug i can think of.

Do I have jffs scripts with John?

Yes, it has most of what Merlin's has, just uses an older and what some would say more stable driver for the n66u. It may have a few less features like Tor and interface changes but nothing I care about. Sometimes less is more when it comes to stability in software, as we can see with the latest versions of Asus implementing and changing too much before it has a stable firmware.
 
In the log the time is never obtained, suggesting an internet connection never obtained. There is a record of udhcpc getting a WAN IP with hour lease time. When the modem crashes/reboots should the WAN IP change? Because the router would not start to retry for half the hour. I have had a similar issue for years, with many different firmwares - but my ISP has a 7 day lease, and if there is a major network re-organization requiring a new IP could wait a long time. To workaround I have a ping script which will restart the WAN - hopefully before someone in households power cycle everything losing logs etc.
 
In the log the time is never obtained, suggesting an internet connection never obtained. There is a record of udhcpc getting a WAN IP with hour lease time. When the modem crashes/reboots should the WAN IP change? Because the router would not start to retry for half the hour. I have had a similar issue for years, with many different firmwares - but my ISP has a 7 day lease, and if there is a major network re-organization requiring a new IP could wait a long time. To workaround I have a ping script which will restart the WAN - hopefully before someone in households power cycle everything losing logs etc.
I think the Wan ip is the same, because the modem reboot is due to a sip bug, although the provider still cannot understand it.

Every time i answer a phone call, the modern reboots instantly.
My phone silent ,waiting for the audio session, the other phone still ringing because didn't receive the ok.
More clear than this... :)

Anyway, as I mentioned, when the modem is back, the router regains the same connection for a few seconds, i can tell from my sat receiver.
But then loses it.
Perhaps until the lease expiration, but that doesn't make it less of a bug :)
 
In the log the time is never obtained, suggesting an internet connection never obtained. There is a record of udhcpc getting a WAN IP with hour lease time. When the modem crashes/reboots should the WAN IP change? Because the router would not start to retry for half the hour. I have had a similar issue for years, with many different firmwares - but my ISP has a 7 day lease, and if there is a major network re-organization requiring a new IP could wait a long time. To workaround I have a ping script which will restart the WAN - hopefully before someone in households power cycle everything losing logs etc.
Could you share the ping script?
I thought about something like that. In a jffs script add a one liner to cron: ping Google once every minute and reboot if it fails.
Although there might be something less drastic...
 
I have this in my /jffs/scripts/wan-start script

Code:
#!/bin/sh
logger "WAN Up: New IP address is $(nvram get wan_ipaddr)"

sleep 20
killall wan_check.sh
/mnt/usb4gb/wan_check.sh &

and the contents of my usb mounted wan_check.sh script

Code:
#!/bin/sh
#space separated list of hosts to check
HSTS="$(nvram get wan_gateway) $(nvram get wan_dns) 8.8.8.8 8.8.4.4"
# No of times to check each host before trying next
TRIES=3
# How often to check in seconds if OK
TCHECK=30
# How long to wait if all hosts fail
TFAIL=10
# How many fails before restarting with dhcpc_renew
NFAIL=3

chk=0

LG(){
    echo "wan_check: $@"|/usr/bin/logger -s
}

CHK(){
    cnt=0
    chk=0
    while [ $cnt -lt $TRIES ]; do
        if /bin/ping -c 1 $@ >/tmp/wan_check.log; then
            chk=1
            break
        else
            sleep 1
            let cnt=cnt+1
        fi
    done
}

dn=0
LG monitoring WAN connection using ping
while [ $dn -lt $NFAIL ]; do
    for h in $HSTS; do
        UP=0;
        CHK $h
        if [ $chk -gt 0 ]; then
            UP=1
            break
        else
            LG ping check failed $h
        fi
    done

    if [ $UP -gt 0 ]; then
        dn=0
        sleep $TCHECK
    else
        let dn=dn+1
        sleep $TFAIL
    fi
done

LG "renewing dhcp wan"
killall -USR1 udhcpc
sleep 30
service restart_wan

It's a modded version of something I found on the net. It is slow to detect a fault because my ISP seems to drop ping packets when line is very busy, and I don't want false restarts of the wan. There's another variant around that reboots the router if the restart_wan doesn't work. The first 2 ips to ping are not correct nvram vars if you try dual wan.
 
I have this in my /jffs/scripts/wan-start script

Code:
#!/bin/sh
logger "WAN Up: New IP address is $(nvram get wan_ipaddr)"

sleep 20
killall wan_check.sh
/mnt/usb4gb/wan_check.sh &

and the contents of my usb mounted wan_check.sh script

Code:
#!/bin/sh
#space separated list of hosts to check
HSTS="$(nvram get wan_gateway) $(nvram get wan_dns) 8.8.8.8 8.8.4.4"
# No of times to check each host before trying next
TRIES=3
# How often to check in seconds if OK
TCHECK=30
# How long to wait if all hosts fail
TFAIL=10
# How many fails before restarting with dhcpc_renew
NFAIL=3

chk=0

LG(){
    echo "wan_check: $@"|/usr/bin/logger -s
}

CHK(){
    cnt=0
    chk=0
    while [ $cnt -lt $TRIES ]; do
        if /bin/ping -c 1 $@ >/tmp/wan_check.log; then
            chk=1
            break
        else
            sleep 1
            let cnt=cnt+1
        fi
    done
}

dn=0
LG monitoring WAN connection using ping
while [ $dn -lt $NFAIL ]; do
    for h in $HSTS; do
        UP=0;
        CHK $h
        if [ $chk -gt 0 ]; then
            UP=1
            break
        else
            LG ping check failed $h
        fi
    done

    if [ $UP -gt 0 ]; then
        dn=0
        sleep $TCHECK
    else
        let dn=dn+1
        sleep $TFAIL
    fi
done

LG "renewing dhcp wan"
killall -USR1 udhcpc
sleep 30
service restart_wan

It's a modded version of something I found on the net. It is slow to detect a fault because my ISP seems to drop ping packets when line is very busy, and I don't want false restarts of the wan. There's another variant around that reboots the router if the restart_wan doesn't work. The first 2 ips to ping are not correct nvram vars if you try dual wan.
I imagined something simpler, but this makes sense :)
I'll have to find another place for the script since I don't keep a USB attached.
Then I'll try it.
Thanks
 
It's only 1kB so not a problem for jffs ... but I try not to use it - just paranoid! I have other scripts too including one which sends an email to my gmail account on new wan connection, and adblock scripts and Entware so I need the usb.

There are many other ping scripts around, dd-wrt has one built in to trigger a reboot I recall. With other watch out they do not start until after a connection, and make sure they you can only have one copy running, fireall and wan up scripts can run multiple times during startup and config changes!
 
It's only 1kB so not a problem for jffs ... but I try not to use it - just paranoid! I have other scripts too including one which sends an email to my gmail account on new wan connection, and adblock scripts and Entware so I need the usb.

There are many other ping scripts around, dd-wrt has one built in to trigger a reboot I recall. With other watch out they do not start until after a connection, and make sure they you can only have one copy running, fireall and wan up scripts can run multiple times during startup and config changes!
Oh, didn't know, thanks
 
What if this is just a dual wan issue?
I am not using it, but the principle should be the same.
If one wan is down, fall back to the other (in my case re-establish it instead).
I'll check in the source code how they do it if it's available.
 
See other recent thread, I experimented with dual wan and fall back did not seem to work well - seems to be confused by my primary cable modem which is a form of half-bridge and the router gets a local ip when its wan is down. Might work better if modem powered off! Lots of code in wanduck.c (wan down up check?), it seems the code also tries to read internal kernel counters to detect interface down. IIRC correctly this is a general Linux issue, many driver specific methods to even detect media plugged in. An icmp ping out the intenet is the only real proof - and don't panic if occasionally fail!
 
See other recent thread, I experimented with dual wan and fall back did not seem to work well - seems to be confused by my primary cable modem which is a form of half-bridge and the router gets a local ip when its wan is down. Might work better if modem powered off! Lots of code in wanduck.c (wan down up check?), it seems the code also tries to read internal kernel counters to detect interface down. IIRC correctly this is a general Linux issue, many driver specific methods to even detect media plugged in. An icmp ping out the intenet is the only real proof - and don't panic if occasionally fail!
Thanks, I'll have a look.
I think my router didn't get a local ip but maintained the one it had before the modem reboot.
Just after a few seconds getting back connectivity, it stoppeed working.
 
Having similar issue with 380.58 wan drops and loss of Internet after 8 hours roughly maybe the ip is not being renewed? Using 68u with bridged modem


Sent from my iPhone using Tapatalk
 
Having similar issue with 380.58 wan drops and loss of Internet after 8 hours roughly maybe the ip is not being renewed? Using 68u with bridged modem


Sent from my iPhone using Tapatalk
In that case sounds like lease renew from the ISP.
In my case I think everything stays the same on both ISP and internal side, but wan just breaks.
The little detail to remember is that once the modem is back up, the router has connectivity, but there must be something triggered that breaks it after a few seconds.
I hoped the log would show it to somebody knowing what he's looking at :)
 
This issue occurred after I switched from stock Asus firmware to Merlin, I don't think ISP is causing it


Sent from my iPhone using Tapatalk
 
This issue occurred after I switched from stock Asus firmware to Merlin, I don't think ISP is causing it


Sent from my iPhone using Tapatalk
I am not saying that.
I just think we are having 2 separate issues resulting in the same apparent problem :)
 

Similar 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