
KEA is a new open source DHCPv4/DHCPv6 server being developed by Internet Systems Consortium. It’s supposed to become a very high-performance, extensible DHCP server engine for use by enterprises and service providers.
Why a new DHCP implementation? Well, Tomek Mrugalski, lead developer of kea, answered this question earlier this year in Warsaw: “Existing code is 18 years old, networks have changed, hardware has changed, use cases have changed“. On the other hand ISC DHCP has complex code, is difficult to extend, lack of documentation, performance not always sufficient and partial dynamic configuration (OMAPI).
I’m going to show you how to get a working kea setup on a FreeBSD 10.1 box. Let’s start with some prerequisite software:
cd /usr/ports/security/botan-110
make install clean
Remember to install all botan dependencies.
Next, some logging stuff:
cd /usr/port/devel/log4cplus
make install clean
Now, has been reported that there is an issue (http://kea.isc.org/ticket/3603) with boost libraries 1.55.0 (available from ports) therefore let’s grab the ultimate version (1.57.0) from “boost c++ libraries” and configure it:
cd /root/
fetch http://downloads.sourceforge.net/project/boost/boost/1.57.0/boost_1_57_0.tar.bz2
tar jxf boost_1_57_0.tar.bz2
cd boost_1_57_0
./bootstrap.sh --with-toolset=cc
Download kea and install it using the previously installed boost:
fetch http://ftp.isc.org/isc/kea/0.9/kea-0.9.tar.gz
cd kea-0.9
./configure --with-boost-include=/root/boost_1_57_0
make
make install
Edit kea.conf to best suit your environment or feel free to use the following tested and working config:
cd /usr/local/etc/kea
vi kea.conf
# This is a basic configuration for the Kea DHCPv4 and DHCPv6 servers.
# Subnet declarations are commented out and no interfaces are listed.
# Therefore, the servers will not listen or to any queries. The basic
# configuration must be extended to specify interfaces on which the
# servers should listen. Also, subnets and options must be declared.
{
# DHCPv4 configuration starts here.
“Dhcp4”:
{
# Add names of interfaces to listen on.
“interfaces”: [“*”],
# Use Memfile lease database backend to store leases in a CSV file.
“lease-database”: {
“type”: “memfile”
},
# Global (inherited by all subnets) lease lifetime is mandatory parameter.
“valid-lifetime”: 4000,
# Below an example of the simple subnet declaration. Uncomment to
# enable it.
“subnet4”: [
{ “subnet”: “192.0.2.0/24”,
“pools”: [ { “pool”: “192.0.2.1 – 192.0.2.200” } ] }
]
},
# DHCPv6 configuration starts here.
“Dhcp6”:
{
# Add names of interfaces to listen on.
“interfaces”: [“*”],
# Addresses will be assigned with preferred and valid lifetimes
# being 3000 and 4000, respectively. Client is told to start
# renewing after 1000 seconds. If the server does not repond
# after 2000 seconds since the lease was granted, client is supposed
# to start REBIND procedure (emergency renewal that allows switching
# to a different server).
“preferred-lifetime”: 3000,
“valid-lifetime”: 4000,
“renew-timer”: 1000,
“rebind-timer”: 2000,
# The following list defines subnets. Uncomment to enable them.
“subnet6”: [
{ “subnet”: “2001:db8:1::/64”,
“pools”: [{ “pool”: “2001:db8:1::/80” } ] },
# { “subnet”: “2001:db8:2::/64”,
# “pool”: [ “2001:db8:2::/80” ] },
# { “subnet”: “2001:db8:3::/64”,
# “pool”: [ “2001:db8:3::/80” ] },
# { “subnet”: “2001:db8:4::/64”,
# “pool”: [ “2001:db8:4::/80” ] }
]
},
# DHCP DDNS configuration starts here.
“DhcpDdns”:
{
“ip_address”: “127.0.0.1”,
“port”: 53001,
“tsig_keys”: [],
“forward_ddns” : {},
“reverse_ddns” : {}
},
# Logging configuration starts here. It tells Kea servers to store
# all log messages (on severity INFO or more) in a file.
# debuglevel variable is used on DEBUG level only.
“Logging”:
{
“loggers”: [
{
“name”: “kea”,
“output_options”: [
{
“output”: “${prefix}/var/log/kea.log”
}
],
“severity”: “INFO”,
“debuglevel”: 0
}
]
}
}
Fire up the engine (IPv4 and IPv6):
keactrl start
verify it’s running:
ps|grep kea
41261 0 I 0:00.03 /usr/local/sbin/kea-dhcp4 -c /usr/local/etc/kea/kea.conf
41273 0 I 0:00.03 /usr/local/sbin/kea-dhcp6 -c /usr/local/etc/kea/kea.conf
41285 0 I 0:00.02 /usr/local/sbin/kea-dhcp-ddns -c /usr/local/etc/kea/kea.conf
verify it’s listening:
sockstat|grep kea
root kea-dhcp-d 41285 7 udp4 127.0.0.1:53001 *:*
root kea-dhcp6 41273 3 udp6 *:547 *:*
root kea-dhcp4 41261 6 udp4 10.0.2.15:67 *:*
What you have now is a simple and working instance of kea. Start here to gain experience and don’t forget to read all the relevant papers: http://ftp.isc.org/isc/kea/0.9/doc/kea-guide.txt
Continue following kea by subscribing to the mailing list: https://lists.isc.org/mailman/listinfo/kea-dev
Here is the announced roadmap: