Re: Extending a lease when dhcp server is offline (similar to lastleaseextend)
Roy Marples
Fri Aug 28 10:54:19 2020
Hi Mathew
On 28/08/2020 01:05, Matthew Clarkson wrote:
Hello,
We are looking at using this dhcpcd project as the dhcp client in a new
product, and we are trying to match the behaviour of an older client in
an older product. The version we are looking at is 8.1.9.
The specific case we are looking at is when the dhcp server goes
offline. We would like to see the device attempt to rediscover and if
the server doesn’t respond then bind to the previous address for a short
period of time, and repeat until the server is back.
As I understand, this is similar to –lastleaseextend except that
lastleaseextend is using the full lease time of the last received lease.
The concern is that if the server is offline temporarily or moved, maybe
to change the ip subnet, then it could take a long time for the device
to resync.
As an example, if the device previously received a lease for
192.168.10.18 (leasetime 2 hours) and on the next rebind attempt the
device would look like:
<server offline>
192.168.10.18 -> 255.255.255.255 DHCP Request
<no response>
0.0.0.0-> 255.255.255.255 DHCP Discover
<no response>
<2 minutes later>
0.0.0.0-> 255.255.255.255 DHCP Discover
<repeat>
Instead it looks like:
192.168.10.18 -> 255.255.255.255 DHCP Request
<no response>
<2 hour later>
0.0.0.0 -> 255.255.255.255 DHCP Request
Is there another option which will behave as we are expecting, or are
there options to modify the behaviour of lastleaseextend (such as
setting a shorter lease time for the extension)?
Looks like a bug to me.
With lastlease and lastleaseextend there is still supposed to be
periodic DHCP requests upto a maximum of 60 seconds + ramdomisation
intervals.
I'm currenty on holiday and have a small backlog of issues to work
through, but I'll try and give a better answer with a patch sometime
next week.
Roy
Archive administrator: postmaster@marples.name