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

    DHCPd how to Remove expired leases

    Scheduled Pinned Locked Moved DHCP and DNS
    3 Posts 3 Posters 2.1k 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.
    • T Offline
      Truster
      last edited by

      Hello all,

      for low-end system there should an option, to remove all expired DHCP leases from its Lease file.

      background. i've had configured a class B net like 172.16.0.0/16 DHCP Range from 1.1 to 255.254 The Lease files grows up to 360000 lines and the DHCP server acts painfully slow,  and makes duplicate records like this:

      
      lease 172.27.247.204 {
        starts 2 2015/03/10 15:49:48;
        ends 2 2015/03/10 16:19:48;
        cltt 2 2015/03/10 15:49:48;
        binding state active;
        next binding state free;
        rewind binding state free;
        hardware ethernet dc:9b:9c:cb:13:0d;
        uid "\001\334\233\234\313\023\015";
        client-hostname "XXXA";
      }
      
      lease 172.27.247.204 {
        starts 2 2015/03/10 15:50:51;
        ends 3 2015/03/11 15:50:51;
        cltt 2 2015/03/10 15:50:51;
        binding state active;
        next binding state free;
        rewind binding state free;
        hardware ethernet dc:9b:9c:cb:13:0d;
        uid "\001\334\233\234\313\023\015";
        client-hostname "XXXA";
      }
      lease 172.27.247.204 {
        starts 2 2015/03/10 15:50:52;
        ends 2 2015/03/10 16:20:52;
        cltt 2 2015/03/10 15:50:52;
        binding state active;
        next binding state free;
        rewind binding state free;
        hardware ethernet dc:9b:9c:cb:13:0d;
        uid "\001\334\233\234\313\023\015";
        client-hostname "XXXA";
      }
      lease 172.27.250.254 {
        starts 2 2015/03/10 15:50:53;
        ends 3 2015/03/11 15:50:53;
        cltt 2 2015/03/10 15:50:53;
        binding state active;
        next binding state free;
        rewind binding state free;
        hardware ethernet c8:e0:eb:8e:f7:6c;
        uid "\001\310\340\353\216\367l";
        client-hostname "XXXB-iPhone";
      }
      lease 172.27.250.254 {
        starts 2 2015/03/10 15:50:54;
        ends 2 2015/03/10 16:20:54;
        cltt 2 2015/03/10 15:50:54;
        binding state active;
        next binding state free;
        rewind binding state free;
        hardware ethernet c8:e0:eb:8e:f7:6c;
        uid "\001\310\340\353\216\367l";
        client-hostname "XXXB-iPhone";
      }
      

      i stopped the server and trashed the lease files and shinked the pool for now…

      best regards

      Dave

      1 Reply Last reply Reply Quote 0
      • G Offline
        gderf
        last edited by

        Do you really need an address space / DHCP scope that has over 65,500 possible hosts?

        1 Reply Last reply Reply Quote 0
        • DerelictD Offline
          Derelict LAYER 8 Netgate
          last edited by

          It's just doing what you've told it to do.  Reduce your subnet size if you don't want it that big (or at least the DHCP Server's pool).

          Chattanooga, Tennessee, USA
          A comprehensive network diagram is worth 10,000 words and 15 conference calls.
          DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
          Do Not Chat For Help! NO_WAN_EGRESS(TM)

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