[Solved] Frequent Internet Disconnects

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Atheros WiSOC based Hardware
Author Message
renkforce
DD-WRT Novice


Joined: 18 Jan 2014
Posts: 15

PostPosted: Sat Jan 25, 2014 16:25    Post subject: [Solved] Frequent Internet Disconnects Reply with quote
Device information:
TP-Link WDR4900 V1
DD-WRT v24-sp2 (01/10/14) std - build 23320
Linux 3.10.26 #123 Fri Jan 10 07:45:59 CET 2014 ppc

My WAN link drops every 40-50 minutes for no reason. These reconnects cannot be traced back to my ISP.
I'm connecting via DHCP and not using any VPN at all.

Here is what happens in /var/log/messages:
Code:
Jan 23 21:44:13 ddwrt user.info syslog: vpn modules : vpn modules successfully unloaded
Jan 23 21:44:13 ddwrt user.info syslog: vpn modules : nf_conntrack_proto_gre successfully loaded
Jan 23 21:44:13 ddwrt user.info syslog: vpn modules : nf_nat_proto_gre successfully loaded
Jan 23 21:44:13 ddwrt user.info syslog: vpn modules : nf_conntrack_pptp successfully loaded
Jan 23 21:44:13 ddwrt user.info syslog: vpn modules : nf_nat_pptp successfully loaded
Jan 23 21:44:13 ddwrt user.info syslog: process_monitor : Process Monitor successfully stopped
Jan 23 21:44:13 ddwrt user.info syslog: process_monitor successfully started
Jan 23 21:44:13 ddwrt daemon.debug process_monitor[8403]: We need to re-update after 3600 seconds
Jan 23 21:44:13 ddwrt daemon.info process_monitor[8403]: set timer: 3600 seconds, callback: ntp_main()
Jan 23 21:44:13 ddwrt user.info syslog: vpn modules : vpn modules successfully unloaded
Jan 23 21:44:13 ddwrt user.info syslog: vpn modules : nf_conntrack_proto_gre successfully loaded
Jan 23 21:44:13 ddwrt user.info syslog: vpn modules : nf_nat_proto_gre successfully loaded
Jan 23 21:44:13 ddwrt user.info syslog: vpn modules : nf_conntrack_pptp successfully loaded
Jan 23 21:44:13 ddwrt user.info syslog: vpn modules : nf_nat_pptp successfully loaded
Jan 23 21:44:14 ddwrt user.info syslog: wland : WLAN daemon successfully stopped
Jan 23 21:44:14 ddwrt user.info syslog: vpn modules : vpn modules successfully unloaded
Jan 23 21:44:14 ddwrt user.info syslog: vpn modules : nf_conntrack_proto_gre successfully loaded
Jan 23 21:44:14 ddwrt user.info syslog: vpn modules : nf_nat_proto_gre successfully loaded
Jan 23 21:44:14 ddwrt user.info syslog: vpn modules : nf_conntrack_pptp successfully loaded
Jan 23 21:44:14 ddwrt user.info syslog: vpn modules : nf_nat_pptp successfully loaded
Jan 23 21:44:14 ddwrt user.info syslog: wland : WLAN daemon successfully started
Jan 23 21:44:14 ddwrt user.info syslog: WAN is up. IP: 77.22.xxx.xxx


But why does it happen? There has to be a trigger.

What could be the reason for this?


Last edited by renkforce on Mon Jan 27, 2014 9:55; edited 1 time in total
Sponsor
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 8034

PostPosted: Sat Jan 25, 2014 17:52    Post subject: Reply with quote
Have you confirmed connectivity isn’t lost when the modem is connected directly to a PC/laptop?
renkforce
DD-WRT Novice


Joined: 18 Jan 2014
Posts: 15

PostPosted: Sat Jan 25, 2014 18:23    Post subject: Reply with quote
Yes, I isolated the problem to the dd-wrt router.
Its verified by connecting the PC directly to the cable modem. Also there are no more interruptions if I use another router or the stock firmware from TP-Link instead of dd-wrt.
renkforce
DD-WRT Novice


Joined: 18 Jan 2014
Posts: 15

PostPosted: Sun Jan 26, 2014 0:49    Post subject: Reply with quote
Update: I noticed the reconnect occurs exactly once every 45 minutes.
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 8034

PostPosted: Sun Jan 26, 2014 2:06    Post subject: Reply with quote
Is your router's clock keeping accurate time?

How long of a lease is the ISP providing for the WAN?

When it fails, can you get reconnected by simply renewing the lease from Status->WAN?
renkforce
DD-WRT Novice


Joined: 18 Jan 2014
Posts: 15

PostPosted: Sun Jan 26, 2014 10:04    Post subject: Reply with quote
eibgrad wrote:
Is your router's clock keeping accurate time?

Yes, I am using NTP and the time is updated right after boot.

eibgrad wrote:
How long of a lease is the ISP providing for the WAN?

As far I can see the WAN lease time is 90 minutes.

eibgrad wrote:
When it fails, can you get reconnected by simply renewing the lease from Status->WAN?

I do not have to press or do anything. The router reconnects just within a second. (The log in the first post shows the whole reconnecting process.)

I did some research and read about some similar problems. One approach is to add a firewall exception which did not work for me:
http://svn.dd-wrt.com/ticket/973 (this might be the most detailed description so far, if that's my actual problem)
http://www.dd-wrt.com/phpBB2/viewtopic.php?p=785380
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=175072
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=28200
Source: https://encrypted.google.com/search?q=%22vpn+modules+successfully+unloaded%22+site:www.dd-wrt.com

It seems I just have to handle the strange DHCP behavior of my ISP.
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 8034

PostPosted: Mon Jan 27, 2014 2:56    Post subject: Reply with quote
Yeah, I suspected it was a DHCP issue, just wasn’t sure exactly what. The fact it was happening at the halfway point of the lease also points the finger at DHCP. And that does sound like what's happening.

What I find strange is this doesn't seem to affect other routers w/ OEM firmware. And it only seems to affect those whose ISP is using relatively short leases (5-10 mins some cases, which is silly). You would think that adding the firewall rule shouldn’t be necessary for a stateful firewall. Obviously a UDP packet sent out on port 67 expects a response on port 68, and a properly working firewall would leave that port open, at least briefly in anticipation of the response. All I can think is maybe some ISPs are not responding quickly enough, and so just leaving it open solves the problem. Or as someone else suggested, the response is coming back from a different source ip than the original destination ip of the DHCP request, and so the router rejects it.

Still strange that the OEM firmware and other routers don’t have this problem. Perhaps they always leave port 68 open on the firewall, and/or don’t care about a change in ip, just to avoid this possible problem.

I’d be interested in whether the fix works.
Mile-Lile
DD-WRT Guru


Joined: 24 Feb 2013
Posts: 1462
Location: Belgrade

PostPosted: Mon Jan 27, 2014 8:13    Post subject: Reply with quote
See if this helps
http://svn.dd-wrt.com/ticket/3077
Mile-Lile
DD-WRT Guru


Joined: 24 Feb 2013
Posts: 1462
Location: Belgrade

PostPosted: Mon Jan 27, 2014 8:14    Post subject: Reply with quote
See if this helps
http://svn.dd-wrt.com/ticket/3077
renkforce
DD-WRT Novice


Joined: 18 Jan 2014
Posts: 15

PostPosted: Mon Jan 27, 2014 9:52    Post subject: Reply with quote
Finally I was able to determine and solve the problem.
After I added a firewall exception allowing inbound DHCP traffic, my connection still dropped after exactly 45 minutes.

Then I decided to handle the lease by myself and was able to renew the DHCP lease right before the drop would normally occur. This prevents the WAN disconnect/reconnect.
Code:
kill -USR1 `cat /var/run/udhcpc.pid` 2> /dev/null


To make this permanent, I created a crob job under Administration -> Management to renew the lease every 20 minutes. You should pick an interval less than half your lease time.
Code:
*/20 * * * * root /bin/kill -USR1 `/bin/cat /var/run/udhcpc.pid` 2> /dev/null


Thanks for your help on IRC and the forums.
rambotech
DD-WRT Novice


Joined: 27 Sep 2012
Posts: 3

PostPosted: Wed Sep 25, 2019 12:07    Post subject: Reply with quote
renkforce wrote:
Finally I was able to determine and solve the problem.
After I added a firewall exception allowing inbound DHCP traffic, my connection still dropped after exactly 45 minutes.

Then I decided to handle the lease by myself and was able to renew the DHCP lease right before the drop would normally occur. This prevents the WAN disconnect/reconnect.
Code:
kill -USR1 `cat /var/run/udhcpc.pid` 2> /dev/null


To make this permanent, I created a crob job under Administration -> Management to renew the lease every 20 minutes. You should pick an interval less than half your lease time.
Code:
*/20 * * * * root /bin/kill -USR1 `/bin/cat /var/run/udhcpc.pid` 2> /dev/null


Thanks for your help on IRC and the forums.


I have Spectrum in Florida (previously Bright House), and had the same issues. This solved the problem for me as well.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Atheros WiSOC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum