I am having an issue with my ISP and the WAN DHCP lease times. It seems like the ISP changes their DHCP lease times from 4 hours to 10 minutes depending on network load. This change is broadcast to their hardware but not to my OpenWRT router. I think this causes my OpenWRT router to lose it's IP adress since it requests a new DHCP lease every 2 hours (even during times when the ISP drops it to 10 minutes). ISP Forum with Detailed Info
Is there a way that I can schedule or force a DHCP renewal every 10 minutes? Maybe a cron job or WAN/WAN6 setting?
It also looks like I could go into a Double NAT situation (no bridge mode) and that would keep things working with the downside of Double NAT.
There are 2 main ISP's in my area. Shaw and Telus. Shaw offers internet via coax and Telus offers Fiber Optic internet.
I ran my own hardware with Shaw for 5-6 years with Zero issues. Their modem was in bridge mode. I got a public IP and ran everything on OpenWRT.
I've been wanting to switch to Telus for the better upload speed; 700 mbps Telus vs 25 mbps Shaw. But Telus seems to reduce their DHCP lease times based on network constraints. That's been causing these random lease issues and internet connectivity.
There's always a double NAT setup but I don't really want to go that route...
I can plug into the ONT, but that leads to the DHCP lease issues. For example, OpenWRT runs amazing plugged directly into the ONT. But randomly the internet completely stops working due to the changing DHCP lease times. It could be 12 hours or it could be 5 days.
There's also the potential for static public IP but I haven't tried that yet.
That seems to work. I can run the kill command during a speed test and there is no impact on the data transfer. I'll set this up as a cron job and see how that goes.
Tue Apr 5 11:35:00 2022 daemon.notice netifd: wan (6971): udhcpc: sending renew to server 10.27.191.25
Tue Apr 5 11:35:00 2022 daemon.notice netifd: wan (6971): udhcpc: lease of 173.183.xx.xx obtained from 10.27.xx.xx, lease time 14400
But the IPv4 upstream on the OpenWRT status page doesn't update with the new lease time:
I'm not so worried if the lease doesn't renew according to OpenWRT. I just want to make sure that if my ISP switches to 10 minute leases, I catch the change with a renewal request.
Thanks for the help. I think I have my issue resolved and wanted to post a quick update.
I really think it is an issue with DHCP lease time and my ISP (Telus Fiber in Canada). I've been running kill -USR1 $(pidof udhcpc) as suggested by @dave14305 in a cron job every 7 minutes and that seems to have fixed my issue.
The usual log records when the cron job runs are the first 3 lines below. The fourth line appears roughly every 2 hours (coincides with 50% of a 4 hr dhcp lease time) but sometimes appears earlier (<10 minutes). I have a strong feeling that the slightly more than 2 hour windows and the <10 minute windows caused my external IP address to get reassigned to a different user and I would loose my internet connection. It didn't happen to me everyday, but would usually happen between 1 and 4 days. The appearance of the 4th line is the only indication I can find that something has been updated with my external dhcp address.
Thu Apr 7 06:00:00 2022 cron.err crond[8710]: USER root pid 15198 cmd kill -USR1 $(pidof udhcpc)
Thu Apr 7 06:00:00 2022 daemon.notice netifd: wan (6971): udhcpc: sending renew to server 10.27.191.25
Thu Apr 7 06:00:03 2022 daemon.notice netifd: wan (6971): udhcpc: lease of 173.183.xxx.xxx obtained from 10.27.xxx.xxx, lease time 14400
Thu Apr 7 06:00:03 2022 daemon.notice netifd: wan (6971): udhcpc: broadcasting renew
Here is a summary table of just the broadcast renewal lines. I've starred the lines showing short external dhcp changes.