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

    DHCP not releaseing inactive leases

    Scheduled Pinned Locked Moved DHCP and DNS
    7 Posts 2 Posters 1.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.
    • H
      hakunaMatata
      last edited by

      DHCP is acting strange and after much troubleshooting it seems to be a bug or something wrong with pfsense setup.

      Problem: Old inactive dhcp leases are not recycled even though the device is offline and ping before reuse is active and new users unable to connect and get dhcp ip

      When I check the dhcp leases file, I found multiple devices with same IP, isnt the dhcp leases file suppose to update and delete the old unused devices?

      Temporary solution is to flush all dhcp leases.

      My main dhcp is 192.168.31.0/24 (the 192.168.10.0/24 is testing only)

      This is my dhcp config:

      option domain-name "removed.forprivacy.arp";
      option ldap-server code 95 = text;
      option domain-search-list code 119 = text;
      option arch code 93 = unsigned integer 16; # RFC4578
      
      
      default-lease-time 7200;
      max-lease-time 86400;
      log-facility local7;
      one-lease-per-client true;
      deny duplicates;
      update-conflict-detection false;
      authoritative;
      class "s_lan" {
      	match pick-first-value (option dhcp-client-identifier, hardware);
      }
      subnet 192.168.31.0 netmask 255.255.255.0 {
      	pool {
      
      		range 192.168.31.7 192.168.31.254;
      	}
      
      	option routers 192.168.31.1;
      	option domain-name-servers 192.168.31.1;
      	default-lease-time 14400;
      	max-lease-time 43200;
      	ping-check true;
      
      }
      class "s_opt1" {
      	match pick-first-value (option dhcp-client-identifier, hardware);
      }
      subnet 192.168.10.0 netmask 255.255.255.0 {
      	pool {
      
      		range 192.168.10.10 192.168.10.254;
      	}
      
      	option routers 192.168.10.1;
      	option domain-name-servers 192.168.10.1;
      	ping-check true;
      
      }
      

      no free lease.JPG leases e.JPG dhcp settings2 .JPG dhcp settings .JPG

      S 1 Reply Last reply Reply Quote 0
      • S
        SteveITS Rebel Alliance @hakunaMatata
        last edited by

        @hakunamatata A lease will remain active until it expires…your screenshot shows several expiring tomorrow. If you have a lot of devices that join briefly try a shorter lease time. Your default lease time is 4h but your screenshot shows all? at 10h, so maybe lower the max lease time also.

        Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
        When upgrading, allow 10-15 minutes to reboot, or more depending on packages, and device or disk speed.
        Upvote 👍 helpful posts!

        H 1 Reply Last reply Reply Quote 2
        • H
          hakunaMatata @SteveITS
          last edited by

          @steveits if you see the first one in the screenshot, it's already offline and the device left the location so why isn't the ip address being recycled? I thought it recycles automatically and apparently it's not.

          S 1 Reply Last reply Reply Quote 0
          • S
            SteveITS Rebel Alliance @hakunaMatata
            last edited by

            @hakunamatata its lease ends tomorrow 2:57 am :)

            Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
            When upgrading, allow 10-15 minutes to reboot, or more depending on packages, and device or disk speed.
            Upvote 👍 helpful posts!

            1 Reply Last reply Reply Quote 0
            • H
              hakunaMatata
              last edited by

              @steveits understood. Thanks.

              What about the online status and lease type?

              I am assuming online status means the device is connected If online and disconnected from the network if offline.

              If that's the case, can I write a cron job that if client offline for 2 hours release/delete the lease.

              S 1 Reply Last reply Reply Quote 0
              • S
                SteveITS Rebel Alliance @hakunaMatata
                last edited by

                @hakunamatata IIRC online means the MAC is in the ARP table meaning it’s had recent activity.

                You could just set the lease time to a half hour. Any online devices will renew.

                Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
                When upgrading, allow 10-15 minutes to reboot, or more depending on packages, and device or disk speed.
                Upvote 👍 helpful posts!

                H 1 Reply Last reply Reply Quote 1
                • H
                  hakunaMatata @SteveITS
                  last edited by

                  @steveits

                  working fine. thanks

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