• Print
  • Share
  • Dark
    Light

Kea build on Debian

  • Updated on 28 Sep 2018
  • 5 minutes to read
  • Contributors

These instructions are for Debian 9.2. Changes for newer Debian versions are noted.

Confirmed Builds
2017-11-22: Kea 1.3.0 Source installation (with hooks) on Debian 9.2 with PostgreSQL support.

2018-09-27: Kea 1.4.0-P1 Source installation on Debian 9.5 with PostgreSQL and MySQL.

Introduction and System Description

Overview of installing and compiling Kea 1.3.0 from source tarball and git on Debian 9.2, with added PostgreSQL support.

$ prompt implies non-privileged user commands

# prompt implies privileged user commands (ie: run with sudo, or run as root)

Debian 9.2 Installation Notes

The Debian installation in this example was performed as a network install using the minimal install image.

See this how-to on a Debian minimal install. The how-to linked is for Debian 9.1, but it should be the same for 9.2.

When the install gets to the Software selection screen, only SSH server and "standard system utilities" were selected.

Setup of Packaged Prerequisites

The following list of packages is believed to be the complete list required for this use case.

# apt-get install automake libtool pkg-config libboost-dev libboost-system-dev liblog4cplus-dev build-essential libssl-dev ccache

Note on Postgres

If you want to compile Kea with PostgreSQL, support also install the following packages:

# apt-get install postgresql-server-dev-all libpq-dev 

Make sure you use --with-dhcp-pgsql (Kea 1.3) or --with-pgsql (Kea 1.4 or later) in addition to any other options when running ./configure.

Note on development environment

If you want to compile Kea with unit-tests (not needed for users, only useful if you want to change Kea code and possibly contribute patches), you will need the following:

# apt-get install googletest libgtest-dev

Make sure you extend your configure script with --with-gtest-source=/usr/src/googletest as this is where Debian puts the Google test sources.

Tarball install

Distribution tarballs can be found on ftp.isc.org in the directory /isc/kea/<version> Be sure to download the tar.gz file for the appropriate version and patch level.

Once downloaded, the tarball may be extracted and installed:

$ mkdir Kea
$ cd Kea
$ ftp ftp.isc.org
Trying 149.20.1.49:21 ...
Connected to ftp.isc.org.
220 Welcome to ftp.isc.org.
Name (ftp.isc.org:aclegg): anonymous
331 Please specify the password.
Password: 
230-
230-You have reached ISC's FTP SERVER (ftp.isc.org)
230-[......]
230-Questions regarding this service should be sent to webmaster@isc.org.
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd /isc/kea
250 Directory successfully changed.
ftp> dir
229 Entering Extended Passive Mode (|||17093|)
150 Here comes the directory listing.
drwxr-xr-x    4 ftp      ftp           512 Jan 28  2015 0.9
drwxr-xr-x    3 ftp      ftp           512 Aug 13  2014 0.9-beta1
drwxr-xr-x    3 ftp      ftp           512 Mar 31  2015 0.9.1
drwxr-xr-x    2 ftp      ftp           512 Feb 18  2015 0.9.1-beta
drwxr-xr-x    3 ftp      ftp           512 Jul 28  2015 0.9.2
drwxr-xr-x    3 ftp      ftp           512 Dec 22  2015 0.9.2-P1
drwxr-xr-x    3 ftp      ftp           512 Jun 30  2015 0.9.2-beta
drwxr-xr-x    3 ftp      ftp           512 Dec 29  2015 1.0.0
drwxr-xr-x    3 ftp      ftp           512 Dec 08  2015 1.0.0-beta
drwxr-xr-x    3 ftp      ftp           512 Dec 22  2015 1.0.0-beta2
drwxr-xr-x    3 ftp      ftp           512 Sep 30  2016 1.1.0
drwxr-xr-x    3 ftp      ftp           512 Aug 31  2016 1.1.0-beta
drwxr-xr-x    3 ftp      ftp           512 May 09  2017 1.2.0
drwxr-xr-x    3 ftp      ftp           512 Apr 07  2017 1.2.0-beta
drwxr-xr-x    3 ftp      ftp           512 Oct 27  2017 1.3.0
drwxr-xr-x    3 ftp      ftp           512 Sep 29  2017 1.3.0-beta
drwxr-xr-x    3 ftp      ftp           512 Jun 15 15:04 1.4.0
drwxr-xr-x    2 ftp      ftp           512 Jul 11 21:47 1.4.0-P1
drwxr-xr-x    3 ftp      ftp           512 May 18 15:58 1.4.0-beta
drwxr-xr-x    3 ftp      ftp           512 Dec 19  2014 20141219
drwxr-xr-x    3 ftp      ftp           512 Dec 24  2014 20141223
drwxr-xr-x    3 ftp      ftp           512 Jan 31  2017 20170131
drwxrwx--x   21 ftp      ftp          1024 Jul 03 23:12 private
226 Directory send OK.
ftp> cd 1.4.0-P1
250 Directory successfully changed.
ftp> dir
229 Entering Extended Passive Mode (|||10632|)
150 Here comes the directory listing.
-rw-r--r--    1 ftp      ftp          1436 Jul 11 21:47 Kea140P1ReleaseNotes.txt
-rw-r--r--    1 ftp      ftp       6645111 Jul 11 21:47 kea-1.4.0-P1.tar.gz
-rw-r--r--    1 ftp      ftp           873 Jul 11 21:47 kea-1.4.0-P1.tar.gz.asc
-rw-r--r--    1 ftp      ftp           873 Jul 11 21:47 kea-1.4.0-P1.tar.gz.sha1.asc
-rw-r--r--    1 ftp      ftp           873 Jul 11 21:47 kea-1.4.0-P1.tar.gz.sha256.asc
-rw-r--r--    1 ftp      ftp           873 Jul 11 21:47 kea-1.4.0-P1.tar.gz.sha512.asc
-rw-r--r--    1 ftp      ftp           896 Jul 11 21:47 kea-guide.css
-rw-r--r--    1 ftp      ftp       1087372 Jul 11 21:47 kea-guide.html
-rw-r--r--    1 ftp      ftp       1146571 Jul 11 21:47 kea-guide.pdf
-rw-r--r--    1 ftp      ftp        888993 Jul 11 21:47 kea-guide.txt
-rw-r--r--    1 ftp      ftp          9978 Jul 11 21:47 kea-logo-100x70.png
-rw-r--r--    1 ftp      ftp        385974 Jul 11 21:47 kea-messages.html
-rw-r--r--    1 ftp      ftp        285967 Jul 11 21:47 kea-messages.pdf
226 Directory send OK.
ftp> get kea-1.4.0-P1.tar.gz
local: kea-1.4.0-P1.tar.gz remote: kea-1.4.0-P1.tar.gz
229 Entering Extended Passive Mode (|||49615|)
150 Opening BINARY mode data connection for kea-1.4.0-P1.tar.gz (6645111 bytes).
100% |***************************************************************************************************|  6489 KiB  799.87 KiB/s    00:00 ETA
226 Transfer complete.
6645111 bytes received in 00:08 (790.90 KiB/s)
ftp> quit
221 Goodbye.
$ tar xfz kea-1.4.0-P1.tar.gz
$ cd kea-1.4.0-P1
$ autoreconf --install

Git install

If you are compiling from git source, clone the git repository and reconfigure

# apt-get install git
$ git clone https://github.com/isc-projects/kea.git
Cloning into 'kea'...
remote: Counting objects: 225440, done.
remote: Compressing objects: 100% (144/144), done.
remote: Total 225440 (delta 201), reused 154 (delta 131), pack-reused 225165
Receiving objects: 100% (225440/225440), 50.95 MiB | 15.72 MiB/s, done.
Resolving deltas: 100% (184957/184957), done.
$ cd kea
$ autoreconf --install

Note on hooks library

If using hooks, copy the tarball into the root of the Kea source tree, and extract in place.

$ cp kea-subscription-1.3.0.tar.gz kea-1.3.0/
$ tar -zxvf kea-subscription-1.3.0.tar.gz

Building and Installing

The following environment variables attempt to speed up compilation, and recompilation.

$ export CC="ccache gcc" CXX="ccache g++"

Configure the installation. This example enables PostgreSQL and the Kea hooks library. Note that a Kea support is required to obtain the Kea hooks source tarball. If you don't know what this means, chances are the option will do nothing.

$ ./configure --with-dhcp-pgsql --with-tier2=yes

Starting with 1.4, the command line option for PostgreSQL will be --with-pgsql.

Compile and install the configured source tree. Assuming your Kea server has 2 CPU cores, substitute -jX with -j2

$ make -jX
# make install

Add the Kea libraries to ldconfig

# touch /etc/ld.so.conf.d/kea.conf
# echo "/usr/local/lib/hooks" > /etc/ld.so.conf.d/kea.conf
# ldconfig

Notes on Running

There is no startup script provided. Once Kea is correctly installed and configured for your environment, you will likely want to start it on boot. You can do so by simply adding the following to /etc/rc.local and enabling rc.local compatibility on your system.

# /etc/rc.local
#!/bin/bash
keactrl start
exit 0

See [https://lists.debian.org/debian-user/2014/08/msg01349.html This Link] for details in enabling rc.local compatibility.

Note: Debian's default systemd handles startup in more modern ways. rc.local compatibility is considered the old way.