How to access iPXE option-space sub-options ?
Hello! I've recently discovered ISC Kea and I am LOVING it, really <3
In ISC DHCPd, I would declare the option space like this:
# Declare the iPXE option space
option space ipxe;
option ipxe-encap-opts code 175 = encapsulate ipxe;
# iPXE options, can be set in DHCP response packet
option ipxe.priority code 1 = signed integer 8;
# iPXE feature flags, set in DHCP request packet
option ipxe.nfs code 41 = unsigned integer 8;
I tried declaring it in ISC Kea like that, from what I could find in the docs that resembled it a bit:
{
"Dhcp4": {
"option-def": [
{
"name": "nfs",
"code": 41,
"space": "ipxe",
"type": "uint8"
},
{
"name": "container",
"code": 175,
"space": "dhcp4",
"type": "empty",
"array": false,
"encapsulate": "ipxe"
}
]
}
}
In reality, I only want to check if ipxe.nfs
is equal to 1
to see if my client has NFS-boot possibilities.
In ISC DHCPd, I would check like that:
if exists user-class and option user-class = "iPXE" and exists ipxe.nfs {
# do stuff
}
I tried the following in ISC Kea (client-class) but I have to admit that I am kind of lost:
{
"name": "iPXE",
"test": "(substring(option[77].hex,0,4) == 'iPXE') and (option[41].exists)",
"boot-file-name": "http://192.168.136.112/boot.ipxe"
},
I tried a bunch of stuff, but no success..
Note that (substring(option[77].hex,0,4) == 'iPXE')
on it's own functions properly.
PS: Can we have multiple test
fields instead of chaining and
s?
Edited by Phorcys