Accessing DHCP Client’s vendor-encapsulated-options

dhcpisc-dhcp

In the dhcpd.conf file for isc-dhcpd-V3.1.1, I have set up a vendor options space and defined several different options. I am able to use those definitions to send options from the server to the client in the vendor-encapsulated-options option (code 43).

However, the client is also sending vendor options back to the server, in the same way, and I'd like to respond differently depending on the type and contents of the options. As far as I can tell, the the server isn't parsing the client's vendor-encapsulated-options at all – the option operator is just returning null.

Is there a way to get the server to populate the options in the vendor space I've defined?

Best Answer

If you can guarantee that the client sends the same options in the same order every time, you can use substring and option vendor-encapsulated-options to parse the options manually:

if 01:01:01 = substring( option vendor-encapsulated-options, 0, 3 ) { ... }
if 02:02:ab:cd = substring( option vendor-encapsulated-options, 3, 4 ) { ... }

If those two guarantees don't hold true, however, the only remaining option is regex-based matching, but beware the possibility of an option (code-length-contents) being full contained in the contents of another option.

Related Topic