[SOLVED] KEA dhcpd not serving all subnets after reboot

Started by hfvk, February 24, 2024, 08:31:34 PM

Previous topic - Next topic
I am testing KEA dhcpd on OPNsense 24.1.2_1-amd64.

I have configured five subnets (LAN + four VLANs) for which KEA is the dhcp server:
192.168.22.0/24 (LAN)
192.168.202.0/24 (VLAN 2)
192.168.205.0/24 (VLAN 5)
192.168.210.0/24 (VLAN 10)
192.168.220.0/24 (VLAN 20)

Everything is fine until I reboot the system. After reboot I see the following warning in the KEA log file:

WARN [kea-dhcp4.dhcpsrv.0x835bc5000] DHCPSRV_OPEN_SOCKET_FAIL failed to open socket: the interface em0 is not running

It seems like KEA is starting before the em0 interface (which is the interface for the LAN and VLANs).

However, KEA seems to start and servers fine on the VLAN-intefaces but does not provide DHCP leases for the LAN interface. Once I restart the KEA service, it starts serving on both LAN interface and VLANs.

Again, when I reboot the system, the same issue occurs until I manually restart KEA.

Is this a known issue and is there any workaround for the issue? Is there any information I can provide for inspecting this further?

February 24, 2024, 08:56:05 PM #1 Last Edit: February 24, 2024, 09:04:32 PM by Monviech
Are you running an untagged vlan on the same trunk? Thats not recommended. If you are running vlans all of them should be tagged, even vlan 1. Freebsd doesnt like this.

The untagged parent interface doesnt need to be assigned. If you use a switch with native vlan id (or how its called) use a sacrafice vlan like 2000 or something for the untagged traffic so it doesnt collide with tagged traffic on the connected trunk interface.

Dont know if thats related to the KEA issue.
Hardware:
DEC740

Quote from: Monviech on February 24, 2024, 08:56:05 PM
Are you running an untagged vlan on the same trunk? Thats not recommended. If you are running vlans all of them should be tagged, even vlan 1. Freebsd doesnt like this.

The untagged parent interface doesnt need to be assigned. If you use a switch with native vlan id (or how its called) use a sacrafice vlan like 2000 or something for the untagged traffic so it doesnt collide with tagged traffic on the connected trunk interface.

Dont know if thats related to the KEA issue.

Thank you! This was indeed the issue. Now all VLANs (including VLAN 1) are tagged and KEA is also working as expected after a system reboot.

KEA does not even issue a warning "em0 is not running" now that VLANs are properly configured (not mixing tagged and untagged).