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

    How do you release existing DHCP lease?

    Scheduled Pinned Locked Moved DHCP and DNS
    10 Posts 5 Posters 1.5k 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.
    • J
      jazzmonger
      last edited by jazzmonger

      Twice now I've run into this. I define a new static Mac-ip address pair and save and deploy and I get 2 listings for the same MAC address in the dhcp table. I thought this was impossible. Apparently not...

      DHCP table

      there must be a way to manually release a specific dhcp lease? This is driving me insane.

      I lost all my configs when I tried upgrading to 24.03 and bricked my Netgate 1100. So I'm starting over. All my IP cameras need static mappings so my NVR will work.

      J GertjanG 2 Replies Last reply Reply Quote 0
      • J
        Jarhead @jazzmonger
        last edited by

        @jazzmonger Are you using KEA DHCP? If so, don't. It's not ready and I've seen the double assignment when using it also.

        J 1 Reply Last reply Reply Quote 0
        • J
          jazzmonger @Jarhead
          last edited by jazzmonger

          @Jarhead

          I was and reverted to ISC. No change... I even deleted and reassigned them.

          This just in:
          You can accomplish that by deleting the dhcp.leases file. You can execute the command below from the Diagnostics/Command Prompt.

          rm /var/dhcpd/var/db/dhcpd.leases*


          Thank you,
          Danilo

          Netgate Global Support

          AndyRHA 1 Reply Last reply Reply Quote 0
          • AndyRHA
            AndyRH @jazzmonger
            last edited by

            @jazzmonger Your experience is odd to me. When I add a new camera or other thing that needs a DHCP reservation, I let it get a random address, then create the reservation for the address I want it to have and restart the system. When it returns it gets the new address.
            Admittedly I am only looking at the result, "does it get the new address", I am not looking at what DHCP has because the result is correct. It may keep the other address for a bit.

            o||||o
            7100-1u

            johnpozJ 1 Reply Last reply Reply Quote 0
            • johnpozJ
              johnpoz LAYER 8 Global Moderator @AndyRH
              last edited by johnpoz

              @AndyRH yeah I have never bothered to look into that, when I add a new device to the network.. I let it get an IP from dhcp, then setup the reservation and reboot or renew and let the device gets its new reserved IP.

              I don't recall bothering to look if the old lease is still listed as long as my device gets the IP I want it to get. I would assume once the old dynamic lease has actually expired you should be able to just delete it with the trashcan icon..

              example - just took a look, clicked the show all configured leases and can see quite a few old leases for stuff I moved to reserved lease

              Here is one for example

              allconfig.jpg

              My UC (unifi controller vm) had gotten 2.212 when I brought it up back in jan.. I then set a reservation for it for 2.13 and it now gets that address.. I could just click the trashcan icon to remove the old lease..

              here is another example of same thing, device got a dynamic IP - then created a reservation.. I could delete the old lease if I cared to by just clicking the trashcan.. But I don't think pfsense lets you delete a lease that is still valid, even if the client is currently offline

              anotherexample.jpg

              An intelligent man is sometimes forced to be drunk to spend time with his fools
              If you get confused: Listen to the Music Play
              Please don't Chat/PM me for help, unless mod related
              SG-4860 24.11 | Lab VMs 2.8, 24.11

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

                @jazzmonger said in How do you release existing DHCP lease?:

                there must be a way to manually release a specific dhcp lease? This is driving me insane.

                If you really want to force things on the DHCP server side :
                Create an entry here "DHCP Static Mappings".
                Now stop the DHCP server (dashboard GUI).
                Delete /var/dhcpd/var/db/dhcpd.leases and dhcpd.leases~ These two filers are the 'memory' of the DHCP server. Btw : I never had to do this.

                Disconnect the LAN client.

                Reconnect the LAN client. The LAN client will ask for a lease, and it might even ask for a specific (now old) IP (Lease).
                The server has the authority to override, and will give whatever you specified in your "DHCP Static Mappings".
                Done.

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

                J 1 Reply Last reply Reply Quote 0
                • J
                  jazzmonger @Gertjan
                  last edited by

                  @Gertjan
                  Don't have trash cans next to all of my leases, only some of them. Any idea why?

                  johnpozJ GertjanG 2 Replies Last reply Reply Quote 0
                  • johnpozJ
                    johnpoz LAYER 8 Global Moderator @jazzmonger
                    last edited by

                    @jazzmonger said in How do you release existing DHCP lease?:

                    only some of them. Any idea why?

                    because they are prob active.. Like I said I don't think pfsense will let you delete an active lease, even if the client is offline.

                    An intelligent man is sometimes forced to be drunk to spend time with his fools
                    If you get confused: Listen to the Music Play
                    Please don't Chat/PM me for help, unless mod related
                    SG-4860 24.11 | Lab VMs 2.8, 24.11

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

                      @jazzmonger

                      You can't 'delete' a Lease on the server side.
                      Given == given.
                      There is no such thing as a web/mail/dhcp/whatever server contacting the client back to say "no wits over".
                      Communication is initiated - always - by a client, and it connects to, a 'server'. Communication is done. And then it's over.

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

                      1 Reply Last reply Reply Quote 0
                      • AndyRHA
                        AndyRH
                        last edited by

                        Other than DHCP showing the in-scope lease and the out-of-scope reservation, are you having an issue?
                        Is the client receiving the expected address?

                        o||||o
                        7100-1u

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