You are not logged in.

#1 2021-01-02 17:18:41

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,222

Running kea instead of dhcpd to provide LAN ip addresses

In recent months I have been looking at changing over from ISC dhcp on a LAN server, to using the much more modern kea dhcp package to provide local LAN ip addresses.  The version in arch is community/kea 1.5.0-19 which is quite out of date now, and in [testing] arch has kea-1.8.0-7 which is the current upstream stable version.  Having tried running kea 1.8 there were issues trying to set it up. I have been working with another arch user to create a local private arch package for kea-git, which is built using the latest upstream version 1.9.2 - which actually works really well. It is much more modern code than the long-standing extra/dhcp 4.4.2-2 package, and can be easily run as a standalone server or alongside a synchronised secondary or backup server on other machines in the same network, that will take over should the primary fail.  The documentation is at https://kea.readthedocs.io/en/kea-1.9.2/arm/intro.html, and the upstream source code is at https://gitlab.isc.org/isc-projects/kea

Setting up the config files was not as difficult as I had imagined, and there is also a nice test mode to check syntax.  For a basic server all that is needed are the config files:

keactrl.conf
kea-ctrl-agent.conf
kea-dhcp4.conf

which can be started using the sample files from the package. Then once set up the configs can be checked with:

kea-ctrl-agent -t  kea-ctrl-agent.conf
kea-dhcp4 -t kea-dhcp4.conf

and then run with

# systemctl start kea-ctrl-agent

and start the dhcp server:

systemctl start kea-dhcp4

Once running they can be started at boot by enabling the services. 

There are multiple options for storage of the leases - but the basic way is in a text csv file - which is nicely readable - and you get a file similar to this:

$ cat /var/lib/kea/kea-leases4.csv
address,hwaddr,client_id,valid_lifetime,expire,subnet_id,fqdn_fwd,fqdn_rev,hostname,state,user_context
10.0.0.63,60:6d:3c:13:c8:40,01:60:6d:3c:13:c8:40,14400,1609615403,1,0,0,amazonfiretv,0,
10.0.0.66,d8:c0:a6:8c:c6:c3,ff:2b:db:95:11:00:02:00:00:ab:11:72:87:2a:da:87:7d:16:67,14400,1609621019,1,0,0,ryzen1,0,
10.0.0.72,5c:41:5a:b6:6c:8d,,14400,1609620901,1,0,0,echomasterbed,0,
10.0.0.73,5c:41:5a:92:e7:be,01:5c:41:5a:92:e7:be,14400,1609618688,1,0,0,echokitchen,0,
10.0.0.74,cc:9e:a2:26:0b:0b,01:cc:9e:a2:26:0b:0b,14400,1609619374,1,0,0,echolounge,0,
10.0.0.78,7c:61:66:42:c0:b0,01:7c:61:66:42:c0:b0,14400,1609620511,1,0,0,echobed3,0,
10.0.0.82,08:a6:bc:e7:3d:4d,01:08:a6:bc:e7:3d:4d,14400,1609615083,1,0,0,echobed2,0,
10.0.0.83,36:cd:d5:7a:20:e8,01:36:cd:d5:7a:20:e8,14400,1609615425,1,0,0,pixeldeb,0,
10.0.0.88,ec:b5:fa:04:dc:2a,,14400,1609619404,1,0,0,huebridge,0,

It is easy to set log files for /var/log/kea/ and the level of logging can be changed - initially INFO is useful to indicate any issues with the config lines, and then once running changing to just WARN.

So it all works very nicely - the only thing is that the package in arch could do with bringing up to date - the version in testing does have issues, but with 1.9.2 running well it would be nice to see the arch package, at least in testing, updated to the git upstream version 1.9.2 - since it works and I have not found any problems running it. However one of the package maintainers seems to no longer be an arch packager, and the other two named on the package are not responsive on email at the moment. I wonder if this could be 'adopted' by another maintainer who might have an interest, since kea seems to be the package that is being taken up by web servers to replace the old dhcp package in increasing numbers, and given that arch usually is very bleeding edge and up to date, it would be nice to see arch have this package available for those arch users who want to be more up to date with dhcp services. Is this worth putting in an arch bug report for a request to bring the package into the repos more up to date?


Mike C

Offline

#2 2021-01-18 15:23:00

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,222

Re: Running kea instead of dhcpd to provide LAN ip addresses

kea-1.9.3-1 is now in [community-testing] and it works beautifully with my config files serving my local home network.  If anyone else wants to use this package, this new version seems to be running very nicely now.


Mike C

Offline

#3 2021-01-18 17:19:14

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,222

Re: Running kea instead of dhcpd to provide LAN ip addresses

The package is now in [community] so it is generally available now after the maintainer has done a lot of work in getting a fully functional version:

$ pacman -Ss kea
community/kea 1.9.3-1 [installed]
    High-performance, extensible DHCP server engine from ISC, supporting both DHCPv4 and DHCPv6

It is excellent to see Arch now has the latest and operational version of this modern replacement for the old ISC DHCP.

The documentation for the current version is now at https://kea.readthedocs.io/en/kea-1.9.3/arm/intro.html  (the arm in the url is not related to the arm architecture}

Last edited by mcloaked (2021-01-18 18:08:43)


Mike C

Offline

Board footer

Powered by FluxBB