OPNsense Forum

Archive => 21.1 Legacy Series => Topic started by: RamSense on January 29, 2021, 06:40:48 pm

Title: (solved) Empty static lease not removable
Post by: RamSense on January 29, 2021, 06:40:48 pm
I have somehow managed to get an empty static lease and I see no way to delete it.

On services -DHCPv4 - leases I have an static address on top <empty>:
Interface:  empty
IP address: empty
MAC address: empty
Hostname: Samsung
Description: Samsung
status: " offline sign"
lease type: static

There is no delete option behind it.

When I go to: services - DHCPv4 - [LAN]:
there is a complete list of the static addresses under "DHCP Static Mappings for this interface." But the <empty> one above on the other page is not showing, and I can not delete it.

I can use "deny unknown clients", but I can not also enable static arp. When I do I get the following error message:
Cannot enable static ARP when you have static map entries without IP addresses. Ensure all static maps have IP addresses and try again.

But the list shown have all an ip. Only the one showing only on the leases page has not, and I am not able to change it...

How to get rid of this entry?

(This is the case on opnsense 20.7.x as on 21.1 I am running now.)
Thank you for your help!
Title: Re: Empty static lease not removable
Post by: RamSense on February 05, 2021, 08:23:23 am
somebody with knowledge on opnsense?
Title: Re: Empty static lease not removable
Post by: marjohn56 on February 05, 2021, 11:47:46 am
Note sure why it won't allow you to delete, however it's pretty simple. Download the config using System:Configuration:Backups. Open it in an editor and look for <staticmap> entries, it will look like this:

  <staticmap>
        <mac>00:16:01:0a:58:24</mac>
        <ipaddr>10.4.12.5</ipaddr>
        <hostname>Terrastatiion</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
  </staticmap>


just remove the entry and save the config.xml to your pc. Then import the config using Restore configuration.
Title: Re: Empty static lease not removable
Post by: RamSense on February 05, 2021, 05:34:27 pm
@marjohn56, thank you. Your method worked! Thnx! Sometimes it is easy :-)