PfSense 2.3.1 - Remove stale static mapping



  • 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





  • 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.



  • 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?



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



  • 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~



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






  • 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…?



  • 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



  • @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!!!!!!!!!!!


Log in to reply