DHCP Lease

Simon Hobson simon at thehobsons.co.uk
Thu Jun 9 15:06:33 UTC 2022


Soporte VT <soporte at vallecastelecom.com> wrote:

> I want to delete a lease, for example, this one below instead of waiting eight hours. What is the correct way to do it? I mean, I do not want to screw the DHCP service up. So, could someone give me some advice to approach this task? Thanks a lot.

As greg has already indicated, there are a number of ways, and the “best” (or perhaps, "least bad”) will vary depending on the reason.

Looking at some of the values in that lease (particularly the presence of agent.circuit-id), I’m going to hazard a guess that there’s some form of “assign lease based on circuit ID” logic going on, and this causes a problem when the client changes and there’s no free lease.

Perhaps the cleanest approach might be to use OMAPI to change the expiry time of the lease to “not far into the future” so that the server will expire the lease itself and clean up (DDNS, execute any scripts, etc) automatically. I’ve not used OMAPI myself, and don’t use failover these days (only have my home network to manage), but I believe you have to do this on both servers.

Otherwise, as Greg says, you can stop the server and delete all entries for the lease - but you’ll have to do your own cleanup. With failover there is the complication that agin, you have to do this on both servers - with scope for a service interruption if you don’t manage timings & failover states well.

Kind of thinking around the issue, I also wonder if there’s scope to create a lease update that would replace the lease with a blank free or soon to expire version (basically, the bare minimum needed for the server to recognise it as a lease for that IP) in such a way that doing it on one server would automatically duplicate it to the other.
Perhaps a simple script that injects a DHCP-Release message to one or other server ?

Regards, Simon



More information about the dhcp-users mailing list