[Kea-users] Host reservation via Kea control agent API

Peter Davies peter.watson.davies at outlook.com
Tue Oct 5 19:48:59 UTC 2021


Hi Allan,
According the Kea Arm : https://kea.readthedocs.io/en/kea-2.0.0/arm/hooks.html#host-cmds-host-commands

"Currently this library is only available to ISC customers with a paid support contract"

For more details see: https://www.isc.org/contact/

Kind Regards Peter

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows

From: Allan Tinker<mailto:allan at m33access.com>
Sent: Tuesday, 5 October 2021 20.16
To: kea-users at lists.isc.org<mailto:kea-users at lists.isc.org>
Subject: [Kea-users] Host reservation via Kea control agent API

Im trying to add a host reservation via the kea-ctrl-agent API.

This is the data Im sending to the API as a POST:

{
"command": "reservation-add",
"arguments": {
"reservation": {
"subnet-id": 2,
"hw-address": "4c:e1:73:43:78:3e",
"ip-address": "172.16.132.16"
}
}
}

And the response Im getting is:

[
{
"result": 1,
"text": "Host database not available, cannot add host."
}
]

Using MySQL, built database via kea-admin
The database is working for lease information and logs.

In kea-dhcp4.conf I have the hosts hooks loaded,
In kea-ctrl-agent.conf I have the hosts hooks loaded.

Here is what my configs look like:

Kea-dhcp4.conf:

"Dhcp4": {
    "interfaces-config": {
        "interfaces": ["ens224"]
    },

    "control-socket": {
        "socket-type": "unix",
        "socket-name": "/tmp/kea4-ctrl.sock"
    },

    "lease-database": {
         "type": "mysql",
         "name": "DHCP",
         "user": “dummyuser",
         "password": “dummypass",
         "host": "localhost",
         "port": 3306
    },

    "hosts-database": {
         "type": "mysql",
         "name": "DHCP",
         "user": "root",
         "password": “dummyuser",
         "host": “dummypass",
         "port": 3306,
         "readonly": false
     },
…


"hooks-libraries": [
        {
"library": "/usr/local/lib/kea/hooks/libdhcp_host_cmds.so"
        },
        {
"library": "/usr/local/lib/kea/hooks/libdhcp_lease_cmds.so"
        },
{
"library": "/usr/local/lib/kea/hooks/libdhcp_flex_id.so",
                "parameters": {
                "identifier-expression": "relay4[1].hex",
                "replace-client-id": true
                }
        },
…




Kea-ctrl-agent.conf:

"Control-agent": {
    "http-host": "172.16.132.2",
    "http-port": 8033,
    "cert-required": false,
    "authentication": {
        "type": "basic",
        "realm": "kea-control-agent",
        "clients": [
        {
            "user": “dummyuser",
            "password": “dummypass"
        }]
},


        "dhcp4": {
            "socket-type": "unix",
            "socket-name": "/tmp/kea4-ctrl.sock"
        },
"dhcp6": {
            "socket-type": "unix",
            "socket-name": "/tmp/kea6-ctrl-socket"
        },
"d2": {
            "socket-type": "unix",
            "socket-name": "/tmp/kea-ddns-ctrl-socket"
        }
    },

    "hooks-libraries": [
      {
        "library": "/usr/local/lib/kea/hooks/libdhcp_host_cmds.so"
      },
    ],
…




This ones got me confused for sure..

- Allan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20211005/0d7d3f35/attachment-0001.htm>


More information about the Kea-users mailing list