Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Delete/Clear unused-Abandoned DHCP Leases

    Scheduled Pinned Locked Moved DHCP and DNS
    3 Posts 2 Posters 740 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      CloudNode
      last edited by

      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?
      e606f9b5-f379-482d-8ee5-4a3347ac943e-image.png
      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

      GertjanG 1 Reply Last reply Reply Quote 0
      • GertjanG
        Gertjan @CloudNode
        last edited by

        @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.

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        C 1 Reply Last reply Reply Quote 1
        • C
          CloudNode @Gertjan
          last edited by

          @Gertjan ah ok, now that makes sense. In this case i will leave it the way it is. Thanks

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.