[Kea-users] Where to put data for kea.

Marek Greško marek.gresko at protonmail.com
Fri Jan 12 06:34:22 UTC 2024



Hello Albert,

I am not a real expert on kea, but I can add my 2 cents. We have been using dhcpd, which config was generated by shell script. So we only modified it to generate kea config. The main advantage of kea compared to dhcpd is that kea enables you to include another config file using <?include "/path/to/config-file.conf"?> statement. This enabled us to slightly simplify the script compared to the one used with dhcpd.

I agree with Darren it is not recommended to use global reservations with kea. I am not 100% sure, but if I remember correctly, when I used global reservations and had a computer to assigned to 2 different vlans (one for lan, one for wifi), I was not able to create reservation for IPv6 addresses, since DUID was common in both vlans. This was not a problem in dhcpd, since it offered reservations only from the subnet, but it I remember correctly, kea offered the IPv6 address not belonging to subnet without a shame. So we modified the script not to generate global reservations, but seperated reservations into subnets.

So fragments of our current configuration reads:

{
  "id": 100,
  "subnet": "192.168.1.0/24",
  "interface": "bond0.100",
  "pools": [ { "pool": "192.168.1.200 - 192.168.1.220" } ],

...

  "reservations": [
    <?include "/etc/kea/kea-dhcp4-reservations-lan.conf"?>
  ]
},
{
  "id": 200,
  "subnet": "192.168.2.0/24",
  "interface": "bond0.200",
  "pools": [ { "pool": "192.168.2.200 - 192.168.2.220" } ],

...

  "reservations": [
    <?include "/etc/kea/kea-dhcp4-reservations-wifi.conf"?>
  ]
},

and we generate those included files by the script. The script converts the csv like table file into the json configuration file for each subnet separately. I do not like editing json because I am afraid of errors. The generated json looks like:

{
  "hostname": "client1",
  "hw-address": "81:01:01:01:01:01",
  "ip-address": "192.168.1.21"
},
{
  "hostname": "client2",
  "hw-address": "81:01:01:01:01:02",
  "ip-address": "192.168.1.22"
},
...

If you are interested I can send you the script. It is not perfect, but it does its job.

Marek



Sent with Proton Mail secure email.

On Wednesday, January 10th, 2024 at 9:13, Albert Shih <Albert.Shih at obspm.fr> wrote:


> Hi,
> 
> We using isc for long time. 99% of the address give by isc-dhcp are «host
> reservation by mac address».
> 
> So we manage a
> 
> root at dhcp:/etc/dhcp# egrep "^\s+host" dhcpd.conf|wc
> 5821 17463 194735
> root at dhcp:/etc/dhcp#
> 
> Currently we are working to migrate to Kea. But after reading lot of
> documentation I didn't find if I can use files to store the data. Or it's
> mandatory to use database to store those data.
> 
> I find
> 
> https://kea.readthedocs.io/en/kea-2.4.1/arm/admin.html#supported-backends
> 
> where they say it's not supported for host reservation to use memfile and
> as I understand the doc the data should be in the database
> 
> But in
> 
> https://kb.isc.org/docs/what-are-host-reservations-how-to-use-them
> 
> they seem to have json format file for host reservation.
> 
> I understand it's not very efficient to use file, much better to use
> database but currently we have lot of script to generate those file, it
> would be easier for us to adapt them to generated json.
> 
> So my question are : Can I put host reservation in file on the filesystem
> of the server ?
> 
> Regards
> --
> Albert SHIH 🦫 🐸
> France
> Heure locale/Local time:
> mer. 10 janv. 2024 09:02:07 CET
> --
> ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.
> 
> To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.
> 
> Kea-users mailing list
> Kea-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/kea-users


More information about the Kea-users mailing list