@johnpoz said in KEA DHCP lease should not be resumed when client switches VLAN:
What/where did you create that graph showing the high network utilization - I would do the sniff there, if pfsense interfaces are seeing the high utilization of network you could just do the packet capture there under diagnostics.
The graph I posted was my tool using the controller API. It would be showing the same data that you found in the graph from the current controller, except on a shorter time frame, easier to visualize.
What specific APs, firmware and controller version are you running?
U6-LR, EA firmware 6.7.51, controller 10.3.58 .
edit: oh they moved it... I am running U7 Lites, 8.6.7 firmware with controller software being 10.3.58 running on Unifi OS (5.0.6) on a linux vm.. And it shows up if you click on the device, then airview, then highlight one of the devices (ap) you will see packet capture all the way to the right pop up.
Yes, I found that.
[image: 1777016609766-packetcapture.jpg]
But depending might not be supported, I have older flexHD AP that thinking of deploying outside currently connected and I don't see the packet capture button pop up there, but it does have tcpdump if I ssh to it.. Wonder if packet capture not showing up because I currently have its radio's off?
I think packet capture must be specific to certain models. Maybe U6 vs U7, or chipset.
Anyway, to get back to the original DHCP issue, I have concluded that there is no problem with pfSense. The issue with getting the wrong IP was related to Radius caching in Unifi. My GUI tool was updating the VLAN for a client in the freeradius config, then immediately forcing a Settings/Reconnect on that Wifi client using the Unifi API. It turns out that Unifi has a cache for Radius authentication, and does not immediately trigger the Radius re-auth, if the client had previously authenticated with Radius within the last minute. I was testing rapidly by clicking back and forth in my GUI. I have a single button that does both the Radius update, and Unifi client reconnect. If I wait about one minute and force reconnect the client again, Unifi forces a Radius reauth, and it switches to the correct VLAN. It was painful to figure that out, as I had to enable debug logging in both pfSense KEA DHCP server and freeradius.
Here is what I had to add in the custom DHCP server options in pfSense to enable it.
{
"loggers": [
{
"name": "kea-dhcp4.packets",
"output-options": [{ "output": "syslog:kea-dhcp4", "pattern": "%m\n" }],
"severity": "DEBUG",
"debuglevel": 10
}
]
}
In freeradius - running in a Ubuntu 24.04 lxc container on proxmox, not in pfSense :
root@radius-dev:/etc/freeradius/3.0/sites-enabled# cat /etc/freeradius/3.0/mods-enabled/linelog-vlan
linelog vlan_log {
filename = /var/log/freeradius/vlan.log
format = "%T | %{Calling-Station-Id} | %{reply:Tunnel-Private-Group-Id}"
}
Then, I added "vlan_log" as the last line of the post-auth section in /etc/freeradius/3.0/sites-enabled/default .
This let me trace the incoming Radius requests from Unifi for that client - the only one that I switched VLAN on for testing purposes :
root@radius-dev:/etc/freeradius/3.0/sites-enabled# tail -f /var/log/freeradius/vlan* | grep 84-72-07-81-11-ED
2026-04-29-12.38.25.634023 | 84-72-07-81-11-ED | 2
2026-04-29-12.40.11.118653 | 84-72-07-81-11-ED | 1
2026-04-29-12.41.02.423494 | 84-72-07-81-11-ED | 2
2026-04-29-12.45.00.025150 | 84-72-07-81-11-ED | 1
2026-04-29-12.46.48.017847 | 84-72-07-81-11-ED | 2
2026-04-29-12.48.00.218718 | 84-72-07-81-11-ED | 1
2026-04-29-12.49.00.370991 | 84-72-07-81-11-ED | 2
2026-04-29-13.24.48.548272 | 84-72-07-81-11-ED | 2
In the pfSense server DHCP log, I see :
Apr 29 13:24:48 kea-dhcp4 93031 DHCP4_PACKET_RECEIVED [hwtype=1 84:72:07:81:11:ed], cid=[no info], tid=0xfb: DHCPDISCOVER (type 1) received from 0.0.0.0 to 255.255.255.255 on interface vtnet1.2
Apr 29 13:24:48 kea-dhcp4 93031 DHCP4_PACKET_SEND [hwtype=1 84:72:07:81:11:ed], cid=[no info], tid=0xfb: trying to send packet DHCPOFFER (type 2) from 192.168.106.1:67 to 192.168.106.7:68 on interface vtnet1.2
Apr 29 13:24:48 kea-dhcp4 93031 DHCP4_PACKET_RECEIVED [hwtype=1 84:72:07:81:11:ed], cid=[no info], tid=0xfb: DHCPREQUEST (type 3) received from 0.0.0.0 to 255.255.255.255 on interface vtnet1.2
Apr 29 13:24:48 kea-dhcp4 93031 DHCP4_PACKET_SEND [hwtype=1 84:72:07:81:11:ed], cid=[no info], tid=0xfb: trying to send packet DHCPACK (type 5) from 192.168.106.1:67 to 192.168.106.7:68 on interface vtnet1.2
This is all expected for freeradius and pfsense.
Unfortunately, the 2.4 GHz band utilization for this client on the AP it's connected to instantly goes to 100%. There is no increased traffic on the pfSense side. It really looks like a Unifi issue. I have still not been to figure out why. This is a showstopper and completely preventing me from using VLANs with Unifi.
I have done a few packet traces on the AP, and am not seeing anything unusual, regardless of which VLAN the client is on. I must not be doing the capture right.
I may need to open a support case with Ubiquiti to get to the bottom of this.