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

DHCP Lease Delete Button - $30

Scheduled Pinned Locked Moved Completed Bounties
19 Posts 7 Posters 21.0k 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.
  • D
    djamp42
    last edited by Apr 16, 2009, 10:07 PM

    Can someone add a simple delete button for a single DHCP lease. Multiple leases also preferred but not required.

    ;D ;D

    1 Reply Last reply Reply Quote 0
    • J
      jimp Rebel Alliance Developer Netgate
      last edited by Apr 16, 2009, 10:51 PM

      Shouldn't be too hard to do, stop dhcpd, read the leases, write back all except the record to delete, and then restart dhcpd

      I was looking at this earlier today.

      ISC DHCPD has a directive for the leases file that is supposed to cause it to delete an existing lease, but I could not get it to work.

      Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

      Need help fast? Netgate Global Support!

      Do not Chat/PM for help!

      1 Reply Last reply Reply Quote 0
      • J
        jimp Rebel Alliance Developer Netgate
        last edited by Apr 17, 2009, 12:46 AM Apr 17, 2009, 12:26 AM

        I have this working now, but needs testing. Any volunteers?

        nowyouseeit.png
        nowyouseeit.png_thumb
        nowyoudont.png
        nowyoudont.png_thumb
        diag_dhcp_leases.php.txt

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 0
        • J
          jimp Rebel Alliance Developer Netgate
          last edited by Apr 17, 2009, 3:30 AM

          Limited testing seems to have worked OK.

          Patch committed to HEAD (2.0).

          I am also going to make sure that when adding a static DHCP mapping, the old dynamic lease for the MAC is removed. Currently this results in a duplicate lease and a warning from dhcpd. After that point, this work may make it into 1.2.3 as a bug fix.

          Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

          Need help fast? Netgate Global Support!

          Do not Chat/PM for help!

          1 Reply Last reply Reply Quote 0
          • A
            AhnHEL
            last edited by Apr 17, 2009, 3:42 AM

            Seems to be working well on my pf box.  Much appreciated, thx.

            AhnHEL (Angel)

            1 Reply Last reply Reply Quote 0
            • W
              wonslung
              last edited by Apr 17, 2009, 4:26 AM

              will this patch work on 1.2.3

              1 Reply Last reply Reply Quote 0
              • J
                jimp Rebel Alliance Developer Netgate
                last edited by Apr 17, 2009, 11:49 AM

                @wonslung:

                will this patch work on 1.2.3

                The file I posted is for 1.2.2/1.2.3, yes. However, the code tree for 1.2.3 is restricted from general committing so I could only commit the patch to HEAD. When I get the other issues straightened out I will submit the patches for consideration for 1.2.3. The fix is the same for both branches.

                Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                Need help fast? Netgate Global Support!

                Do not Chat/PM for help!

                1 Reply Last reply Reply Quote 0
                • W
                  wonslung
                  last edited by Apr 17, 2009, 12:19 PM

                  i tried it in 1.2.3 and it didn't change anything

                  1 Reply Last reply Reply Quote 0
                  • J
                    jimp Rebel Alliance Developer Netgate
                    last edited by Apr 17, 2009, 12:44 PM

                    The choice to delete will only appear for offline leases.

                    I suppose that could be changed, but that seemed the safest course of action.

                    Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                    Need help fast? Netgate Global Support!

                    Do not Chat/PM for help!

                    1 Reply Last reply Reply Quote 0
                    • D
                      djamp42
                      last edited by Apr 17, 2009, 1:00 PM

                      @jimp:

                      The choice to delete will only appear for offline leases.

                      I suppose that could be changed, but that seemed the safest course of action.

                      Hmm, so if an active IP was deleted, and the user still had the DHCP address, i assume the DHCP server could possibly give out the same address to someone else, creating an IP conflict.

                      For troubleshooting purposes, it might be nice to be able to delete both, maybe a little note in the gui to explain deleting active leases.

                      When i can get the 1.2.3 release of this, i'll send over the bounty.

                      THANKS!

                      1 Reply Last reply Reply Quote 0
                      • J
                        jimp Rebel Alliance Developer Netgate
                        last edited by Apr 17, 2009, 1:18 PM

                        @djamp42:

                        Hmm, so if an active IP was deleted, and the user still had the DHCP address, i assume the DHCP server could possibly give out the same address to someone else, creating an IP conflict.

                        For troubleshooting purposes, it might be nice to be able to delete both, maybe a little note in the gui to explain deleting active leases.

                        When i can get the 1.2.3 release of this, i'll send over the bounty.

                        THANKS!

                        Actually, the DHCP server should test (via ping I believe) if an IP is active before it hands out a lease. I haven't tested it, but I'm not sure what would happen if the host in question blocks ping.

                        I think there are supposed to be safeguards in place to ensure that it doesn't hand out conflicting IPs, but I'm not sure how robust they are, hence my erring on the side of caution.

                        Attached is a version of the file that allows deleting active leases, give it a go and see what happens.

                        This file has not changed between 1.2.2 and 1.2.3, so the same file will work on both.

                        diag_dhcp_leases.php.123.txt

                        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                        Need help fast? Netgate Global Support!

                        Do not Chat/PM for help!

                        1 Reply Last reply Reply Quote 0
                        • D
                          djamp42
                          last edited by Apr 17, 2009, 2:45 PM

                          It works great here, though i notice my client will receive the same IP, no matter how many times i delete the lease and do a renew on my client.

                          I was under the impression that dhcpd saves all DHCP leases given, so if a client leaves and returns a month later, he'll receive the same IP. I don't really mind that, but it would be nice if the delete button would make it, so the client receives another IP the next time he renews, (or the same ip by chance)

                          1 Reply Last reply Reply Quote 0
                          • ?
                            Guest
                            last edited by Apr 17, 2009, 2:49 PM

                            This would appear to be a complete bounty.  Has the bounty been paid so I can classify this as a completed bounty?

                            1 Reply Last reply Reply Quote 0
                            • S
                              Seth
                              last edited by Apr 17, 2009, 2:50 PM

                              Your Windows client cant speak to other OSs will try and get the last IP that it had.

                              -Seth

                              1 Reply Last reply Reply Quote 0
                              • D
                                djamp42
                                last edited by Apr 17, 2009, 3:06 PM

                                @submicron:

                                This would appear to be a complete bounty.  Has the bounty been paid so I can classify this as a completed bounty?

                                We are in the process now,  should be completed by the end of the day.

                                1 Reply Last reply Reply Quote 0
                                • D
                                  djamp42
                                  last edited by Apr 17, 2009, 3:07 PM

                                  @Seth:

                                  Your Windows client cant speak to other OSs will try and get the last IP that it had.

                                  -Seth

                                  Ahhh so this is a feature of windows, rather then pfSense.

                                  Thanks,
                                  Adam

                                  1 Reply Last reply Reply Quote 0
                                  • J
                                    jimp Rebel Alliance Developer Netgate
                                    last edited by Apr 17, 2009, 4:07 PM

                                    It should be complete now.

                                    As Seth mentioned, a DHCP client can express a preference for an IP. It may not get it, but it can try.

                                    I'm not sure, but you can try to see if forcing an "ifconfig /release *" then "ifconfig /renew *" from the command prompt will make it pull a new IP after deleting the lease.

                                    Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                                    Need help fast? Netgate Global Support!

                                    Do not Chat/PM for help!

                                    1 Reply Last reply Reply Quote 0
                                    • D
                                      djamp42
                                      last edited by Apr 17, 2009, 4:36 PM

                                      This is completed, please close thread

                                      1 Reply Last reply Reply Quote 0
                                      • S
                                        sullrich
                                        last edited by Apr 1, 2010, 9:45 PM Mar 16, 2010, 9:46 PM

                                        This bounty has been completed and paid.  Thank you!

                                        1 Reply Last reply Reply Quote 0
                                        • First post
                                          Last post
                                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                                          This community forum collects and processes your personal information.
                                          consent.not_received