How can I "free up" a lease

Simon Hobson dhcp1 at thehobsons.co.uk
Thu Jul 17 18:07:27 UTC 2008


Gideon Viator wrote:

>I am trying to free a lease on my dhcp server. I went into the dhcpd.leases
>and deleted all instances of the IP address, and restarted the server.

Did you stop the server BEFORE editing the leases file ? If not, then 
the changes you made might not have taken affect if the server did a 
cleanup before you restarted it.

>However, when I renew on the device, the server always offers back the same
>IP address as before, instead of offering a new one.
>
>Am I missing something?

Many clients, in fact probably most with persistent storage, will 
remember the last address they had and request it when they next ask 
for a lease/extension. In fact, if the lease has not yet expired, the 
client will ask for an extension of it's current lease. In these 
cases, even if you have removed all trace of the address from the 
leases file and restarted the server, the client will get the same 
address back.

If you need a client to change address, one way is to remove it's 
current address from it's range statement. Say, for example, you have 
:

range 192.168.1.100 192.168.1.200

and you want all clients to leave the range .191 to .200, then you 
could just change this to :

range 192.168.1.100 192.168.1.190

When existing leases have expired, the 10 addresses will be free - 
but cllients will not be told to stop using any exising leases.

You can speed it up a bit by doing this :

range 192.168.1.100 192.168.1.190 ;
pool {
   range 192.168.1.191 192.168.1.200 ;
   deny booting ;
}

in which case, any client requesting to renew an existing lease in 
the .191 to .200 range will get a NACK - meaning "stop using that 
address NOW".


More information about the dhcp-users mailing list