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

    PfSense 2.3.1 - Remove stale static mapping

    DHCP and DNS
    5
    9
    4.8k
    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.
    • Y
      yay
      last edited by

      Hi all,

      please have a look at the images attached to this thread.
      I've got a stale/ghost entry in both the dhcp leases and static mappings section. How could I delete that specific entry? Hitting the trash can inside the static mappings section does not help unfortunately.

      Cheers
      mapping.png
      mapping.png_thumb
      leases.png
      leases.png_thumb

      1 Reply Last reply Reply Quote 0
      • K
        kpa
        last edited by

        For the ghost lease:

        Stop the DHCPD service and edit the offending entries way from /var/dhcpd/vardb/dhcpd.leases and /var/dhcpd/vardb/dhcpd.leases~

        Start the DHCPD after you're done with editing.

        Not sure if the mapping requires direct editing of the XML configuration file and restoring it.

        1 Reply Last reply Reply Quote 0
        • Y
          yay
          last edited by

          That specific lease does not appear in both /var/dhcpd/var/db/dhcpd.leases and /var/dhcpd/var/db/dhcpd.leases~. The last line contains a server-duid.

          I already had at the XML but I couldn't find anything related. Which tag should contain the mapping?

          1 Reply Last reply Reply Quote 0
          • Y
            yay
            last edited by

            Does anyone have any further hints for me? "Bugsmell" maybe?

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

              I'm currently running 2.2.6

              If I want to remove a static mapping.

              • Delete the static mapping from the DHCP Server in "Services"

              • Stop the DHCP service

              • Delete anything pertaining to the lease/mapping in DHCP Leases in "Status"

              • Start DHCP Service

              I have never had to edit /var/dhcpd/vardb/dhcpd.leases or /var/dhcpd/vardb/dhcpd.leases~

              1 Reply Last reply Reply Quote 0
              • Y
                yay
                last edited by

                Just in case I wasn't clear enough with my phrasing, attached are two screenshots showing my issue.

                ghost_mapping.png
                ghost_mapping.png_thumb
                ghost_lease.png
                ghost_lease.png_thumb

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

                  Have you tried rebooting your box?

                  Also make a backup of your config, then set to default, then reload config.

                  If those don't work reinstall…?

                  1 Reply Last reply Reply Quote 0
                  • S
                    S_Erickson
                    last edited by

                    Hello,

                    I'm running 2.3.2 p1 on a xg-1541

                    Had the same problem that you did, a blank entry at the top of the static mappings list on one of the interfaces.  Normally if you delete a static mapping it will bring you back to the top and say you have to apply the changes. With this entry after clicking OK to delete it it would simply bring me back to the top with no option to apply. I spent a couple hours trying to get rid of it before I found the solution and thought I would share it. I don't know if you still have this problem, but I couldn't find any advice online that didn't involve reinstalling or resetting to factory default configuration. So here is what I found:

                    In my case the blank and undeletable static mapping was being created by an entry in the dhcpd.conf file.

                    host s_opt2_0 {
                    }
                    

                    Editing the file and removing these lines was not the solution though. The PfSense system pretty much ignores the dhcpd.conf file after initialization. It auto-generates a new version of the file every time the system starts based on the config.xml file. So I went in and opened up that and found a similar issue. In the static mappings section for that interface there was a line with an open/close _<staticmap></staticmap>_tag at the start of the list. Removed that, saved the file, then got rid of /tmp/config.cache to get the system to reload the config again.  Didn't even need to restart the system.

                    Anyways I still don't know what it was that created the blank entry but at least it's gone.  Hope this helps anyone else who runs into this.

                    Sean

                    1 Reply Last reply Reply Quote 1
                    • A
                      amddiego
                      last edited by

                      @S_Erickson:

                      Hello,

                      I'm running 2.3.2 p1 on a xg-1541

                      Had the same problem that you did, a blank entry at the top of the static mappings list on one of the interfaces.  Normally if you delete a static mapping it will bring you back to the top and say you have to apply the changes. With this entry after clicking OK to delete it it would simply bring me back to the top with no option to apply. I spent a couple hours trying to get rid of it before I found the solution and thought I would share it. I don't know if you still have this problem, but I couldn't find any advice online that didn't involve reinstalling or resetting to factory default configuration. So here is what I found:

                      In my case the blank and undeletable static mapping was being created by an entry in the dhcpd.conf file.

                      host s_opt2_0 {
                      }
                      

                      Editing the file and removing these lines was not the solution though. The PfSense system pretty much ignores the dhcpd.conf file after initialization. It auto-generates a new version of the file every time the system starts based on the config.xml file. So I went in and opened up that and found a similar issue. In the static mappings section for that interface there was a line with an open/close _<staticmap></staticmap>_tag at the start of the list. Removed that, saved the file, then got rid of /tmp/config.cache to get the system to reload the config again.  Didn't even need to restart the system.

                      Anyways I still don't know what it was that created the blank entry but at least it's gone.  Hope this helps anyone else who runs into this.

                      Sean

                      THANK YOU!!!!!!!!!!!

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