I find it very challenging to use the kea dhcp.
I have installed a new Ubuntu 24.04.2 LTS server on some new hardware.
The old server is also Ubuntu 24.04.2 LTS, same as the new server.
The reason to install a new server is also because I notice some problems due migrating.
Before I always migrated my server to new version which also brings some changes.
One of the items was isc-dhcp-server and the move to kea as I read:
While Ubuntu still supports isc-dhcp-server
, it is no longer supported by its vendor, ISC.org. ISC.org recommends using Kea, their newer DHCP server, for new implementations.
This is what has been installed:
kea 2.4.1-3build3.1
kea-admin 2.4.1-3build3.1
kea-common 2.4.1-3build3.1
kea-ctrl-agent 2.4.1-3build3.1
kea-dhcp-ddns-server 2.4.1-3build3.1
kea-dhcp4-server 2.4.1-3build3.1
kea-dhcp6-server 2.4.1-3build3.1
python3-kea-connector 2.4.1-3build3.1
One issue I got is these massages in the log and after reboot a failed to open socket:
2025-06-19 06:09:25.817 WARN DHCP4_MULTI_THREADING_INFO enabled: yes, number of threads: 3, queue size: 12
2025-06-20 05:15:05.187 WARN DHCPSRV_MT_DISABLED_QUEUE_CONTROL disabling dhcp queue control when multi-threading is enabled.
2025-06-20 05:15:05.187 WARN DHCP4_RESERVATIONS_LOOKUP_FIRST_ENABLED Multi-threading is enabled and host reservations lookup is always performed first.
2025-06-20 05:15:05.205 WARN DHCPSRV_OPEN_SOCKET_FAIL failed to open socket: the interface enp2s0 is not running
2025-06-20 05:15:05.205 WARN DHCPSRV_NO_SOCKETS_OPEN no interface configured to listen to DHCP traffic
2025-06-20 05:15:05.206 WARN DHCP4_MULTI_THREADING_INFO enabled: yes, number of threads: 3, queue size: 12
I checked the systemd sevice like /lib/systemd/system/kea-dhcp4-server.service
It mentions:
Wants=network-online.target
After=network-online.target
network-online.target mentions:
After=network.target
network.target mentions:
After=network-pre.target
network-pre.target mentions:
RefuseManualStart=yes
So why do I have this message about enp2s0 is not running?
I did start but I got these messages in the logging.
What to do with these warnings is also not clear to me.
I also got this error when I started with kea:
2025-06-19 05:14:34.593 INFO DHCPSRV_MEMFILE_LFC_START starting Lease File Cleanup
2025-06-19 05:14:34.593 ERROR Unable to lock logger lockfile
2025-06-19 05:14:34.593 INFO DHCPSRV_MEMFILE_LFC_EXECUTE executing Lease File Cleanup using: /usr/sbin/kea-lfc -4 -x /var/lib/kea/kea-leases4.csv.2 -i /var/lib/kea/kea-leases4.csv.1 -o /var/lib/kea/kea-leases4.csv.output -f /var/lib/kea/kea-leases4.csv.completed -p /var/lib/kea/kea-leases4.c
sv.pid -c ignored-path
2025-06-19 05:51:24.857 ERROR Unable to lock logger lockfile
The symptom I had was that after reboot it worked, but when a lease needed to be renewed, it didn’t and client got disconnected without any IP.
And it always happens around the LFC (Lease File Cleanup).
I did two thing and didn’t see the message anymore, but not sure what the cause is.
I disabled the LFC (as I use it at home in a very small environment - lfc-interval=0) in the kea-dhcp4.conf, like:
"lease-database": {
"type": "memfile",
"lfc-interval": 0,
"persist": true,
"name": "/var/lib/kea/kea-leases4.csv"
},
The next part is more tricky and I guess was the real problem.
There was also a /run/kea/logger_lockfile and not sure why.
The /etc/apparmor.d/usr.sbin.kea-dhcp4 mentions only these:
owner /run/kea/kea-dhcp4.kea-dhcp4.pid rw,
owner /run/lock/kea/logger_lockfile rwk,
I added the /run/lea/logger_lockfile to it and after reboot it was gone.
It’s also no longer created, but wonder if this is because I disabled the LFC?
I also had a hard time to get the default config working as it seems you have to remove all the comments, it just want a plain JSON config without any comments (not in the general way).
Anyone else with these problems?
I was also surprised about the complains and people moving back to isc-dhcp, and I can understand why.
Thanks in advance,
Matthijs
[EDIT] removed some typos (sorry)