core: KEA-DHCP: Valid leases missing in leases status

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug

Yesterday I have switched to KEA DHCP and it is working fine. I am facing one issue with the leases status page/log file: I am having around 35 devices connected to my network and all are using DHCP. I was surprised that under SERVICES: KEA DHCP [NEW]: LEASES DHCPV4 I am only seeing around 15 entries.

I found out that every hour the leases file gets cleaned (Informational kea-dhcp4 INFO [kea-dhcp4.dhcpsrv.0x83530e000] DHCPSRV_MEMFILE_LFC_START starting Lease File Cleanup) and then the list of leases is completely empty, until the devices renew their lease. So even the leases that were handed out and are still valid get removed and are no longer visible.

With ISC DHCP this did not happen and I had a reliable list of leases that were handed out.

To Reproduce

Steps to reproduce the behavior:

  1. Install 24.1.1
  2. Activate KEA DHCP
  3. Connect a device to the network and verify that it got a lease from KEA
  4. Find this lease in the “Leases” status under SERVICES: KEA DHCP [NEW]: LEASES DHCPV4
  5. Wait some time until leases file gets cleaned up (happens every hour)
  6. See that the lease is no longer visible even if it is still valid (I verified that)

Expected behavior

Leases should stay in history as long as they are valid.

Describe alternatives you considered

No workaround. I am currently using ARP-Table to verify which clients are connected, as the lease status with KEA is not accurate.

Screenshots

Here are some screenshots that show the behavior:

Device with ip 192.168.218.101 got its lease at 2024-02-0509:55:24: 02

Cleanup of leases file happened at 2024-02-05T09:59:53: 03

Device with ip 192.168.218.101 is not visible in Leases status at around 2024-02-05T10:30, even if the lease received at 09:55:24 is still valid (lifetime 7200s): 01

Relevant log files

Informational kea-dhcp4 INFO [kea-dhcp4.dhcpsrv.0x83530e000] DHCPSRV_MEMFILE_LFC_START starting Lease File

Environment

Software version used and hardware type if relevant, e.g.:

OPNsense 24.1.1 (amd64). Intel® Celeron® J6412 @ 2.00GHz (4 cores, 4 threads)

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Comments: 21 (11 by maintainers)

Commits related to this issue

Most upvoted comments

To test, use:

opnsense-patch 20e9bdc459b31dd9f60111d1ae5d16181c868f7d

Thank you! It is working fine now and showing all 21 leases in Web GUI…