[Kea-users] Kea and on-commit

Rowland Penny rpenny at samba.org
Mon Oct 17 19:04:05 UTC 2022


I have just discovered that the isc-dhcp-server is going EOL at the year 
and is being replaced by Kea. I know that the isc-dhcp-server will still 
be available from distros for sometime, but I need to find out if kea 
can work in the same way as isc-dhcp-server.

You can set at the bottom of dhcp.conf something like this:

on commit {
set noname = concat("dhcp-", binary-to-ascii(10, 8, "-", leased-address));
set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
set ClientDHCID = concat (
suffix (concat ("0", binary-to-ascii (16, 8, "", 
substring(hardware,1,1))),2), ":",
suffix (concat ("0", binary-to-ascii (16, 8, "", 
substring(hardware,2,1))),2), ":",
suffix (concat ("0", binary-to-ascii (16, 8, "", 
substring(hardware,3,1))),2), ":",
suffix (concat ("0", binary-to-ascii (16, 8, "", 
substring(hardware,4,1))),2), ":",
suffix (concat ("0", binary-to-ascii (16, 8, "", 
substring(hardware,5,1))),2), ":",
suffix (concat ("0", binary-to-ascii (16, 8, "", 
substring(hardware,6,1))),2)
);
set ClientName = pick-first-value(option host-name, config-option 
host-name, client-name, noname);
log(concat("Commit: IP: ", ClientIP, " DHCID: ", ClientDHCID, " Name: ", 
ClientName));
execute("/usr/local/bin/dhcp-dyndns.sh", "add", ClientIP, ClientDHCID, 
ClientName);
}

This will run a script that will update dns records in Samba AD.

Can anyone point me at the Kea documentation that will show me how to do 
the above. I have done the usual Google searches and had a look at the 
Kea documentation, but couldn't readily see anything.

Thanks in advance.

Rowland Penny
Samba team member



More information about the Kea-users mailing list