This is an old revision of the document!
Docker - DHCP Server
I propose to create a Docker ISC Kea Image using base Docker Alpine Linux images, with S6 init system. (ISC Kea is a modern replacement for their DHCP.)
ISC also has a project for a simple GUI interface primarily for Kea and basic for Bind9. There is apparently no Alpine package yet for Stork.
ISC-Kea seems to be provided in a number of packages
Package | Descriptiion | Comment |
---|---|---|
isc-kea-admin | This package provides backend database initialization and migration scripts and a DHCP benchmark tool. If you are not using a database backend, you may not need this. | Not using a database backend at this time |
isc-kea-common | Common libraries for the ISC Kea DHCP server. Install this. | Need this. |
isc-kea-ctrl-agent | This package provides the REST API service agent for Kea DHCP. | ? |
isc-kea-dev | Development headers for ISC Kea DHCP server. Install if you plan to create any custom Kea hooks. | Probably do not need. |
isc-kea-dhcp4-server | DHCPv4 server. | Need this. |
isc-kea-dhcp6-server | DHCPv6 server. | Do not need at this time. |
isc-kea-dhcp-ddns-server | DDNS server. | Need this. |
isc-kea-doc | Kea documentation. Highly recommended. | On a Docker container? |
isc-kea-hook-flex-option | Flexible Options hook. | What is this? |
isc-kea-hook-ha | High Availability hook. | What is this? |
isc-kea-hook-lease-cmds | Lease Commands hook. | What is this? |
isc-kea-hook-mysql-cb | MySQL Configuration Backend. | Dont need this at this time. |
isc-kea-hook-pgsql-cb | PostgreSQL Configuration Backend. | Dont need this. |
isc-kea-hook-stat-cmds | Statistics Commands hook. | ? |
isc-kea-http | This package is essential, install it. | It is essential… |
isc-kea-perfdhcp | Optional. Includes a DHCP performance testing tool from ISC. | ? |
isc-kea-shell | Text client for Kea DHCP Control Agent. | ? |
Network Ports
From IANA Service Name and Transport Protocol Port online Number Registry:
bootps 67 {tcp, udp} Bootstrap Protocol Server (DHCP) bootpc 68 {tcp, udp} Bootstrap Protocol Client (DHCP)
The Kea Control Agent uses port 8000 by default, but that value can be manually defined in its configuration file. (Usually located at /etc/kea/kea-ctrl-agent.conf.) This port needs to be open and accessible on every server that hosts a Kea DHCP service and a Kea Control Agent.
Docker Network Type
This is a good case where the Docker network type needs to be set to host. The DHCP server needs to be directly on the host to function.
DHCP testing
sudo nmap --script broadcast-dhcp-discover
will test the DHCP servers on the same network.
Reference
main dhcp4
kea-dhcp4 -t /app/dhcpv4.conf
to test the kea-dhcp4 configuration files/app/dhcpv4.conf
kea-dhcp4 -c /app/dhcpv4.conf
to start kea dhcp4 using configuration file/app/dhcpv4.conf
To control which dhcp4 config file to run (basic or plus):
ln -s .config/dhcp_basic.conf .config/dhcp.conf
to run basicln -s .config/dhcp_plus.conf .config/dhcp.conf
to run plus- The
-f
flag can be used to overwrite an existing link file instead of deleting first.
The plus configuration allows a secondary backup dhcp server to be operated.
ctrl-agent -t /app/kea-ctrl-agent.conf
kea-ctrl-agent -t /app/kea-ctrl-agent.conf
to test the kea-cont-agent configuration file/app/kea-ctrl-agent.conf
kea-ctrl-agent -c /app/kea-ctrl-agent.conf
to start the kea-cont-agent configuration file/app/kea-ctrl-agent.conf
References
- KPTree.net's bare metal implementation of dns - dhcp, based upon ISC Bind9 and DHCP on Debian 10 (was originally Ubuntu).
- ISC documentation