DHCP Lease Duplication Issue

I am having an issue with DHCP leases being duplicated a lot of times in /tmp/hosts/odhcp (as well as being displayed on the web ui), I am using multiple networks (VLANs & SSID) with mainly (but not exclusively) static addresses.
Here is just an example however this duplication continues miles long:

Can anyone suggest how to debug the root cause?

Don’t you have manually set static IP both on clients and DHCP?

Actually, I have some device set to:

  1. Static IP (don’t get an IP from the DHCP server, their address is outside of the DHCP server range assignment)
  2. Static lease (the devices get their IP from the DHCP server, however they always get the same IP).
  3. Dynamic lease (the devices get their IP from the pool of ip addresses).

The issue is with the static lease, it seems to cause the items to be duplicated and I have no idea what can be the cause or how to debug it, I can delete /tmp/hosts/odhcp which causes all address to be temporarily delete but they seem to return after a while.

I always don’t know if i should post or not post reply…

during my “games” with dhcp/dns/dnsmasq/kresd/resolver setup i found that there are three files (in “tmp”) with lease entries. Based on setup in “resolver”/“dhcp” uci config you might get some entries duplicated as part of “leasetrigger” event (or/and dhcp event). Foris/Luci just reads one of those files. As you have almost “never expired” lease time, each time there is new lease (no matter if static or dynamic) you will get new entry and very possibly all “live” entries might get duplicated between those three lease files by the “leasetrigger” (in /etc/config/resolver or dhcp there is option for this, so you can debugg that script by yourself).

I would stop services handling lease files (kresd, resolver, odhcp, dnsmesq) change leasetime to 1hour in luci (during debugg). Clean the lease file manually, restart stopped services and observe what and when pops-up in lease files and in system log file.

normally even with silly lease time, each time clients connects, it should get the lease time reset and lease file entry should gets refreshed. That should work if you have some decent setup. So you should check the scripts executed after static/dynamic lease occurs.