RE: Extending a lease when dhcp server is offline (similar to lastleaseextend)
Matthew Clarkson
Tue Sep 01 00:47:24 2020
Hi Roy,
Again, thanks for the quick responses.
I had a bit of trouble applying those patches, looks like https://roy.marples.name/cgit/dhcpcd.git/commit/?id=b336d43584f8d759acbae668690c6415ca05618f is also required (as one patch uses the dhcp_unlink added in that commit). Before chasing down more commits I have updated to version 9.1.4 and applied the 4 patches you sent.
I can confirm that after the lease expires, the client sends dhcp discover requests (as broadcasts) roughly every 30 seconds. But there is a new problem. With the lastleaseextend option, the device is not binding to the previous lease's IP. It is bound to a link-local address. In 8.1.9, the interface would be using both a link local address and the address of the previous lease.
In 8.1.9 the output after failing to renew is:
br0: failed to renew DHCP, rebinding
br0: DHCP lease expired, extending lease
br0: pid 0 deleted IP address 192.168.10.20/24
br0: deleting route to 192.168.10.0/24
br0: deleting default route via 192.168.10.1
br0: rebinding lease of 192.168.10.20
br0: probing for an IPv4LL address
br0: timed out contacting a DHCP server, using last lease
br0: leased 192.168.10.20 for 600 seconds
br0: adding route to 192.168.10.0/24
br0: adding default route via 192.168.10.1
br0: soliciting a DHCP lease
br0: using IPv4LL address 169.254.18.158
br0: adding route to 169.254.0.0/16
br0: changing default route
br0: deleting route to 192.168.10.0/24
br0: pid -128819375 deleted default route
br0: adding default route
In 9.1.4 it is:
br0: failed to renew DHCP, rebinding
br0: DHCP lease expired, extending lease
br0: soliciting a DHCP lease
br0: pid 0 deleted IP address 192.168.10.20/24
br0: deleting route to 192.168.10.0/24
br0: deleting default route via 192.168.10.1
br0: rebinding lease of 192.168.10.20
br0: probing for an IPv4LL address
br0: timed out contacting a DHCP server, using last lease
br0: probing address 192.168.10.20/24
br0: soliciting a DHCP lease
br0: using IPv4LL address 169.254.18.158
br0: adding route to 169.254.0.0/16
br0: adding default route
Any thoughts?
Thanks!
-----Original Message-----
From: Roy Marples <roy@xxxxxxxxxxxx>
Sent: Sunday, August 30, 2020 1:54 AM
To: dhcpcd-discuss@xxxxxxxxxxxx
Subject: Re: Extending a lease when dhcp server is offline (similar to lastleaseextend)
On 30/08/2020 09:24, Roy Marples wrote:
> I think I have this issue fixed here:
> https://roy.marples.name/cgit/dhcpcd.git/commit/?id=4505b767ef2a91d0889b2e586d2f47688fe989d7
One more fix:
https://roy.marples.name/cgit/dhcpcd.git/commit/?id=91ab9979061caf1c858bc5a104baa1b8cc694ec1
Roy
Archive administrator: postmaster@marples.name