kea is not accepting custom spaces in option definitions in class
options in kea can be defined in kea standard space dhcp4
and dhcp6
or custom spaces e.g.:
"option-def": [
{
"array": false,
"code": 242,
"encapsulate": "",
"name": "dls",
"record-types": "",
"space": "XYZ",
"type": "string"
}
],
But Kea accept custom spaces only on global level, returns error with this configuration:
client-classes": [
{
"option-def": [
{
"encapsulate": "339",
"code": 43,
"type": "empty",
"name": "vendor-encapsulated-options"
},
{
"code": 2,
"name": "vlanid",
"space": "339",
"type": "uint32",
"record-types": "",
"array": false,
"encapsulate": ""
},
{
"code": 3,
"name": "dls",
"space": "339",
"type": "string",
"record-types": "",
"array": false,
"encapsulate": ""
}
],
"name": "VENDOR_CLASS_339",
"option-data": [
{
"name": "vendor-encapsulated-options"
},
{
"always-send": true,
"data": "123",
"name": "vlanid",
"space": "339"
},
{
"always-send": true,
"data": "sdlp://192.0.2.11:18443",
"name": "dls",
"space": "339"
}
]
}
],
Error:
2021-01-28 07:16:28.281 INFO [kea-dhcp4.dhcp4/27394.140192072867456] DHCP4_STARTING Kea DHCPv4 server version 1.9.4-git (development) starting
2021-01-28 07:16:28.282 WARN [kea-dhcp4.dhcp4/27394.140192072867456] DHCP4_DEVELOPMENT_VERSION This software is a development branch of Kea. It is not recommended for production use.
2021-01-28 07:16:28.283 ERROR [kea-dhcp4.dhcp4/27394.140192072867456] DHCP4_CONFIG_LOAD_FAIL configuration error using file: /home/wlodek/installed/git/etc/kea/kea-dhcp4.conf, reason: Not allowed option definition for code '2' in space '339' at (/home/wlodek/installed/git/etc/kea/kea-dhcp4.conf:46:21)
2021-01-28 07:16:28.285 ERROR [kea-dhcp4.dhcp4/27394.140192072867456] DHCP4_INIT_FAIL failed to initialize Kea server: configuration error using file '/home/wlodek/installed/git/etc/kea/kea-dhcp4.conf': Not allowed option definition for code '2' in space '339' at (/home/wlodek/installed/git/etc/kea/kea-dhcp4.conf:46:21)
Making impossible to have multiple suboptions code 2
for different classes.
full config attached kea-dhcp4.conf