isc-dhcp-server w/Onie for Cumulus ZTP vendor-class-identifier

The below doesn't relate to CumulusOS in any way, however I am implementing CumulusOS, and was having issues with ZTP, specifically matching the vendor-class-identifier to download a specific version of CumulusOS. I hope that this post saves someone like me, a CLI-jockey convert to Linux, some time. This is for those people that are looking to implement ZTP with an isc-dhcp-server. The Onie documentation has you insert the following snippet into your DHCP server to match on the vendor-class-identifier: class "onie-vendor-X-class" { match if substring(option vendor-class-identifier, 0, 27) = "onie_vendor:powerpc-VendorX"; option default-url = "http://image-server/VendorX-onie-installer"; } This class statement will most likely not work, and for those of us without a programming or linux background, the issue may not be readily apparent, possibly leading to unnecessary and fruitless troubleshooting. The issue lies in the "match if" statement of the example. Pay attention to the digits beside the vendor-class-identifier in the "match if" statement. substring is an operator that excepts DHCP option 60 from Onie and matches on the 0 to nth character, in the example '27'. If your vendor-class-id is longer than 26 characters, the match will fail, and Onie will not return DHCP Option 114 to the client. For example, I'm running an Edgecore AS4610. The vendor-id is: "onie_vendor:arm-accton_as4610_54-r0". This is 34 characters. My "match if" statement looks like this, taking into account that the vendor-id is 34 characters: match if substring(option vendor-class-identifier, 0, 35) = "onie_vendor:arm-accton_as4610_54-r0"

1 reply

Userlevel 5
Thanks for sharing this with us.This is great stuff!