WRT54GL WAN DHCP lease time reaching 0

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2, 3  Next
Author Message
aehimself
DD-WRT Novice


Joined: 19 Nov 2017
Posts: 22

PostPosted: Wed Sep 12, 2018 20:51    Post subject: WRT54GL WAN DHCP lease time reaching 0 Reply with quote
Since the forum timed me out and my original post was discarded, it will be a bit shorter this time, sorry Smile

With an earlier build (r36527-min) I experienced daily disconnects from the Internet. Connectinon was not re-eastablished until router reset (or later - automatic recovery by pinging Google's DNS). Then I upgraded to the latest published version (r36698-std) and the problem disappeared - my connection is stable for almost a week now.
What is bugging me is that on the Status screen I can see the WAN DHCP lease time reaching 0 continously. If I press renew (or execute "kill -USR1 $(head -n 1 /var/run/udhcpc.pid)") the timer jumps up to an hour, just to renew once or twice and to reach zero again.
I set "iptables -I INPUT -p udp --dport 68 -j logaccept" in the Firewall script already.

Router is connected to a modem-router (with all functions disabled, working as a modem only; no GUI, WRT54GL gets WAN IP) with no DMZ hosts set. Syslog shows nothing other than periodic NTP updates.

To recap: I have no disconnects anymore, only the WAN DHCP lease time is reaching 0 all the times.

Should I be worried? Is there a way to make sure that this is a GUI bug only, and I should not expect the disconnects to start all over again?

Thanks!
Sponsor
jxm
DD-WRT Guru


Joined: 23 Jul 2017
Posts: 726
Location: Brisbane, Australia

PostPosted: Thu Sep 13, 2018 3:52    Post subject: Reply with quote
I don't know if this is your problem, but apparently DHCP respons s from some ISPs are blocked by the DD-WRT firewall, and can be fixed by adding a firewall rule. Check the wiki at
https://wiki.dd-wrt.com/wiki/index.php/Iptables_command
and look for this heading
Firewall blocks DHCP renewal responses

Could be worth a try.

Cheers.
aehimself
DD-WRT Novice


Joined: 19 Nov 2017
Posts: 22

PostPosted: Thu Sep 13, 2018 6:25    Post subject: Reply with quote
Yes, I saw this topic and the rule is already set. I'm not a Linux / iptables expert, but I read that if you change ACCEPT with logaccept it will also log a message when the rule was hit. I have nothing in the logs, except for time synchronization.
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 2691
Location: Texas, USA

PostPosted: Thu Sep 13, 2018 9:44    Post subject: Reply with quote
You do have the firewall log enabled on the webUI on the security tab, I presume.
aehimself
DD-WRT Novice


Joined: 19 Nov 2017
Posts: 22

PostPosted: Thu Sep 13, 2018 17:59    Post subject: Reply with quote
Whoops Smile
Now I do and I can see the broadcast packet incoming every ~10 seconds. Thank you, kernel-panic69!

Now only one question remains. Why the timer is reaching 0 and why my internet doesn't disconnect when it does? Smile
jwh7
DD-WRT Guru


Joined: 25 Oct 2013
Posts: 2374
Location: Indy

PostPosted: Thu Sep 13, 2018 19:44    Post subject: Reply with quote
aehimself wrote:
Now only one question remains. Why the timer is reaching 0 and why my internet doesn't disconnect when it does? Smile
Maybe I'm missing something (no DD routers around atm), but isn't that how a DHCP timeout works? It counts down to 0, renews the lease, and resets the timer? Why is your timer set to just 1hr?
_________________
# NAT/SFE/CTF: limited speed w/ DD # Repeater issues # DD-WRT info: FAQ, Builds, Types, Modes, Changes, Demo #
x64 OPNsense 19.7.7|FT2019.3: EA6900v1.1@1GHz, F7D8302|DD 41596: WNDR4500v2, WNDR4000@533, R6300v1,
E2500, E1500@353, WRT54*@250: GLv1.1 nsg, GSv6 µ, RT-N66U@663
|OEM: WGR614v10@400 -> WNR1000v3 mod
aehimself
DD-WRT Novice


Joined: 19 Nov 2017
Posts: 22

PostPosted: Wed Sep 26, 2018 9:17    Post subject: Reply with quote
As far as I am aware DHCP renewal requests should start when the lease time reaches the half. If I get 12 hours from the ISP's DHCP server, renegotiating should start when the lease reaches 6 hours. The timer is not set on the client side (router) but it is "assigned" by the DHCP server.

Just for curiosity I set a logaccept rule to see the OUTGOING UDP packets from port 67.

@ jxm and everyone else wondering:
I strongly believe that the DHCP blocking was fixed sometime. I am running build r36698 and it seems I have duplicated INPUT rules for bootpc:

root@DD-WRT:~# iptables --list INPUT --verbose
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
846 278K logaccept udp -- any any anywhere anywhere udp dpt:bootpc
6517 766K ACCEPT 0 -- any any anywhere anywhere state RELATED,ESTABLISHED
0 0 ACCEPT udp -- vlan1 any anywhere anywhere udp spt:bootps dpt:bootpc
0 0 DROP udp -- vlan1 any anywhere anywhere udp dpt:route
0 0 DROP udp -- br0 any anywhere anywhere udp dpt:route
0 0 ACCEPT udp -- any any anywhere anywhere udp dpt:route
16 836 DROP icmp -- vlan1 any anywhere anywhere
0 0 DROP igmp -- any any anywhere anywhere
4 232 ACCEPT 0 -- lo any anywhere anywhere state NEW
4182 321K ACCEPT 0 -- br0 any anywhere anywhere state NEW
6825 730K DROP 0 -- any any anywhere anywhere

P.s.: I'm not a Linux/IPTABLES/DD-WRT expert, but I think those two bold lines effectively mean the same.
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 2691
Location: Texas, USA

PostPosted: Wed Sep 26, 2018 10:50    Post subject: Reply with quote
I can't remember off the top of my head if this device is VLAN 0 / VLAN1 or VLAN 1 / VLAN2. If the latter, VLAN2 is your WAN interface, VLAN1 is your LAN interface (technically, it is br0 in DD-WRT, but). Anyhow, the WAN lease is set by the ISP / ISP modem hardware, LAN is set within DD-WRT itself. I didn't particularly see this problem on the K3X builds, and haven't tested this on K2.6 builds as I was testing other E4200v1 / K2.6 build issues earlier.
aehimself
DD-WRT Novice


Joined: 19 Nov 2017
Posts: 22

PostPosted: Sun Sep 30, 2018 17:00    Post subject: Reply with quote
WRT54GL is a VLAN0/1 model, so the default firewall configuration is indeed letting the DHCP packets in.

Since my Internet went crazy again I could do some tests. My ISP initially gives a 1 hour lease, after that a 24 hour one. I kept a close eye on the timer, as soon as it reached 30 minutes the lease time jumped up to 24 hours. Even Syslog showed the outgoing packet:

Sep 30 18:45:50 DD-WRT user.warn kernel: ACCEPT IN= OUT=vlan1 SRC=my_wan_ip DST=isp_dhcp_ip LEN=328 TOS=0x00 PREC=0x00 TTL=64 ID=51114 DF PROTO=UDP SPT=68 DPT=67 LEN=308

So I already confirmed that DHCP packets are coming in and going out as they should. Guess I'll have to dig the logs tomorrow as the next automatic renewal should happen in ~12 hours.
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 5223
Location: Akershus, Norway

PostPosted: Sun Sep 30, 2018 19:45    Post subject: Reply with quote
I will suspect it's a display issue. With no decimals, it will show zero when there are less than 1 hour left.

On my R7800 it shows:

Remaining Lease Time: 0 days 00:17:13

Doesn't yours show the HH:MM:SS?
aehimself
DD-WRT Novice


Joined: 19 Nov 2017
Posts: 22

PostPosted: Mon Oct 01, 2018 21:42    Post subject: Reply with quote
@Per Yngve Berg
It does; by reacing 0 I mean absolute zero: 0 days, 0:00:00.

In the mean time I could capture a clue. Upon reaching 50% of the lease time I can see DHCP broadcasts flying in, but no DHCP response leaving the router! I'll disable the incoming packet logging to leave some room for more entries (syslog can only go back ~2 hours with them...) but I'm getting more confident that there's no point reporting the issue to the ISP as the cause will be my device.

P.s.: in the beginning I thought that reaching 0 lease time causes no Internet disconnect - it does, once my lease is being forced to time out! Leaving the device to stay on 0:00:00 will eventually cause the Internet to drop; only manual renew, router/modem restart or watchdog trigger can bring it back up.
As a dirty workaround I lowered the watchdog interval to 1 minute but I really would like to see this solved!
aehimself
DD-WRT Novice


Joined: 19 Nov 2017
Posts: 22

PostPosted: Tue Oct 02, 2018 20:45    Post subject: Reply with quote
Okay, so I let the router to run for more than necessary and there are no automatic outgoing renew requests from my device. The funny thing is that if I manually press "Renew" the lease time jumped up from 4h to 14 hours and I could see the outgoing packet in syslog.

This point I am certain that DD-WRT is NOT renewing the WAN DHCP lease automatically. This is confirmed by the amount of scripts online to check an IP and kill/restart udhcpd.

Is this normal behavior? Are only WRT54GLs affected? Or it's a problem with my device? Can anyone hit me with an URL where I can send a bug report? I really could use some adept support Sad
aehimself
DD-WRT Novice


Joined: 19 Nov 2017
Posts: 22

PostPosted: Wed Oct 10, 2018 7:57    Post subject: Reply with quote
For anyone else out there having the same issue - I managed to report a bug at https://svn.dd-wrt.com/ticket/6456.

Let's see if it can be fixed.
aehimself
DD-WRT Novice


Joined: 19 Nov 2017
Posts: 22

PostPosted: Mon Nov 05, 2018 21:29    Post subject: Reply with quote
Long time, long silence. Seems the issue seems to be... "unique".
I managed to keep my internet connection up for a month by logging in twice per day and forcing to renew the WAN DHCP lease but it is getting a pain in the back. I'd like to write an application to do that for me.

A simple GET request to Status_Internet.asp will show me the remaining lease time but I have big troubles with virtually pressing the renew button. I tried a POST request to apply.cgi (with change_action=gozilla_cgi and submit_type=renew parameters) but it only leads me to a bad request or immediate disconnect. And it's not a redirect Sad

Can anyone point me to the direction in how can I press the "Renew" button on the Status / WAN page with HTTP requests only?
aehimself
DD-WRT Novice


Joined: 19 Nov 2017
Posts: 22

PostPosted: Tue Nov 06, 2018 14:02    Post subject: Reply with quote
So after inserting all the necessary fields (submit_button, change_action, action, submit_typ) and HTTP headers to my request I finally get the same status page as response. Turns out apply.cgi will simply disconnect if necessary parameters are missing.

There's only one catch: apply.cgi does not seem to perform the action itself. If I kill -USR1 "$(pidof "udhcpc")" via SSH and collect the status page with my script after, I can see the lease time changing, but I can not FORCE dhcp_renew to be executed via a HTTP request... will do some more digging. It will go kind of slow because of the one day lease time from my ISP
Goto page 1, 2, 3  Next Display posts from previous:    Page 1 of 3
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC 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 can attach files in this forum
You can download files in this forum