Quote from: Monviech (Cedrik) on April 29, 2026, 10:06:44 PMI wonder how big the problem you describe actually is because you have the first report. There are lots of big HA setups out there that run this just fine it seems even if there is the potential for a race condition in lease assignment.
Well, perhaps I wasn't fully understood because I didn't provide enough context for the issues that led me to the explanations I've been sharing since my first post. I apologize in advance for any misunderstanding.
We recently migrated from ISC DHCP to Kea. To perform this migration, I read the OPNsense documentation, searched this forum for any questions other colleagues might have had regarding this transition, and watched some online videos to ensure everything was correct. Like with any service migration, I kept a close eye on the logs over the past few weeks to ensure everything was running smoothly. From the beginning, I noticed the DHCPSRV_MULTIPLE_RAW_SOCKETS_PER_IFACE warning, but since it was just a warning, I let the service run, assuming it might be normal for the way OPNsense configures it.
After running Kea for a few days, I received a report of an IP conflict—something we hadn't experienced in years. Naturally, I looked into the Kea logs to understand what was happening. In most cases, we see DHCP packet duplication where Kea hands out the same IP, which only impacts the lease time. However, under certain conditions that I can't completely pinpoint (but I suspect are related to the timing of how threads handle duplicated packets), we can observe a single thread offering one IP for the first duplicated packet, and then offering a different IP for the second duplicated packet. Here is an example:
Code Select
2026-05-01T15:10:31-03:00 Informational kea-dhcp4 INFO [kea-dhcp4.packets.0x2da78ea76008] DHCP4_PACKET_SEND [hwtype=1 00:1e:e5:xx:xx:9d], cid=[01:00:1e:e5:xx:xx:9d], tid=0x5573: trying to send packet DHCPOFFER (type 2) from 10.y.y.2:67 to 10.y.y.89:68 on interface vlan04
2026-05-01T15:10:31-03:00 Informational kea-dhcp4 INFO [kea-dhcp4.leases.0x2da78ea76008] DHCP4_LEASE_OFFER [hwtype=1 00:1e:e5:xx:xx:9d], cid=[01:00:1e:e5:xx:xx:9d], tid=0x5573: lease 10.y.y.89 will be offered
2026-05-01T15:10:31-03:00 Informational kea-dhcp4 INFO [kea-dhcp4.packets.0x2da78ea76808] DHCP4_PACKET_SEND [hwtype=1 00:1e:e5:xx:xx:9d], cid=[01:00:1e:e5:xx:xx:9d], tid=0x5573: trying to send packet DHCPOFFER (type 2) from 10.y.y.2:67 to 10.y.y.88:68 on interface vlan04
2026-05-01T15:10:31-03:00 Informational kea-dhcp4 INFO [kea-dhcp4.leases.0x2da78ea76808] DHCP4_LEASE_OFFER [hwtype=1 00:1e:e5:xx:xx:9d], cid=[01:00:1e:e5:xx:xx:9d], tid=0x5573: lease 10.y.y.88 will be offered
2026-05-01T15:10:31-03:00 Informational kea-dhcp4 INFO [kea-dhcp4.packets.0x2da78ea76008] DHCP4_PACKET_RECEIVED [hwtype=1 00:1e:e5:xx:xx:9d], cid=[01:00:1e:e5:xx:xx:9d], tid=0x5573: DHCPDISCOVER (type 1) received from 0.0.0.0 to 255.255.255.255 on interface vlan04
2026-05-01T15:10:31-03:00 Informational kea-dhcp4 INFO [kea-dhcp4.packets.0x2da78ea76808] DHCP4_PACKET_RECEIVED [hwtype=1 00:1e:e5:xx:xx:9d], cid=[01:00:1e:e5:xx:xx:9d], tid=0x5573: DHCPDISCOVER (type 1) received from 0.0.0.0 to 255.255.255.255 on interface vlan04
2026-05-01T15:10:31-03:00 Informational kea-dhcp4 INFO [kea-dhcp4.dhcp4.0x2da78ea76808] DHCP4_QUERY_LABEL received query: [hwtype=1 00:1e:e5:xx:xx:9d], cid=[01:00:1e:e5:xx:xx:9d], tid=0x5573
2026-05-01T15:10:31-03:00 Informational kea-dhcp4 INFO [kea-dhcp4.dhcp4.0x2da78ea76008] DHCP4_QUERY_LABEL received query: [hwtype=1 00:1e:e5:xx:xx:9d], cid=[01:00:1e:e5:xx:xx:9d], tid=0x5573In other situations, since I have 4 threads available, each thread grabs one of these packet copies at the exact same time and offers up to 4 different IPs to the exact same computer:
Code Select
2026-04-23T09:58:15-03:00 Informational kea-dhcp4 INFO [kea-dhcp4.leases.0x4aae83ac9008] DHCP4_LEASE_OFFER [hwtype=1 90:09:df:xx:xx:50], cid=[01:90:09:df:xx:xx:50], tid=0x9a6360f6: lease 10.y.y.67 will be offered
2026-04-23T09:58:15-03:00 Informational kea-dhcp4 INFO [kea-dhcp4.packets.0x4aae83ad0008] DHCP4_PACKET_SEND [hwtype=1 90:09:df:xx:xx:50], cid=[01:90:09:df:xx:xx:50], tid=0x9a6360f6: trying to send packet DHCPOFFER (type 2) from 10.y.y.2:67 to 10.y.y.66:68 on interface vlan02
2026-04-23T09:58:15-03:00 Informational kea-dhcp4 INFO [kea-dhcp4.leases.0x4aae83ad0008] DHCP4_LEASE_OFFER [hwtype=1 90:09:df:xx:xx:50], cid=[01:90:09:df:xx:xx:50], tid=0x9a6360f6: lease 10.y.y.66 will be offered
2026-04-23T09:58:15-03:00 Informational kea-dhcp4 INFO [kea-dhcp4.packets.0x4aae83ac9008] DHCP4_PACKET_RECEIVED [hwtype=1 90:09:df:xx:xx:50], cid=[01:90:09:df:xx:xx:50], tid=0x9a6360f6: DHCPDISCOVER (type 1) received from 0.0.0.0 to 255.255.255.255 on interface vlan02
2026-04-23T09:58:15-03:00 Informational kea-dhcp4 INFO [kea-dhcp4.packets.0x4aae83ad0008] DHCP4_PACKET_RECEIVED [hwtype=1 90:09:df:xx:xx:50], cid=[01:90:09:df:xx:xx:50], tid=0x9a6360f6: DHCPDISCOVER (type 1) received from 0.0.0.0 to 255.255.255.255 on interface vlan02
2026-04-23T09:58:15-03:00 Informational kea-dhcp4 INFO [kea-dhcp4.dhcp4.0x4aae83ac9008] DHCP4_QUERY_LABEL received query: [hwtype=1 90:09:df:xx:xx:50], cid=[01:90:09:df:xx:xx:50], tid=0x9a6360f6
2026-04-23T09:58:15-03:00 Informational kea-dhcp4 INFO [kea-dhcp4.dhcp4.0x4aae83ad0008] DHCP4_QUERY_LABEL received query: [hwtype=1 90:09:df:xx:xx:50], cid=[01:90:09:df:xx:xx:50], tid=0x9a6360f6
2026-04-23T09:58:12-03:00 Informational kea-dhcp4 INFO [kea-dhcp4.packets.0x4aae83ac9808] DHCP4_PACKET_SEND [hwtype=1 90:09:df:xx:xx:50], cid=[01:90:09:df:xx:xx:50], tid=0x9a6360f6: trying to send packet DHCPOFFER (type 2) from 10.y.y.2:67 to 10.y.y.65:68 on interface vlan02
2026-04-23T09:58:12-03:00 Informational kea-dhcp4 INFO [kea-dhcp4.leases.0x4aae83ac9808] DHCP4_LEASE_OFFER [hwtype=1 90:09:df:xx:xx:50], cid=[01:90:09:df:xx:xx:50], tid=0x9a6360f6: lease 10.y.y.65 will be offered
2026-04-23T09:58:12-03:00 Informational kea-dhcp4 INFO [kea-dhcp4.packets.0x4aae83a7b808] DHCP4_PACKET_SEND [hwtype=1 90:09:df:xx:xx:50], cid=[01:90:09:df:xx:xx:50], tid=0x9a6360f6: trying to send packet DHCPOFFER (type 2) from 10.y.y.2:67 to 10.y.y.64:68 on interface vlan02
2026-04-23T09:58:12-03:00 Informational kea-dhcp4 INFO [kea-dhcp4.leases.0x4aae83a7b808] DHCP4_LEASE_OFFER [hwtype=1 90:09:df:xx:xx:50], cid=[01:90:09:df:xx:xx:50], tid=0x9a6360f6: lease 10.y.y.64 will be offered
2026-04-23T09:58:12-03:00 Informational kea-dhcp4 INFO [kea-dhcp4.packets.0x4aae83ac9808] DHCP4_PACKET_RECEIVED [hwtype=1 90:09:df:xx:xx:50], cid=[01:90:09:df:xx:xx:50], tid=0x9a6360f6: DHCPDISCOVER (type 1) received from 0.0.0.0 to 255.255.255.255 on interface vlan02
2026-04-23T09:58:12-03:00 Informational kea-dhcp4 INFO [kea-dhcp4.packets.0x4aae83a7b808] DHCP4_PACKET_RECEIVED [hwtype=1 90:09:df:xx:xx:50], cid=[01:90:09:df:xx:xx:50], tid=0x9a6360f6: DHCPDISCOVER (type 1) received from 0.0.0.0 to 255.255.255.255 on interface vlan02
2026-04-23T09:58:12-03:00 Informational kea-dhcp4 INFO [kea-dhcp4.dhcp4.0x4aae83a7b808] DHCP4_QUERY_LABEL received query: [hwtype=1 90:09:df:xx:xx:50], cid=[01:90:09:df:xx:xx:50], tid=0x9a6360f6
2026-04-23T09:58:12-03:00 Informational kea-dhcp4 INFO [kea-dhcp4.dhcp4.0x4aae83ac9808] DHCP4_QUERY_LABEL received query: [hwtype=1 90:09:df:xx:xx:50], cid=[01:90:09:df:xx:xx:50], tid=0x9a6360f6I have a Wi-Fi network with controllers from different vendors, and one of them has flagged the detection of clients with conflicting IPs on different interfaces/VLANs in its logs, as shown in image below.
You cannot view this attachment.
I have been deep-diving into this issue over the last few weeks, and the only logical reason I can find for these IP conflicts is this packet duplication. I can't explain the exact internal mechanics behind it (maybe Kea ends up offering the same IP to two different devices, or tries to use an IP already assigned to someone else due to the race condition). I have also been monitoring leases to see if there is any premature exhaustion of the available IP pool, but that hasn't happened so far.
Since an IP conflict directly affects the client device, it's usually hard to get end-users to actively report it to the network admin. I was lucky that a coworker reported it to me and that one of our Wi-Fi controllers also logs this specific event. Additionally, processing these duplicated packets wastes CPU cycles, which could become a problem during peak hours.
I came to this forum because I genuinely couldn't find anyone else reporting this, so I might be the first to post about it. However, that doesn't invalidate the fact that there is something negatively impacting my setup. I am confident I read all the configuration recommendations from the official OPNsense and Kea documentation, and I believe I configured it correctly, but there is always a chance I missed something. Since my very first post, my intention has been to present the issue and see if anyone could point out a configuration flaw on my end. My goal here is simply to seek help and collaborate with the community to resolve this issue.
Finally, to be fully transparent as requested: I have indeed been using AI assistance (Gemini) to help me with my research, log parsing, and to structure my technical analyses. Furthermore, since English is not my native language, I use it to translate and properly adapt what I write into English.
"