DHCP server offers same lease regardless of changed option

Simon Hobson dhcp1 at thehobsons.co.uk
Wed Jun 9 17:58:27 UTC 2021


Klemen Sladic <gosturnca at gmail.com> wrote:

> I have a question regarding valid leases.
> Let's say DHCP server is configured with a host entry using a custom DHCP option with some predefined value, like:
> 
> host host1 {
>    hardware ethernet 00:01:02:03:04:05;
>    option my-net-opt "host1_net_opt"; }
> 
> After host1 gets this lease and recognizes the option the lease is valid for (let's say) 10 days.
> 
> Now I reconfigure DHCP server by changing option value for that host, like:
> 
> host host1 {
>    hardware ethernet 00:01:02:03:04:05;
>    option my-net-opt "host1_net_opt_new"; } 
> 
> and restart the DHCP server.
> 
> What I am experiencing is that if host1 requests a new lease (after restart or renew) while the old one is still valid, it gets the same old lease with the old option value.
> 
> My questions are:
> 1. Is this expected behaviour or am I doing something wrong?
> 2. If this is how it works is there a way to somehow invalidate that old lease to force the server to create a new one with a new option value?

How did you determine that the changed information isn't sent ? By looking at the client's UI, or by looking at packets on the wire ?
For some clients, changes in options don't get actioned until a lease actually expires (or other combinations). Thus the server may update information, but the client not act on it.

So if you haven't done so already, use a packet sniffer and check what is actually sent on the wire.

If the server is still sending the old option value, then I'd look in the leases file to see what it is holding - note that it's an "append only" database, if there's more than one entry for the address then look at the last one in the file.

Simon



More information about the dhcp-users mailing list