#1037297 /usr/sbin/kea-dhcp6: socket error when starting or restarting the server

Package:
kea-dhcp6-server
Source:
kea-dhcp6-server
Description:
IPv6 DHCP server
Submitter:
Bruno
Date:
2026-04-21 17:19:02 UTC
Severity:
normal
#1037297#5
Date:
2023-06-10 14:33:06 UTC
From:
To:
Dear Maintainer,

when starting or restarting the server, kea-dhcp6-server does not work with the following error:

kea-dhcp6-server.service - Kea IPv6 DHCP daemon
     Loaded: loaded (/lib/systemd/system/kea-dhcp6-server.service; enabled; preset: enabled)
     Active: active (running) since Sat 2023-06-10 10:39:38 -03; 10min ago
       Docs: man:kea-dhcp6(8)
   Main PID: 770 (kea-dhcp6)
      Tasks: 5 (limit: 4915)
     Memory: 6.1M
        CPU: 306ms
     CGroup: /system.slice/kea-dhcp6-server.service
             └─770 /usr/sbin/kea-dhcp6 -c /etc/kea/kea-dhcp6.conf

jun 10 10:39:38 router kea-dhcp6[770]: INFO  DHCPSRV_MEMFILE_DB opening memory file lease database: lfc-interval=3600 type=memfile universe=6
jun 10 10:39:38 router kea-dhcp6[770]: INFO  DHCPSRV_MEMFILE_LEASE_FILE_LOAD loading leases from file /var/lib/kea/kea-leases6.csv.2
jun 10 10:39:38 router kea-dhcp6[770]: INFO  DHCPSRV_MEMFILE_LEASE_FILE_LOAD loading leases from file /var/lib/kea/kea-leases6.csv
jun 10 10:39:38 router kea-dhcp6[770]: INFO  DHCPSRV_MEMFILE_LFC_SETUP setting up the Lease File Cleanup interval to 3600 sec
jun 10 10:39:38 router kea-dhcp6[770]: INFO  DHCP6_USING_SERVERID server is using server-id 00:01:00:01:2c:10:a8:b5:70:71:bc:94:33:af and stores in the file /var/lib/kea/kea-dhcp6-serverid
jun 10 10:39:38 router kea-dhcp6[770]: WARN  DHCPSRV_OPEN_SOCKET_FAIL failed to open socket: Failed to open multicast socket on interface enp1s0, reason: Failed to open link-local socket on interf>
jun 10 10:39:38 router kea-dhcp6[770]: INFO  DHCP6_OPEN_SOCKETS_FAILED maximum number of open service sockets attempts: 0, has been exhausted without success
jun 10 10:39:38 router kea-dhcp6[770]: WARN  DHCPSRV_NO_SOCKETS_OPEN no interface configured to listen to DHCP traffic
jun 10 10:39:38 router kea-dhcp6[770]: WARN  DHCP6_MULTI_THREADING_INFO enabled: no, number of threads: 0, queue size: 0
jun 10 10:39:38 router kea-dhcp6[770]: INFO  DHCP6_STARTED Kea DHCPv6 server version 2.2.0 started

If  restart the service with "systemctl restart kea-dhcp6-server with "systemctl restart kea-dhcp6-server.service"  it goes back to normal.
This only happens on system boot or restarting the server. Seems to start before ready interface

root@router:~# systemctl restart kea-dhcp6-server.service
root@router:~# systemctl status kea-dhcp6-server.service
● kea-dhcp6-server.service - Kea IPv6 DHCP daemon
     Loaded: loaded (/lib/systemd/system/kea-dhcp6-server.service; enabled; preset: enabled)
     Active: active (running) since Sat 2023-06-10 11:28:36 -03; 1s ago
       Docs: man:kea-dhcp6(8)
   Main PID: 1614 (kea-dhcp6)
      Tasks: 5 (limit: 4915)
     Memory: 1.8M
        CPU: 147ms
     CGroup: /system.slice/kea-dhcp6-server.service
             └─1614 /usr/sbin/kea-dhcp6 -c /etc/kea/kea-dhcp6.conf

jun 10 11:28:37 router kea-dhcp6[1614]: INFO  RUN_SCRIPT_LOAD Run Script hooks library has been loaded
jun 10 11:28:37 router kea-dhcp6[1614]: INFO  HOOKS_LIBRARY_LOADED hooks library /usr/lib/i386-linux-gnu/kea/hooks/libdhcp_run_script.so successfully loaded
jun 10 11:28:37 router kea-dhcp6[1614]: INFO  DHCP6_CONFIG_COMPLETE DHCPv6 server has completed configuration: added IPv6 subnets: 1; DDNS: disabled
jun 10 11:28:37 router kea-dhcp6[1614]: INFO  DHCPSRV_MEMFILE_DB opening memory file lease database: lfc-interval=3600 type=memfile universe=6
jun 10 11:28:37 router kea-dhcp6[1614]: INFO  DHCPSRV_MEMFILE_LEASE_FILE_LOAD loading leases from file /var/lib/kea/kea-leases6.csv.2
jun 10 11:28:37 router kea-dhcp6[1614]: INFO  DHCPSRV_MEMFILE_LEASE_FILE_LOAD loading leases from file /var/lib/kea/kea-leases6.csv
jun 10 11:28:37 router kea-dhcp6[1614]: INFO  DHCPSRV_MEMFILE_LFC_SETUP setting up the Lease File Cleanup interval to 3600 sec
jun 10 11:28:37 router kea-dhcp6[1614]: INFO  DHCP6_USING_SERVERID server is using server-id 00:01:00:01:2c:10:a8:b5:70:71:bc:94:33:af and stores in the file /var/lib/kea/kea-dhcp6-serverid
jun 10 11:28:37 router kea-dhcp6[1614]: WARN  DHCP6_MULTI_THREADING_INFO enabled: no, number of threads: 0, queue size: 0
jun 10 11:28:37 router kea-dhcp6[1614]: INFO  DHCP6_STARTED Kea DHCPv6 server version 2.2.0 started

#1037297#10
Date:
2023-06-19 12:51:02 UTC
From:
To:
Bruno wrote on 10/06/2023:
[...]

Hello Bruno and thanks for this bug report. I think this issue falls
under the "network-online ordering" category, which is due to the fact
that the "networking is ready" or "system is online" status is not well
defined. It may me tempting to use an After=network-online.target rule
in the systemd service file, but the point defining what that target
means. For example: if a secondary network interface of a server is
down, should this prevent systemd from starting kea?

Unfortunately I don't have a solution at hand at the moment which is
guaranteed to do more good than harm.

Paride

#1037297#15
Date:
2023-06-19 22:35:20 UTC
From:
To:
Hi Paride, thanks for the reply.

I checked the systemd file and it says After=network-online.target, it
still doesn't work, I need to restart the service.

Is the problem in systemd?

Who should I report to?

Thanks.

Em 19/06/2023 09:51, Paride Legovini escreveu:

#1037297#20
Date:
2023-06-20 10:59:21 UTC
From:
To:
Bruno Meirelles wrote on 20/06/2023:

Hi,

https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ says:
--- network-online.target is a target that actively waits until the nework is "up", where the definition of "up" is defined by the network management software. Usually it indicates a configured, routable IP address of some kind. Its primary purpose is to actively delay activation of services until the network is set up. --- so I'd say it's either systemd or ifupdown (assuming that's what you are using). Paride
#1037297#25
Date:
2023-06-22 11:17:18 UTC
From:
To:
Hi Paride,

I asked on systemd github, see if that might help:

https://github.com/systemd/systemd/issues/28122#

Em 20/06/2023 07:59, Paride Legovini escreveu:

#1037297#30
Date:
2023-06-22 11:23:38 UTC
From:
To:
Bruno Meirelles wrote on 22/06/2023:

Lennart is right, this is not a systemd upstream issue. It's about the
Debian systemd package or the network management system you are using.

Paride

#1037297#35
Date:
2026-04-21 17:09:22 UTC
From:
To:
Hi,

we’re currently trying to debug/fix a set of interconnected issues
in the KEA DHCP/DHCP6 server which involve systemd as well:


One is that, when the services start, the network is not precisely
up and working yet, and so it logs…

Apr 21 09:29:11 debian kea-dhcp4[1634]: WARN  DHCPSRV_NO_SOCKETS_OPEN no interf[…]

… but starts successfully despite not working.

It already has…

Wants=network-online.target
After=network-online.target

… which a coworker who knows systemd better says ought to suffice,
but it turns out (in his debugging experiments) that network-online
can still have the network interfaces in DOWN state.

Restarting the service once the system has booted makes it work.

I think this is something we need to address by a code change (abort
instead of continuing when this particular error occurs) plus a change
in the unit to let systemd attempt to restart it… can it do this with
a backoff (i.e. first after 30s, then after a minute, then after 3min,
etc.)?


The other is that KEA DHCPD (both v4 and v6) must be restarted when
the network is restarted. Am I correct that keeping the After= from
above and changing the Wants= into BindsTo=network-online.target will
do that?

(KEA maintainers, is this also needed for the third (DDNS) service?)


Thanks in advance,
//Thorsten