1

Recently my ISP had a major outage and since they came back up I have been having issues with DHCP leases. I am currently using a DLink router with FreshTomato and there were no such issues before this major outage.

The scenario is as such:

  1. Router gets lease and IP (IPv4) from ISP

  2. After 30 mins or 1 hour, I get no more internet access

  3. Router indicates WAN status is connected; There is still time remaining on the lease time.

  4. I have to manually renew the lease at the router in order to restore internet access

  5. Router gets new lease and NEW IP from ISP

My question here is :

  1. With regards to DHCP renewal, do I have any control over me receiving a new IP or am I at the mercy of my ISP?

  2. What controls over the DHCP lease do I have as a DHCP client (e.g. am I able to request for a new IP or am I at the mercy of the DHCP server?)?

2
  • I) What's the original lease duration as shown by your router? Is it more than 1 hour? The router is supposed to begin automatic renewal at half the duration. II) Does your router have any sort of "system log" where it would mention renewal attempts or at least renewal failures? III) At step #4, do you have to release the old lease? IV) What happens when you simply click "Renew" (not Release, just Renew) while the connection is still working fine? Does that succeed in extending the same lease? Commented May 14, 2020 at 9:41
  • 1) Original lease duration was 1 hour. It keeps "renewing" at half the duration (30min). Seems like this renewal does not cause any disruption to connectivity 2) syslogs indicate that dnsmasq is in use and exits on SIGTERM which seems to be consistent when i renew the lease 3) Nope, renewing will do the job for me. 4) Performing a release and renew will eventually have the same effect. To the router it "renews" the lease. I suspect issues with the ISP but am unable to pinpoint it due to my limited knowledge of DHCP servers
    – natchan
    Commented May 14, 2020 at 10:03

2 Answers 2

1

Technically you're always at the mercy of your ISP. Each ISP does their own thing, and their WAN DHCP systems can also work very differently from what you'd expect from a "normal" DHCP server.

2) What controls over the DHCP lease do I have as a DHCP client (e.g. am I able to request for a new IP or am I at the mercy of the DHCP server?)?

It depends on several things, e.g. how the server stores leases in its database:

  • Some DHCP servers implement "sticky" leases: they remember your lease in a database even after it expires and/or even if it's deliberately released, so you still get the same address on new requests.

  • Other DHCP servers only let you keep renewing a current lease infinitely, but as soon as it expires/gets released, it's gone – new requests pick an address from the available pool again.

(Some ISPs don't even allow renewal for more than X days, forcing you to get a new address every time. This still falls under "as soon as it expires it's gone".)

If you're renewing a 'current' lease, or if your ISP implements sticky leases, then it also depends on how the server identifies you as "still the same client".

  • Standard basic DHCP identifies clients by their "Client ID", or lacking that, by their MAC address. Different MAC address will get a different lease, but the same client moved to a different location will carry its address with it.

  • Some ISPs configure their DHCP server to identify clients by their physical connection (option 82), so you get the same address even if you replace the entire router.

1) With regards to DHCP renewal, do i have any control over me receiving a new IP or am i at the mercy of my ISP?

The button named "Renew" actually means "Do whatever you must to acquire an address, renewing the current lease if possible, but getting a new one if that fails."

Renewing a lease that you currently hold – if it hasn't expired yet – is supposed to keep exactly the same address as the lease originally had. After all, the "address lease" is literally a permission to use that specific IP address.

(This means a normal renewal doesn't cause any network disruption – not even for a millisecond. A host might keep renewing its address every hour for years, while still maintaining the same connections.)

But if you get a different address, this means the renewal failed and your router had to start the process from zero again, getting a new lease for you.

This might happen if the old lease actually expired (i.e. the router didn't automatically renew it in time). But it can also happen because some ISPs deliberately configure their DHCP servers to deny renewal after the original lease duration, to force you into getting a brand new lease every day.

Performing a release and renew will eventually have the same effect. To the router it "renews" the lease.

No, it's not the same thing from the DHCP server's perspective. The "release" operation doesn't just stop the process, it actually sends an indication to the server that it is now free to discard your old lease. It only so happens that some servers continue giving you new leases with the same address, but it's not required to.

"Renew" performs the opposite steps: first it specifically asks the server to re-issue the same address, and only if the server refuses, then your router asks for a brand new lease.

4
  • With regards to the release and renew, in the above scenario it does the same effect when it has dropped connectivity, should make that clearer; i do not intend to say that it has the same desired effect but i think you have also clarified on this point. I think your answer is clear and concise and has provided me with a more detailed understanding of how a DHCP server works. Thanks!
    – natchan
    Commented May 14, 2020 at 10:17
  • Despite having written all that, I still don't have a good idea as to why you would lose connectivity if the lease is valid and keeps being renewed. I suspect that's not a fault of your router, but something only your ISP can answer. Commented May 14, 2020 at 10:19
  • I was suspecting issues with their DHCP server because based on your explanation, if the lease is valid, i would still maintain my current IP however when i perform a renew, i am issued with a totally new IP which seems to indicate that the ISP is issuing me a lease that lasts an hour. Nothing much i can do here but hound on my ISP then. Thanks once again!
    – natchan
    Commented May 14, 2020 at 10:23
  • Hmm, even if the ISP deliberately limits how long you can keep renewing the lease, their server ought to refuse the final renewal that brings you beyond 1 hour, at which point dnsmasq would automatically start looking for a new lease from scratch (and yes, that would kill current connections)... I still think it's the ISP's fault, but maybe it's worth testing a different DHCP client just to see what happens. Commented May 14, 2020 at 10:34
1

This is a problem to raise with the Support of your ISP.

From your side, the most you can do is set your router (if possible) to renew the DHCP lease every 30 minutes. However, this may cause a disruption of all existing connections when it happens, so is not the best solution.

6
  • Just to check, if i use my router to perform a renew and it is still within the ISP's lease, it does "nothing" to the existing lease and IP, is this correct?
    – natchan
    Commented May 14, 2020 at 10:04
  • It does a lot : It will revoke the existing lease and create another that is good for the next 30 minutes. All ongoing connections will be closed. This might be at best a stop-gap measure until the ISP fixes their error. Question: Did you reboot the router since the problem occurred?
    – harrymc
    Commented May 14, 2020 at 10:13
  • Yep, the first step to any problem in IT is to restart the hardware... I think user1686 has provided me with the answers to my questions, however what you mention here is slightly different. I would assume his response makes sense in my context with my ISP. Do let me know if i have misunderstood the responses, thanks!
    – natchan
    Commented May 14, 2020 at 10:20
  • What you say is true for some ISPs (e.g. it looks like it's true in OP's situation), but it is not true for DHCP in general. Just using "Renew" does not revoke the existing lease in any DHCP client I've seen so far, nor should it. Commented May 14, 2020 at 10:21
  • I wouldnt say it is true in my situation, could be a ISP misconfig. Just to check, manually invoking lease renewal and the router automatically extending the lease time, are these the same action of "renewing the lease"? Or are these 2 different steps that i should be aware about.
    – natchan
    Commented May 14, 2020 at 10:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .