2. Quick Start

This section describes the basic steps needed to get Kea up and running. For further details, full customizations, and troubleshooting, see the respective chapters elsewhere in this Kea Administrator Reference Manual (ARM).

2.1. Quick Start Guide Using tarball

  1. Install required runtime and build dependencies. See Build Requirements for details.

  2. Download the Kea source tarball from the main isc.org downloads page, the ISC downloads site, or the ISC Cloudsmith page.

  3. Extract the tarball. For example:

    $ tar -xvzf kea-2.7.3.tar.gz
  4. Go into the source directory and run the configure script:

    $ cd kea-2.7.3
    $ ./configure [your extra parameters]
  5. Build it:

    $ make
    
  6. Install it (by default it will be placed in /usr/local/, so root privileges are likely required for this step):

    $ make install
    

2.2. Quick Start Guide Using Native Packages

ISC provides native Alpine, deb, and RPM packages, which make Kea installation much easier than building from source. Unless specific compilation options are desired, it is usually easier to install Kea using native packages.

  1. Go to Kea on cloudsmith.io.

  2. Choose the Cloudsmith repository e.g. kea-dev for Kea 2.7.3. Or kea-2-4 for Kea 2.4.

Note

All stable releases are stored in separate repositories, such as kea-2-4, kea-2-6, and so on. All development releases, which are not recommended for production use, are located in the kea-dev repository.

  1. Click on the arrow beside the "Set Me Up" button and select the desired OS flavor: Alpine, Debian, or RedHat.

  2. Follow the onscreen instructions.

Note

For example, the Debian setup instructions for Kea 2.4 can be found here: https://cloudsmith.io/~isc/repos/kea-2-4/setup/#formats-deb

The dropdown near the top of the page offers instructions for other operating systems.

  1. Kea is split into various packages. The entire list is available on the Cloudsmith repository page under Packages, or it can be retrieved using apk/apt/dnf.

Debian/Ubuntu

$ apt search isc-kea

Note

isc-kea-dhcp4-server and isc-kea-dhcp6-server are empty transitional packages. The working server packages are isc-kea-dhcp4 and isc-kea-dhcp6.

Fedora/RedHat

$ dnf search 'isc-kea*'

Alpine

$ apk search isc-kea
  1. Install the metapackage containing all the tools, libraries, servers, documentation, and open source hooks:

Debian/Ubuntu

$ sudo apt install isc-kea

Fedora/RedHat

$ sudo dnf install isc-kea

Alpine

# apk add isc-kea

or specific packages:

Debian/Ubuntu

$ sudo apt install isc-kea-dhcp6

Fedora/RedHat

$ sudo dnf install isc-kea-dhcp6

Alpine

$ apk add isc-kea-dhcp6

or ALL Kea-related packages, including development headers, debug symbols, and premium hooks (if available):

Debian/Ubuntu

$ sudo apt install 'isc-kea*'

Fedora/RedHat

$ sudo dnf install 'isc-kea*'

Alpine

Installing packages via globbing (*) is not available for Alpine, but it can be simulated with the following command:

# apk search isc-kea | sed 's/-[0-9].*//g' | xargs apk add

or all packages with a specified version number:

Debian/Ubuntu

$ sudo apt install 'isc-kea*=2.4.0-isc20230921141113'

Fedora/RedHat

$ sudo dnf install 'isc-kea*2.4.0-isc20230921141113*'

Alpine

Installing packages via globbing (*) is not available for Alpine, but it can be simulated with the following command:

# apk search isc-kea | sed 's/-[0-9].*//g' | grep r20230921141113 | xargs apk add
  1. All installed packages should be now available.

    You can start a server manually:

    # kea-dhcp6 -c /etc/kea/kea-dhcp6.conf
    

    or using systemd:

    # systemctl restart kea-dhcp6
    

    or using OpenRC on Alpine:

    # service kea-dhcp6 restart
    

Note

keactrl is not available in packages, as similar functionality is provided by the native systemctl scripts.

  1. On Debian/Ubuntu systems, the service is automatically enabled at boot time when the package is installed. On Fedora/RHEL and Alpine, the service is not automatically enabled, so if desired, it must be enabled manually.

    With systemd on Fedora/RedHat:

    # systemctl enable kea-dhcp6
    

    With OpenRC on Alpine:

    # rc-update add kea-dhcp6
    

2.3. Quick Start Guide Using Docker Containers

  1. Go to the ISC docker repository on cloudsmith.io.

  2. Create an ipvlan network attached to the client-facing host interface and assigned to the subnet that is served by Kea.

$ docker network create --driver ipvlan --ipv6 --subnet 2001:db8::/64 --opt parent=eth0 ipvlan0
  1. Pick the desired image and pull it locally.

$ docker pull docker.cloudsmith.io/isc/docker/kea-dhcp6
  1. Create a container from the image. Mount the configuration volume and the data volume if needed.

$ docker create \
    --name kea-dhcp6 \
    --network ipvlan0 \
    --volume /local/kea/config:/etc/kea \
    --volume /local/kea/data:/var/lib/kea \
    docker.cloudsmith.io/isc/docker/kea-dhcp6
  1. Start the docker container.

$ docker start kea-dhcp6
  1. To stop the docker container, run:

$ docker stop kea-dhcp6

Note

Refer to the kea-docker readme for more complex scenarios.

2.4. Quick Start Guide for DHCPv4 and DHCPv6 Services

  1. Edit the Kea configuration files, which by default are installed in the [kea-install-dir]/etc/kea/ directory. These are: kea-dhcp4.conf, kea-dhcp6.conf, kea-dhcp-ddns.conf and kea-ctrl-agent.conf, keactrl.conf for the DHCPv4 server, DHCPv6 server, D2, Control Agent, and keactrl script, respectively.

  2. To start the DHCPv4 server in the background, run the following command (as root):

    # keactrl start -s dhcp4
    

    Or run the following command to start the DHCPv6 server:

    # keactrl start -s dhcp6
    

    Note that it is also possible to start all servers simultaneously:

    # keactrl start
    
  3. Verify that the Kea server(s) is/are running:

    # keactrl status
    

    A server status of "inactive" may indicate a configuration error. Please check the log file (by default named [kea-install-dir]/var/log/kea-dhcp4.log, [kea-install-dir]/var/log/kea-dhcp6.log, [kea-install-dir]/var/log/kea-ddns.log, or [kea-install-dir]/var/log/kea-ctrl-agent.log) for the details of any errors.

  4. If the server has started successfully, test that it is responding to DHCP queries and that the client receives a configuration from the server; for example, use the ISC DHCP client.

  5. To stop running the server(s):

    # keactrl stop
    

For system-specific instructions, please read the system-specific notes, available in the Kea section of ISC's Knowledgebase.

The details of keactrl script usage can be found in Managing Kea with keactrl.

Once Kea services are up and running, consider deploying a dashboard solution to monitor running services. For more details, see Monitoring Kea With Stork.

2.5. Running the Kea Servers Directly

The Kea servers can be started directly, without the need to use keactrl or systemctl. To start the DHCPv4 server run the following command:

# kea-dhcp4 -c /path/to/your/kea4/config/file.json

Similarly, to start the DHCPv6 server, run the following command:

# kea-dhcp6 -c /path/to/your/kea6/config/file.json