Adding Custom Configuration in Kea DHCP Server with pfSense+ 25.03
-
@FCS001FCS said in Adding Custom Configuration in Kea DHCP Server with pfSense+ 25.03:
One showed up after some restarts of switches ....
Note: Your mileage may vary :)
That's what I saw a while back when was learning how ti work with Unifi stuff.
New unifi devices - or unifi devices I've reset, can be hooked up to the networks and from then it is adoptable right way (reboot after a device 'button' reset take some time to get awake - or yo have to try again). Or, that's how I understood the procedure.
Didn't understand what was happening as one in a while this just fails ... the reset wasn't done good enough ?
I wanted to know, back then, if it was a hassle every time, or if I rally could add more 'unifi' stuff easily, create a situation where I can unbox the device, hook it, and wait for the "do you want to adopt the new device ?" controller message. I figured out that that would be the way to go : everything is set up in pfSense so I can add physically the new unifi device, set them up from the controller and call it a day. No need to get my phone, approach the device, have it point to a 'controller IP' etc. -
How can we define custom client-classes options? I tried this but seems to have no effect:
{ "client-classes": [ { "name": "UEFI-64-1-1", "test": "((substring(option[vendor-class-identifier].hex,0,20) == 'PXEClient:Arch:00007') and ((option[user-class].exists) and (substring(option[user-class].text,0,7) == 'iVentoy'))", "boot-file-name": "iventoy_loader_16000_uefi", "next-server": "172.26.2.18" }, { "name": "UEFI-64-1-2", "test": "(substring(option[vendor-class-identifier].hex,0,20) == 'PXEClient:Arch:00007')", "boot-file-name": "efi64/syslinux.efi", "next-server": "172.26.2.19" }, { "name": "Legacy", "test": "(substring(option[vendor-class-identifier].hex,0,20) == 'PXEClient:Arch:00000')", "boot-file-name": "pxelinux.0", "next-server": "172.26.2.19" } ] }
-
@pescew The structure is correct. A quick test here shows there's an issue with the first item (seen in the DHCP logs). Removing it and keeping only "UEFI-64-1-2" and "Legacy" let's Kea start.
-
@marcosm Thanks for the quick reply, I didn't realize that info was in the log. After cleaning up the parenthesis on that line it's working perfectly and PXE booting. I still need to troubleshoot the user-class rule to get the chain-loading working but that should be easy from here.
-
@pescew said in Adding Custom Configuration in Kea DHCP Server with pfSense+ 25.03:
After cleaning up the parenthesis
Yeah, more '(' then ')', that's normally not a good sign
"((substring(option[vendor-class-identifier].hex,0,20) == 'PXEClient:Arch:00007') and ((option[user-class].exists) and (substring(option[user-class].text,0,7) == 'iVentoy'))"
-
@Gertjan Thank you brother. All you suggestions worked great. I joined the forums just to tell you so.