[Kea-users] kea configuration file limitations

Uwe Toenjes toenjes at rz.uni-leipzig.de
Tue Jan 30 13:07:22 UTC 2024


Hello everyone,

We are currently migrating our isc dhcp server to the isc kea server.

In our environment, a new configuration file is regularly created and
reloaded. Unfortunately, the kea server has limitations in the json syntax
of the configuration file. This makes it impossible to generate the
configuration automatically.

Here's an example. The configuration file is created using php and the
function „json_encode($kea_Dhcp4, JSON_PRETTY_PRINT)“ generated. I just copy
a section of the generated configuration. But the problem can be seen. PHP
generates a correct json configuration. However, Kea rejects the
configuration because it expects a list as syntax. In json, however, no list
is required at this point. Therefore it is not possible to create a kea
configuration automatically.

Is there a reason for the limitation? Can this limitation be resolved by kea
in a future version? Or is there another solution to the problem that I
missed?


=> The "high-availability" section expects a list with one element. In this
case, the json functions do not create a list.

..
        "hooks-libraries": [
            {
                "library": "\/usr\/lib64\/kea\/hooks\/libdhcp_lease_cmds.so"
            },
            {
                "library": "\/usr\/lib64\/kea\/hooks\/libdhcp_ha.so",
                "parameters": {
                    "high-availability": {
                        "this-server-name": "dhcpdup",
                        "mode": "hot-standby",
                        "heartbeat-delay": 5000,
                        "max-response-delay": 35000,
                        "multi-threading": {
                            "enable-multi-threading": true
                        },
                        "peers": [
                            {
                                "name": "dhcpdup",
                                "url": "http:\/\/172.26.20.2:8001\/",
                                "role": "primary"
                            },
                            {
                                "name": "dhcpdup2",
                                "url": "http:\/\/172.26.20.3:8001\/",
                                "role": "standby"
                            }
                        ]
                    }
                }
            }
        ],

..
2024-01-30 13:55:46.111 INFO  [kea-dhcp4.hooks/31597.140578571736960]
HOOKS_LIBRARY_LOADED hooks library
/usr/lib64/kea/hooks/libdhcp_lease_cmds.so successfully loaded
2024-01-30 13:55:46.111 ERROR [kea-dhcp4.ha-hooks/31597.140578571736960]
HA_CONFIGURATION_FAILED failed to configure High Availability hooks library:
HA configuration must be a list
2024-01-30 13:55:46.111 ERROR [kea-dhcp4.hooks/31597.140578571736960]
HOOKS_LOAD_ERROR 'load' function in hook library
/usr/lib64/kea/hooks/libdhcp_ha.so returned error 1


Thank you for your efforts

Regards
Uwe



More information about the Kea-users mailing list