A quick and easy ISC-Kea DHCP HA cluster built on Debian Linux
Perquisites
- 2 hosts physical or virtual
- Debian Linux 11 Deployed
- SSH access enabled for implementation
Topology Diagram

Kea Package Installation For Host 1 and 2
apt-get update -y $$ apt-get upgrade -y
apt-get install net-tools bind9 ntp nano htop iftop curl -y
curl -1sLf 'https://dl.cloudsmith.io/public/isc/kea-2-4/setup.deb.sh' | bash
apt-get install isc-kea -y
Kea-Host1 CTR Agent Configuration
File Location:- /etc/kea/kea-ctrl-agent.conf
{ "Control-agent": { "http-host": "192.168.1.10", "http-port": 8000, "control-sockets": { "dhcp4": { "comment": "socket to DHCP4 server", "socket-type": "unix", "socket-name": "/tmp/kea4-ctrl-socket" }, "dhcp6": { "socket-type": "unix", "socket-name": "/tmp/kea6-ctrl-socket" }, "d2": { "socket-type": "unix", "socket-name": "/tmp/kea-ddns-ctrl-socket", "user-context": { "in-use": false } } }, "loggers": [ { "name": "kea-ctrl-agent", "output_options": [ { "output": "stdout", } ], "severity": "DEBUG" } ] } }
Kea-Host1 DHCP Configuration
File Location:- /etc/kea/kea-dhcp4.conf
{ "Dhcp4": { "interfaces-config": { "interfaces": [ "enp2s0" ] }, "control-socket": { "socket-type": "unix", "socket-name": "/tmp/kea4-ctrl-socket" }, "lease-database": { "type": "memfile" }, "valid-lifetime": 43200, // leases will be valid for 12h "renew-timer": 21600, // clients should renew every 6h "rebind-timer": 32400, // clients should start looking for other servers after 9h "expired-leases-processing": { "reclaim-timer-wait-time": 3600, "hold-reclaimed-time": 172800, "max-reclaim-leases": 0, "max-reclaim-time": 0 }, "hooks-libraries": [ { "library": "/usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_lease_cmds.so" }, { "library": "/usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_ha.so", "parameters": { "high-availability": [ { "this-server-name": "kea-host1", "mode": "hot-standby", "heartbeat-delay": 10000, "max-response-delay": 60000, "max-ack-delay": 5000, "max-unacked-clients": 5, "sync-timeout": 60000, "peers": [ { "name": "server1", "url": "http://192.168.1.10:8000/", "role": "primary" }, { "name": "server2", "url": "http://192.168.1.12:8000/", "role": "standby" } ] } ] } } ], "subnet1": [ { "subnet": "192.168.1.0/24", "id": 103444, "interface": "enp2s0", "pools": [ { "pool": "192.168.1.50-192.168.1.254" } ], "option-data": [ { "name": "routers", "data": "192.168.1.1" }, { "name": "domain-name-servers", "data": "8.8.8.8,1.1.1.1", "always-send": true }, { "name": "domain-name", "data": "gatanet.ro" }, { "name": "domain-search", "data": "gatanet.ro" }, { "name": "ntp-servers", "data": "192.168.1.10,192.168.1.12", "always-send": true } ] } ], "loggers": [ { "name": "kea-dhcp4", "output_options": [ { "output": "stdout", } ], "severity": "DEBUG" } ] } }
Kea-Host2 CTR Agent Configuration
File Location:- /etc/kea/kea-ctrl-agent.conf
{ "Control-agent": { "http-host": "192.168.1.12", "http-port": 8000, "control-sockets": { "dhcp4": { "comment": "socket to DHCP4 server", "socket-type": "unix", "socket-name": "/tmp/kea4-ctrl-socket" }, "dhcp6": { "socket-type": "unix", "socket-name": "/tmp/kea6-ctrl-socket" }, "d2": { "socket-type": "unix", "socket-name": "/tmp/kea-ddns-ctrl-socket", "user-context": { "in-use": false } } }, "loggers": [ { "name": "kea-ctrl-agent", "output_options": [ { "output": "stdout", } ], "severity": "DEBUG" } ] } }
Kea-Host1 DHCP Configuration
File Location:- /etc/kea/kea-dhcp4.conf
{ "Dhcp4": { "interfaces-config": { "interfaces": [ "enp2s0" ] }, "control-socket": { "socket-type": "unix", "socket-name": "/tmp/kea4-ctrl-socket" }, "lease-database": { "type": "memfile" }, "valid-lifetime": 43200, // leases will be valid for 12h "renew-timer": 21600, // clients should renew every 6h "rebind-timer": 32400, // clients should start looking for other servers after 9h "expired-leases-processing": { "reclaim-timer-wait-time": 3600, "hold-reclaimed-time": 172800, "max-reclaim-leases": 0, "max-reclaim-time": 0 }, "hooks-libraries": [ { "library": "/usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_lease_cmds.so" }, { "library": "/usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_ha.so", "parameters": { "high-availability": [ { "this-server-name": "kea-host2", "mode": "hot-standby", "heartbeat-delay": 10000, "max-response-delay": 60000, "max-ack-delay": 5000, "max-unacked-clients": 5, "sync-timeout": 60000, "peers": [ { "name": "server1", "url": "http://192.168.1.10:8000/", "role": "primary" }, { "name": "server2", "url": "http://192.168.1.12:8000/", "role": "standby" } ] } ] } } ], "subnet1": [ { "subnet": "192.168.1.0/24", "id": 103444, "interface": "enp2s0", "pools": [ { "pool": "192.168.1.50-192.168.1.254" } ], "option-data": [ { "name": "routers", "data": "192.168.1.1" }, { "name": "domain-name-servers", "data": "8.8.8.8,1.1.1.1", "always-send": true }, { "name": "domain-name", "data": "gatanet.ro" }, { "name": "domain-search", "data": "gatanet.ro" }, { "name": "ntp-servers", "data": "192.168.1.10,192.168.1.12", "always-send": true } ] } ], "loggers": [ { "name": "kea-dhcp4", "output_options": [ { "output": "stdout", } ], "severity": "DEBUG" } ] } }