[Kea-users] Converting an ISC IPv6 class definition to Kea syntax
Marek Hajduczenia
mxhajduczenia at gmail.com
Fri Apr 19 20:27:07 UTC 2024
Dear colleagues,
I ran into a bit of a challenge with the conversion of the config from ISC
to Kea, namely this little class definition gem:
class "rpd-1" { match if v6relay( 1, option dhcp6.interface-id ) ~=
"Md1:0/0.0$"; }
What it does, as you can tell, it matches on the inner relay interface-id
field in the DHCPv6 messages. Nothing fancy, it does work as tested.
I have been looking at the available options and nothing comes to mind so I
used keama for automatic conversion and it generated something pretty
complex, as follows. Additionally, it is commented out, so I assume this is
a non-working configuration element (?)
"client-classes": [
{
"name": "rpd-1"
// /// match if (v6relay(1, option dhcp6.interface-id)) ~= 'Md1:0/0.0$'
// "match-if": {
// "regex-match": {
// "left": {
// "v6relay": {
// "relay": 1,
// "relay-option": {
// "option": {
// "universe": "dhcp6",
// "name": "interface-id",
// "code": 18
// }
// }
// }
// },
// "right": "Md1:0/0.0$"
// }
// }
}]
If I try to remove the comment markup and apply it with Kea 2.4.1, the
parser does not like the "match-if" statement for some reason. I cannot
locate it in the list of Kea statements, so not sure why it would be
generated by keama. However, the bigger question is on how to build a
Kea-compatible match on such embedded message. Any help here would be really
appreciated.
Apr 19 18:54:20 server-kea-node1 systemd[1]: Started Kea DHCPv6 Service.
Apr 19 18:54:20 server-kea-node1 kea-dhcp6[2099]: 2024-04-19 18:54:20.202
ERROR [kea-dhcp6.dhcp6/2099.841038976] DHCP6_INIT_FAIL failed to initialize
Kea server: configuration error using file '/etc/kea/kea-dhcp6.conf':
/etc/kea/kea-dhcp6.conf:118.9-18: syntax error, unexpected constant string,
expecting }
Apr 19 18:54:20 server-kea-node1 systemd[1]: isc-kea-dhcp6-server.service:
Main process exited, code=exited, status=1/FAILURE
Apr 19 18:54:20 server-kea-node1 systemd[1]: isc-kea-dhcp6-server.service:
Failed with result 'exit-code'.
Regards
Marek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20240419/938ae860/attachment.htm>
More information about the Kea-users
mailing list