Easiest way to delete expired DHCP leases? Or feature request for that ability?

Started by unquietwiki, February 06, 2016, 04:19:40 AM

Previous topic - Next topic
It seems despite DHCP being set to have leases on a 6-12h period, I have a backlog of leases going back to August. Just updated to 16.1 from 15.7, so curious to see if there's a safe way to purge the old expired leases, or if a feature could be added to wipe out all expired or offline leases. Thanks!

I have seen this as well in the 8.4 BSD version using in monowall. After some investigation I came to the conclusion this is how the DHCP Server works. It seems he has no aging built in.
Any comments to this from the experts?
Jakob

Might it not be that an expired lease may stay in the log until all addresses in the pool have been issued, and then it will overwrite expired ones?
Would need to look deeper into it, but that sounds plausible to me.
A way to avoid duplicate IP addresses, just in case, etc.
Hobbyist at home, sysadmin at work. Sometimes the first is mixed with the second.

Many DHCP services work like this by design, they won't start re-issuing used DHCP addresses if there are previously unused ones in the IP range given to it EVEN IF those leases have expired.

The simple answer is if that same device comes back onto the network at some point in the future it'll get (re)assigned the address it had before, even if its lease had expired. This can have some benefits both for logging and for devices that are really aggressive about getting the same address as they did once-upon-a-time.

Typically, once the never-used leases have been issued, it'll probably start from the bottom of the range and re-issue the oldest ones in a round-robin sort of fashion.

I've not hit the top of the range I assigned with my OpnSense install yet, but this seems to be the pattern it is following.