Re: behaviour of TIMEOUT on version 7.0.0
Shyamlee Badole
Tue Aug 18 13:16:56 2020
Hi Roy,
Thank You for your response.
I've disabled the 'lastlease' option in the dhcpcd.conf file. And it's now
accepting the ip offered by the server.
Here instead of a timeout, the previous lease is getting expired.
But we want to keep the last lease.
There are instances like when the device boots up or when processes
restarts, the old lease should be used. It should not get a new one.
Is there a way we can achieve this new IP on timeout and keep the last
lease?
Thanks,
Shyamlee
On Mon, Aug 17, 2020 at 11:20 PM Roy Marples <roy@xxxxxxxxxxxx> wrote:
> On 17/08/2020 18:07, shamli badole wrote:
> > Hi Roy,
> >
> > Using dhcpcd 7.0.0.
> >
> > A router is configured for DHCP on eth1. When the WAN connection is
> switched
> > from one network to another, TIMEOUT event is observed after it tries to
> renew
> > the currently assigned lease.
> > After TIMEOUT a DHCP DISCOVER is sent. To which an ip is offered from
> another
> > server.
> > But the router is not able to acquire this lease. It keeps on sending
> DHCP
> > REQUEST to the server. Attached logs for reference.
> >
> > I observed this behaviour is because the old ip lease is maintained
> after TIMEOUT.
> > Since the old ip lease is not cleared, the DHCP REQUEST is sent back to
> the
> > previous DHCP Server and not the one which has assigned a new IP Address.
> >
> > Can You help in understanding why this behaviour is observed on TIMEOUT
> when the
> > dhcp server network is changed?
> >
> > I tested by explicitly clearing the old lease by making the s_addr =
> 0.0.0.0 in
> > the DHCP DISCOVER. In this case the DHCP DISCOVER and DHCP REQUEST both
> are
> > broadcast.
> > It accepts the ip which is offered by the server.
> >
> > Can you please guide on how the TIMEOUT needs to be handled? Does the
> > application need to reset the interfaces and release the dhcp lease?
> >
> > Thank you for your help.
>
> The key line from your logs is this:
> Jul 31 13:58:25 [7450]: eth1: timed out contacting a DHCP server, using
> last lease
>
> Does it work if you disable the non default option you set to use the last
> lease
> on timeout?
>
> Roy
>
Archive administrator: postmaster@marples.name