System-Specific Install Notes
For the basic installation notes, please see ISC's Knowledgebase. This wiki page documents installation for the integration of Kea with Sysrepo (NETCONF) and RADIUS. Also note that in most cases using native DEB packages are much easier way to get Kea installed quickly.
Building with FreeRADIUS (optional)
You need to have the subscription or premium package to make this work.
Install the FreeRADIUS client first:
git clone https://github.com/FreeRADIUS/freeradius-client.git
cd freeradius-client
./configure --prefix=/usr/local
make
sudo make install
Extract the Kea subscription (or premium) package to the "premium" subdirectory of the directory holding the Kea source, regenerate the "configure" script, then build with the "--with-freeradius" switch, specifying the directory into which you installed FreeRADIUS:
tar zxvf kea-subscription-1.4.0.tar.gz
autoreconf -if
./configure --with-freeradius=/usr/local
Make sure the following entries are printed after configure is done:
Package:
Name: kea
Version: 1.5.0-beta1-git
Extended version: 1.5.0-beta1-git (git e1def1242033065acf4462092636da6696cbdc44)
OS Family: Linux
Hooks directory: /usr/local/lib/hooks
Premium hooks: yes
Included Hooks: forensic_log flex_id host_cmds subnet_cmds radius host_cache
:
FreeRADIUS client:
FREERADIUS_INCLUDE: -I/usr/local/include
FREERADIUS_LIB: -L/usr/local/lib -lfreeradius-client
FREERADIUS_DICTIONARY: /usr/local/etc/radiusclient/dictionary
then compile as usual. (The version and extended version fields will reflect the version of Kea you are building.)
Building with NETCONF/Sysrepo 0.x (optional, Kea 1.9.9 and earlier)
Kea 1.5 introduced support for NETCONF. To build with this support, software called Sysrepo is needed.
The following installation instruction was tested on Ubuntu 18.04.
STEP 1. Follow the KB article and install regular Kea dependencies. Briefly, you should do the following:
$ sudo apt -y install automake libtool pkg-config build-essential ccache
$ sudo apt -y install libboost-dev libboost-system-dev liblog4cplus-dev libssl-dev
STEP 1. Install dependencies. Note that some of those dependencies are likely to be present in your system already.
$ sudo apt-get install bison build-essential cmake flex libavl-dev libev-dev \
libpcre3-dev libprotobuf-c-dev protobuf-c-compiler swig
STEP 2. Install libyang. Download libyang from https://github.com/CESNET/libyang/releases. The last version tested with Kea 1.6.0 was libyang 1.0-r3.
tar zxvf libyang-1.0-r3.tar.gz
cd libyang-1.0-r3
mkdir build
cd build
cmake ..
make
sudo make install
For detailed build instructions, see https://github.com/CESNET/libyang.
STEP 3. Install syrepo. Download sysrepo from https://github.com/sysrepo/sysrepo/releases. The last version tested with Kea 1.6.0 was 0.7.8. Note the sysrepo version is paired with the libyang one so when sysrepo is upgraded libyang must be upgraded first.
tar zxvf sysrepo-0.7.8.tar.gz
cd sysrepo-0.7.8
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DGEN_LANGUAGE_BINDINGS=ON -DGEN_CPP_BINDINGS=ON \
-DGEN_PYTHON_BINDINGS=OFF -DGEN_LUA_BINDINGS=OFF -DENABLE_TESTS=OFF ..
make
sudo make install
For detailed instructions, see Build and Installation Steps Section on the project page https://github.com/sysrepo/sysrepo.
Once Sysrepo is installed, you can proceed with Kea compilation:
$ autoreconf -i
$ ./configure --with-sysrepo
[...]
Kea source configure results:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Package:
Name: kea
Version: 1.6.0-beta2-git
Extended version: 1.6.0-beta2-git (git 334f63d8a8015371f9fc490de5c177f742a97427)
OS Family: Linux
[...]
Sysrepo:
SYSREPO_VERSION: 0.7.8
SYSREPO_CPPFLAGS: -I/usr/local/include
SYSREPO_LIBS: -L/usr/local/lib -lsysrepo -L/usr/local/lib -lSysrepo-cpp
SYSREPO_REPO: /home/thomson/devel/sysrepo-0.7.8/build/repository
You are now ready to compile kea. Use make
or make -j<number-of-cpu-cores>
.
Install new Kea YANG models
Kea 1.6.0 introduces some changes to the YANG models. If you are interested in using kea-dhcp4-server and kea-dhcp6-server only (these are the only supported models for now, you should navigate to Kea sources src/share/yang/modules and issue the following commands:
#!/bin/sh
# Sysrepo 0.7.8 comes with outdated ietf-interfaces. We need to uninstall its dependencies,
# then the ietf-interfaces module, then install the version provided with Kea.
sysrepoctl -u -m iana-if-type
sysrepoctl -u -m ietf-ip
sysrepoctl -u -m ietf-interfaces
sysrepoctl -i -s . -g ietf-interfaces@2018-02-20.yang
sysrepoctl -i -s . -g kea-dhcp4-server@2019-08-12.yang
sysrepoctl -i -s . -g kea-dhcp6-server@2019-08-12.yang
# If you intend to run kea unit-tests you should also install the following models.
# Note they're used in running unit-tests only and are useless in production.
sysrepoctl -i -s . -g ietf-dhcpv6-server@2018-09-04.yang
sysrepoctl -i -s . -g kea-ctrl-agent@2019-08-12.yang
sysrepoctl -i -s . -g kea-dhcp-ddns@2019-08-12.yang
sysrepoctl -i -s . -g keatest-module@2018-11-20.yang
Building with NETCONF/Sysrepo 1.x (optional, Kea 1.9.10 and later)
The following installation instruction was tested on Ubuntu 21.04.
STEP 1. Install libyang. Download libyang from https://github.com/CESNET/libyang/releases. The last version tested with Kea 1.9.10 was libyang 1.0.240. Compared to earlier libyang versions, many external dependencies were removed.
NOTE. As of July 2021, the recently released Sysrepo 2.0/libyang 2.0 does not provide C++ binding yet, as such are unusable for Kea. please use Sysrepo 1.x and libyang 1.x.
tar zxvf libyang-1.0.240.tar.gz
cd libyang-1.0.240
mkdir build
cd build
cmake -DGEN_LANGUAGE_BINDINGS=1 -DGEN_CPP_BINDINGS=1 -DGEN_PYTHON_BINDINGS=0 ..
make
sudo make install
Note: Feel free to enable bindings for other languages. However, Kea only uses bindings for C++, so enabling python bindings would just introduce unnecessary dependencies.
For detailed build instructions, see https://github.com/CESNET/libyang.
STEP 2. Install syrepo. Download sysrepo from https://github.com/sysrepo/sysrepo/releases. The last version tested with Kea 1.9.10 was 0.7.8. Note the sysrepo version is paired with the libyang one so when sysrepo is upgraded libyang must be upgraded first.
tar zxvf sysrepo-1.4.140.tar.gz
cd sysrepo-1.4.140/
mkdir build
cd build
cmake -DGEN_LANGUAGE_BINDINGS=1 -DGEN_CPP_BINDINGS=1 \
-DGEN_PYTHON_BINDINGS=0 -DENABLE_TESTS=0 ..
make
sudo make install
Note: Sysrepo has many more compilation flags that may be considered, including storage location, access permissions and more. For detailed instructions, see Build and Installation Steps Section on the project page for libyang 1.x: https://github.com/sysrepo/sysrepo/tree/libyang1.
STEP 3: Install dependency:
sudo apt install libpcre3-dev
This library is needed just to appease pkg-config dependency.
STEP 4: Compile Kea with Sysrepo enabled: ./configure --with-sysrepo=./tools/sysrepo_config
. Once the configure script completes, it will print many configuration options. The section about Sysrepo should look similar to this:
Sysrepo:
SYSREPO_VERSION: v1.4.140
SYSREPO_CPPFLAGS: -I/usr/local/include/ -I/usr/local/include/
SYSREPO_LIBS: -L/usr/local/lib/ -L/usr/local/lib/ -lyang -lsysrepo -L/usr/local/lib/ -L/usr/local/lib/ -lyang-cpp -lsysrepo-cpp
SYSREPO_REPO: /home/thomson/devel/sysrepo-1.4.140/build/repository
Now compile Kea as usual (make -j8
, sudo make install
).