Issue with DHCP relay and DHCP server configured on different interfaces

Hello community,

It seems there is an issue with the DHCP relay service and the DHCP server running concurrently on different interfaces. I noticed this because I happen to have the relay service for one network (eth1) and DHCP service running for the other (eth2). Config:

set service dhcp-relay listen-interface 'eth1'
set service dhcp-relay server '10.97.5.51'
set service dhcp-relay server '10.97.5.41'
set service dhcp-relay upstream-interface 'eth0'

set service dhcp-server shared-network-name TestClientNet2 subnet 172.16.2.0/24 lease '900'
set service dhcp-server shared-network-name TestClientNet2 subnet 172.16.2.0/24 option default-router '172.16.2.254'
set service dhcp-server shared-network-name TestClientNet2 subnet 172.16.2.0/24 option domain-name 'test.local'
set service dhcp-server shared-network-name TestClientNet2 subnet 172.16.2.0/24 option name-server '10.8.8.8'
set service dhcp-server shared-network-name TestClientNet2 subnet 172.16.2.0/24 range 1 start '172.16.2.11'
set service dhcp-server shared-network-name TestClientNet2 subnet 172.16.2.0/24 range 1 stop '172.16.2.200'
set service dhcp-server shared-network-name TestClientNet2 subnet 172.16.2.0/24 subnet-id '1'

Inspecting the log (show log dhcp server), I see:

Sep 23 02:55:32 systemd[1]: Starting Kea IPv4 DHCP daemon...
Sep 23 02:55:33 kea-dhcp4[2948]: 2025-09-23 02:55:33.041 INFO  [kea-dhcp4.dhcp4/2948.140469536875008] DHCP4_STARTING Kea DHCPv4 server version 2.4.1 (stable) starting
Sep 23 02:55:33 kea-dhcp4[2948]: 2025-09-23 02:55:33.044 INFO  [kea-dhcp4.hosts/2948.140469536875008] HOSTS_BACKENDS_REGISTERED the following host backend types are available: mysql postgresql
Sep 23 02:55:33 kea-dhcp4[2948]: 2025-09-23 02:55:33.045 WARN  [kea-dhcp4.dhcpsrv/2948.140469536875008] DHCPSRV_MT_DISABLED_QUEUE_CONTROL disabling dhcp queue control when multi-threading is enabled.
Sep 23 02:55:33 kea-dhcp4[2948]: 2025-09-23 02:55:33.045 WARN  [kea-dhcp4.dhcp4/2948.140469536875008] DHCP4_RESERVATIONS_LOOKUP_FIRST_ENABLED Multi-threading is enabled and host reservations lookup is always performed first.
Sep 23 02:55:33 kea-dhcp4[2948]: 2025-09-23 02:55:33.047 INFO  [kea-dhcp4.hooks/2948.140469536875008] HOOKS_LIBRARY_CLOSED hooks library /usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_lease_cmds.so successfully closed
Sep 23 02:55:33 kea-dhcp4[2948]: 2025-09-23 02:55:33.048 INFO  [kea-dhcp4.dhcpsrv/2948.140469536875008] DHCPSRV_CFGMGR_NEW_SUBNET4 a new subnet has been added to configuration: 172.16.2.0/24 with params: valid-lifetime=900
Sep 23 02:55:33 kea-dhcp4[2948]: 2025-09-23 02:55:33.049 INFO  [kea-dhcp4.dhcpsrv/2948.140469536875008] DHCPSRV_CFGMGR_SOCKET_TYPE_SELECT using socket type raw
Sep 23 02:55:33 kea-dhcp4[2948]: 2025-09-23 02:55:33.049 INFO  [kea-dhcp4.dhcpsrv/2948.140469536875008] DHCPSRV_CFGMGR_SOCKET_TYPE_SELECT using socket type raw
Sep 23 02:55:33 kea-dhcp4[2948]: 2025-09-23 02:55:33.050 INFO  [kea-dhcp4.commands/2948.140469536875008] COMMAND_ACCEPTOR_START Starting to accept connections via unix domain socket bound to /run/kea/dhcp4-ctrl-socket
Sep 23 02:55:33 kea-dhcp4[2948]: 2025-09-23 02:55:33.052 INFO  [kea-dhcp4.lease-cmds-hooks/2948.140469536875008] LEASE_CMDS_INIT_OK loading Lease Commands hooks library successful
Sep 23 02:55:33 kea-dhcp4[2948]: 2025-09-23 02:55:33.052 INFO  [kea-dhcp4.hooks/2948.140469536875008] HOOKS_LIBRARY_LOADED hooks library /usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_lease_cmds.so successfully loaded
Sep 23 02:55:33 kea-dhcp4[2948]: 2025-09-23 02:55:33.053 INFO  [kea-dhcp4.dhcp4/2948.140469536875008] DHCP4_CONFIG_COMPLETE DHCPv4 server has completed configuration: added IPv4 subnets: 1; DDNS: disabled
Sep 23 02:55:33 kea-dhcp4[2948]: 2025-09-23 02:55:33.056 INFO  [kea-dhcp4.dhcpsrv/2948.140469536875008] DHCPSRV_MEMFILE_DB opening memory file lease database: name=/config/dhcp/dhcp4-leases.csv persist=true type=memfile universe=4
Sep 23 02:55:33 kea-dhcp4[2948]: 2025-09-23 02:55:33.057 INFO  [kea-dhcp4.dhcpsrv/2948.140469536875008] DHCPSRV_MEMFILE_LEASE_FILE_LOAD loading leases from file /config/dhcp/dhcp4-leases.csv.2
Sep 23 02:55:33 kea-dhcp4[2948]: 2025-09-23 02:55:33.057 INFO  [kea-dhcp4.dhcpsrv/2948.140469536875008] DHCPSRV_MEMFILE_LEASE_FILE_LOAD loading leases from file /config/dhcp/dhcp4-leases.csv
Sep 23 02:55:33 kea-dhcp4[2948]: 2025-09-23 02:55:33.058 INFO  [kea-dhcp4.dhcpsrv/2948.140469536875008] DHCPSRV_MEMFILE_EXTRACT_EXTENDED_INFO4 extracting extended info saw 1 leases, extended info sanity checks modified 0 / updated 0 leases and 0 leases have relay or remote id
Sep 23 02:55:33 kea-dhcp4[2948]: 2025-09-23 02:55:33.058 INFO  [kea-dhcp4.dhcpsrv/2948.140469536875008] DHCPSRV_MEMFILE_LFC_SETUP setting up the Lease File Cleanup interval to 3600 sec
Sep 23 02:55:33 kea-dhcp4[2948]: 2025-09-23 02:55:33.059 WARN  [kea-dhcp4.dhcpsrv/2948.140469536875008] DHCPSRV_MULTIPLE_RAW_SOCKETS_PER_IFACE current configuration will result in opening multiple broadcast capable sockets on some interfaces and some DHCP messages may be duplicated
Sep 23 02:55:33 kea-dhcp4[2948]: 2025-09-23 02:55:33.059 WARN  [kea-dhcp4.dhcpsrv/2948.140469536875008] DHCPSRV_OPEN_SOCKET_FAIL failed to open socket: Failed to open socket on interface eth0, reason: failed to bind fallback socket to address 10.97.207.1, port 67, reason: Address already in use - is another DHCP server running?
Sep 23 02:55:33 kea-dhcp4[2948]: 2025-09-23 02:55:33.060 WARN  [kea-dhcp4.dhcpsrv/2948.140469536875008] DHCPSRV_OPEN_SOCKET_FAIL failed to open socket: Failed to open socket on interface eth0, reason: failed to bind fallback socket to address 10.97.207.11, port 67, reason: Address already in use - is another DHCP server running?
Sep 23 02:55:33 kea-dhcp4[2948]: 2025-09-23 02:55:33.060 WARN  [kea-dhcp4.dhcpsrv/2948.140469536875008] DHCPSRV_OPEN_SOCKET_FAIL failed to open socket: Failed to open socket on interface eth1, reason: failed to bind fallback socket to address 172.16.0.254, port 67, reason: Address already in use - is another DHCP server running?
Sep 23 02:55:33 kea-dhcp4[2948]: 2025-09-23 02:55:33.061 WARN  [kea-dhcp4.dhcpsrv/2948.140469536875008] DHCPSRV_OPEN_SOCKET_FAIL failed to open socket: Failed to open socket on interface eth2, reason: failed to bind fallback socket to address 172.16.2.254, port 67, reason: Address already in use - is another DHCP server running?

The command-line parameters to dhcrelay seem to be correct:
/usr/sbin/dhcrelay -4 -pf /run/dhcp-relay/dhcrelay.pid -c 10 -a -m forward -A 576 -id eth1 -iu eth0 10.97.5.51 10.97.5.41

Netstat shows that dhcrelay is listening on 0.0.0.0:67 though instead of the IPv4 address of the interface which I think is problematic here for Kea DHCP running.

vyos@vyostest1:~$ sudo ss -ulnp | grep :67
UNCONN 0      0                              0.0.0.0:67        0.0.0.0:*    users:(("dhcrelay",pid=2358,fd=8))

This worked correctly in 1.5-rolling-202312040024 before the switch to Kea DHCP server. With the slightly older DHCP server vyos config, this worked as expected and the dhcrelay parameters are the same:

vyos@vyostest1# sudo ps aux | grep dh
root        2997  0.0  0.0   5880  3708 ?        Ss   03:18   0:00 /usr/sbin/dhcrelay -4 -pf /run/dhcp-relay/dhcrelay.pid -c 10 -a -m forward -A 576 -id eth1 -iu eth0 10.97.5.51 10.97.5.41
dhcpd       3245  0.0  0.1   9764  7160 ?        Ss   03:19   0:00 /usr/sbin/dhcpd -4 -q -user dhcpd -group vyattacfg -pf /run/dhcp-server/dhcpd.pid -cf /run/dhcp-server/dhcpd.conf -lf /config/dhcpd.leases

The DHCP relay agent is the same version (4.4.3-P1) in 1.5-rolling-202312040024 and 2025.09.07-0020-rolling, so it seems that the ISC DHCP relay agent and DHCP server just work together to avoid the errors above.

Is there already a bug tracking this? Does anyone know how to run ISC DHCP relay and Kea DHCP concurrently?

Dave

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.