Delete/Clear unused-Abandoned DHCP Leases
-
Hello; Iwent into the my DHCP Lease page and at the bottom i clicked on Show All Configured Leases and shows a large amount of leases in use for my VLANs. For one of my VLANS i know i have 10 static devices and this show Used: 76. I clicked on clear all DHCP Leases but that did nothing.
Is there a way to clean this all up?
Example, SecurityCam Network - I have 10 static IP's and no DHCP devices in that network yet this is showing me that I have 77 -
@iptvcld said in Delete/Clear unused-Abandoned DHCP Leases:
I clicked on clear all DHCP Leases but that did nothing.
To really clean things up, use a keyboard, not a mouse.
Goto /var/dhcpd/var/db/
Stop all the dhcp servers.
Remove (== 'mv' them to another file name !)
Start the dhcp servers.Be aware that you didn't really clean, and you actually somewhat broke the functionality of DHCP.
When a device connects to a network, it will recall this network for later usage (by probably keeping the MAC of the gateway/DHCP server) so when it connects the next time, it will ask for the same IP.
The DHCP will recall the device, as it stored the IP and device's MAC in to dhcpd.leases file.
These files are actually the 'memory' of the DHCP server.If you have a pool of 100 IPs, and the file is full with '100' configured devices (IP and MAC) and 101 is needed, the DHCP server will remove the oldest info to make place for IP number 101.
So, actually, there is nothing to clean .... it's the way DHCP works.
-
@Gertjan ah ok, now that makes sense. In this case i will leave it the way it is. Thanks