Duplicate Entries for Static DHCPv4 leases

Started by cypher2001, April 29, 2022, 02:47:50 PM

Previous topic - Next topic
Hey folks.

Newbie to Opnsense and working on migrating some of my home+Lab network over.

As I'm moving traffic, I'm assigning static DHCP entries for many of my IoT devices.  Everytime I go through the process of adding it as static, I get multiple entries for the same IP in my lease report.

  While this does not seem to affect functionality, It seems incorrect.   Anyone have any idea if this is something I'm doing or perhaps a bug?

 



Could there be multiple client UID's coming from those devices? Perhaps checking the "Ignore Client UIDs" may sort it?

Quote from: RFC 6592 on April 29, 2022, 03:58:39 PM
Could there be multiple client UID's coming from those devices? Perhaps checking the "Ignore Client UIDs" may sort it?

Thanks for responding.  I was under the impression that the multiple UID would pull additional addresses in that case.  These all show the same IP address assigned.

Additionally, these devices did no show multiple leases until I converted them to static assignments.  Thats when the duplicates showed up.

I just tested this setting to be sure and saw no change.


Static addresses must not come from the dynamic range. You need to define a range smaller than your entire subnet and assign static addresses from outside that.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Same issue for me (noobie as well. Had pfSense some time ago, but also far from Pro there).

So, double entries on Leases page for static-assigned devices. IP is the same, MAC is also the same (so it's not the case of LAN vs WLAN interfaces, or 2.4G WLAN vs 5G WLAN).
And static assignments are not overlapping with DHCP range. I think, OPNsense even wouldn't allow this.

Quote from: Shurov on April 29, 2022, 05:01:48 PM
Same issue for me (noobie as well. Had pfSense some time ago, but also far from Pro there).

So, double entries on Leases page for static-assigned devices. IP is the same, MAC is also the same (so it's not the case of LAN vs WLAN interfaces, or 2.4G WLAN vs 5G WLAN).

I can't replicate the issue. I just added a static DHCP mapping for a device which had 192.168.10.9 given from DHCP pool. I gave it a static mapping of 192.168.10.109 (outside the pool). No duplicates showing after a good while now.

I'm on:
OPNsense 22.1.6-amd64
FreeBSD 13.0-STABLE
OpenSSL 1.1.1n 15 Mar 2022

Quote from: Shurov on April 29, 2022, 05:01:48 PM
And static assignments are not overlapping with DHCP range. I think, OPNsense even wouldn't allow this.

It allows it but you get an error message in the DHCP logs. I think it logs, "Dynamic and static leases present for [IP address]"



In my case, the IOT device pulled a DHCP address from the pool.  I clicked on the + sign next to that lease entry and made that same address static.

The system does allow this.  It was my understanding this essentially creates that static reservation.  This way that client will ALWAYS pull the same IP from the pool.

I see folks testing this by creating a new static IP outside of the pool.  In my case, I'm looking to create a DHCP static reservation by using the + side in the leases tab.


Quote from: cypher2001 on April 29, 2022, 06:01:16 PM
In my case, the IOT device pulled a DHCP address from the pool.  I clicked on the + sign next to that lease entry and made that same address static.

The system does allow this.  It was my understanding this essentially creates that static reservation.  This way that client will ALWAYS pull the same IP from the pool.

I see folks testing this by creating a new static IP outside of the pool.  In my case, I'm looking to create a DHCP static reservation by using the + side in the leases tab.


I recall this happening to me recently, too.  Converting an existing lease to static via the "+" button (even when changing the IP in the form for the static entry) yielded duplicates for that MAC address, whereas creating a static DHCP lease from scratch (without the client having a pre-existing lease) does not.

The duplicates went away.  I don't remember whether it's because I nuked the leases or whether they just went away when the initial dynamic lease expired.

(Caveat: this happened at a time when I was converting my setup over from HA dynamic DHCP to static DHCP due to DNS registration issues.)

Quote from: cypher2001 on April 29, 2022, 06:01:16 PM
In my case, the IOT device pulled a DHCP address from the pool.  I clicked on the + sign next to that lease entry and made that same address static.

I did exactly this apart from i changed the IP address to one from outside the pool as is best practice. If you leave it as static assignment to an address inside the dynamic pool, you will see the error message that i posted in my last post.

steps taken: Device aquired 192.168.10.9 via DHCP from the pool. > I clicked leases > clicked the + sign next to that dynamic lease which brings you to the static mapping page > I changed the IP address there to 192.168.10.109 (outside the pool as is best practice) > clicked save and apply changes. No problems following this.





Quote from: EdwinKM on April 29, 2022, 07:22:37 PM
note this fix: https://github.com/opnsense/core/commit/eb0eb519dbe79e81dfe55f735db5a8abff1c10e8

Forgive the ignorant question as I'm unsure of the scope of the link you sent.  If there is a fix identified, would I expect this incorporated in a future release?

This change is not released yes. I am not sure if it is actually the same problem. Never trusted those pages after making a static mapping (to another IP). Had similar results with pfSense tho. We should check after the next release