What's new

Lease Time

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

Jonnny

Occasional Visitor
Hello,

I have defined in my router's DHCP Server, the lease time for 3 days (259200s).

1687518670081.png


But after 24 hours, checking the syslog, the IP renewal appears.

Even though the DHCP leases page shows the date as 3 days.

1687518826157.png


In the "dnsmasq.conf" file, the defined time appears.

Happens to devices connected by Wireless and Ethernet.

Is this behavior normal?

Thanks.
 
It depends on the client, but the RFC states that DHCP clients should begin attempting to renew their lease once the current lease has reached 50% of its allotted time (i.e. 1.5 days).
 
Thanks for reply.

On my previous ASUS router (87u) this did not happen.

So a "solution" is to double the intended time?

It happens on all devices, be it Win, Linux, Android, etc.
 
On my previous ASUS router (87u) this did not happen.
I don't know why that didn't happen before. Perhaps you didn't notice or there was a bug in the 87U's version of dnsmasq. As I said, lease renewal is initiated by the client, not the router.

So a "solution" is to double the intended time?
Yes, because at the moment it's working as it's meant to.
 
Hello,

I have defined in my router's DHCP Server, the lease time for 3 days (259200s).

View attachment 51250

But after 24 hours, checking the syslog, the IP renewal appears.

Even though the DHCP leases page shows the date as 3 days.

View attachment 51251

In the "dnsmasq.conf" file, the defined time appears.

Happens to devices connected by Wireless and Ethernet.

Is this behavior normal?

Thanks.

Every time a device sleeps and wakes, it will renew. Every time wireless disconnects and reconnects (or wired unplug and replug or adapter bounces), it will renew. Various OSes will renew their leases at various "percent remaining" times. Reboot the router and all your devices will renew. It is normal and expected behavior. Why is this a concern? It means the device is still active. Any device that is offline for 3 days will lose its lease in your router (but as long as the IP isn't in use, it will probably get it back if it asks for it).

If your old router didn't do it, either you weren't paying as much attention (and it did do it) or there was a GUI bug of some sort.
 
I don't know why that didn't happen before. Perhaps you didn't notice or there was a bug in the 87U's version of dnsmasq. As I said, lease renewal is initiated by the client, not the router.


Yes, because at the moment it's working as it's meant to.
Thanks again.

I'll try to double the time and see how it behaves.
 
Every time a device sleeps and wakes, it will renew. Every time wireless disconnects and reconnects (or wired unplug and replug or adapter bounces), it will renew. Various OSes will renew their leases at various "percent remaining" times. Reboot the router and all your devices will renew. It is normal and expected behavior. Why is this a concern? It means the device is still active. Any device that is offline for 3 days will lose its lease in your router (but as long as the IP isn't in use, it will probably get it back if it asks for it).

If your old router didn't do it, either you weren't paying as much attention (and it did do it) or there was a GUI bug of some sort.

I don't know if it was a bug in my previous router or not. The fact is that this router happens. I also don't know if it's actually the dnsmasq version.

I have ssh session tailing syslog, so at the end of the day I monitor if any errors happened (I don't use the GUI part as a reference, but for comparison).

In this case they are devices that are always connected (no network interruptions). Nobody said it was a problem, but rather to know if this behavior is normal. I know that if there is an interruption between the router and the client, a new request will be made, normal. But if it is just the router to be restarted, the client maintains the lease.

As @ColinTaylor say, "...current lease has reached 50% of its allotted time (i.e. 1.5 days)." this makes more sense.
 
I don't know if it was a bug in my previous router or not. The fact is that this router happens. I also don't know if it's actually the dnsmasq version.

I have ssh session tailing syslog, so at the end of the day I monitor if any errors happened (I don't use the GUI part as a reference, but for comparison).

In this case they are devices that are always connected (no network interruptions). Nobody said it was a problem, but rather to know if this behavior is normal. I know that if there is an interruption between the router and the client, a new request will be made, normal. But if it is just the router to be restarted, the client maintains the lease.

As @ColinTaylor say, "...current lease has reached 50% of its allotted time (i.e. 1.5 days)." this makes more sense.

Yes if a device is on 100% of the time, never sleeps, never disconnects, 50% is pretty standard, but some devices vary. My guess is your old router may have been set to a longer lease time so you didn't see those messages as much, or you didn't have the log level set as high so you weren't receiving those messages at all.

I have my leases set to 30 days (requires a script as the GUI limit is 7 days), but you can even go 90, or infinite. When infinite, I'm not sure if/when the devices will ever renew (other than when the connection is interrupted or they sleep/restart, etc).
 
Couple of questions...

If you look at /var/lib/misc/dnsmasq.leases what does it show for remaining lease times (as far as dnsmasq is concerned - ignoring what the clients are doing).

Second (just to double check) - are you using a recent version of YazFi? I don't think it will matter as you say it affects wired as well as wireless but that had some enhancements recently to set lease time by guest network so anything connected on those may still be running against 1 day instead of 3.
 
Yes if a device is on 100% of the time, never sleeps, never disconnects, 50% is pretty standard, but some devices vary. My guess is your old router may have been set to a longer lease time so you didn't see those messages as much, or you didn't have the log level set as high so you weren't receiving those messages at all.

I have my leases set to 30 days (requires a script as the GUI limit is 7 days), but you can even go 90, or infinite. When infinite, I'm not sure if/when the devices will ever renew (other than when the connection is interrupted or they sleep/restart, etc).

On my old router, it was set to the same time. At this moment I changed it from 3 to 6 days, to verify the behavior (restarted router + all devices).

Is this tutorial/script you are referring to?

Thanks.
 
Couple of questions...

If you look at /var/lib/misc/dnsmasq.leases what does it show for remaining lease times (as far as dnsmasq is concerned - ignoring what the clients are doing).
Hi,

Checking the file, it seems to assume the defined value:

1687695107288.png


1687695244714.png


Note: in each line of the device "01:" is inserted at the beginning of the MAC, is this normal?

Second (just to double check) - are you using a recent version of YazFi? I don't think it will matter as you say it affects wired as well as wireless but that had some enhancements recently to set lease time by guest network so anything connected on those may still be running against 1 day instead of 3.

I don't use any addons.
 
On my old router, it was set to the same time. At this moment I changed it from 3 to 6 days, to verify the behavior (restarted router + all devices).

Is this tutorial/script you are referring to?

Thanks.

Yes, that is what I've done to mine.
 
Similar threads
Thread starter Title Forum Replies Date
P Dropp lease for IP Asuswrt-Merlin 9

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top