[Kea-users] Converting an ISC IPv6 class definition to Kea syntax

Darren Ankney darren.ankney at gmail.com
Fri Apr 19 21:08:06 UTC 2024


Hi Marek,

That is pseudo code generated by KeaMA as Kea doesn't support regex
statements like ISC DHCP did.  There was probably an additional line
output that linked to some GL issue explaining.  Something like this
might work (I've not tested it):

"client-classes": [
  {
    "name": "rpd-1",
    "test": "substring(relay6[1].option[18].hex,-1,9) == 'Md1:0/0.0'"
  }
]

Thank you,
Darren Ankney

On Fri, Apr 19, 2024 at 4:27 PM Marek Hajduczenia
<mxhajduczenia at gmail.com> wrote:
>
> 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
>
> --
> 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