The latest version (2.2) of NS1’s Enterprise DDI software includes support for creating custom DHCP options via the portal or API.
DHCP options provide service and configuration information to DHCP clients. Standard options and custom options are available for both DHCPv4 (RFC 2132) and DHCPv6 (RFC 8415). Standard options include, for example, option 12, which specifies the hostname of the DHCP client. DHCPv6, for example, provides option 39 which specifies the FQDN of the DHCP client.
DHCP and DHCPv6 custom options are defined by, at a minimum, specifying the key, name, code, and schema. In the default DHCPv4 space, code options 128-254 are reserved for site-specific use. In the DHCPv6 space, no code used for a custom option should overwrite an existing DHCPv6 option.
Currently, user-created option spaces are not supported. Custom options can only be added to the DHCPv4 and DHCPv6 option spaces.
Creating & applying custom DHCP options
To use a custom DHCP option, you must first specify the new option, and then apply it to an existing DHCP scope or scope group.
Step 1: Create and specify the option.
Log into the NS1 portal, and click DHCP from the main navigation bar.
Click Options in the secondary navigation. This is where you will define the custom DHCP option.
To view all DHCP standard options, click the checkbox next to Show Standard Options. If the checkbox is disabled, only custom DHCP options will appear in the list.
Click the plus sign (+) button to create a new custom DHCP option.
In the Edit Custom DHCP Options window, enter the Option Name. This is the nominal label that you’ll need to reference later when applying the option to a DHCP scope or scope group.
Enter the Key. This is the unique string used in the request URL corresponding to the Kea configuration.
Enter a Code. This is the custom option code (a value between 128 and 254) with which to associate this specific option.
Indicate whether this is a DHCPv4 or DHCPv6 option space.
Enter a description (internal only) for the DHCP custom option type.
Select the custom schema the option (simple, array, or complex).
Simple: a single primitive (one instance/field of one type)
Array: an array of a single primitive type (multiple instances/fields of the same type)
Complex: a mix of primitive types (multiple instances/fields of varying types
Select the data type from the drop-down menu, and enter the string data for each field.IMPORTANT NOTE
The following are important guidelines to follow when configuring a custom DHCP option with “complex” schema selected:
- The record must consist of at least two fields.
- "String" or "binary" fields must be last in the order of primitive types.
- You can only enter one "string" field or one "binary" field per record.
- "Empty" type is not allowed in a complex record.
- You cannot create an array of “string” or “binary” field types.
- If a string contains commas, they must be escaped with double-backslash (\\).
- You cannot create an array of "string", "binary", or "empty" field types.
Step 2: Apply the option to a DHCP scope or scope group.
In the NS1 portal, click DHCP from the main navigation.
Click Management in the secondary navigation.
Select a scope group from the list or drill-down into the list to select a specific scope, and then click the icon to the right, and select Edit.
Under DHCPv4 options or DHCPv6 options, begin typing the name of the custom option (or click into the field), and then select the custom option from the list.
Under the name of the custom option you just applied, enter the associated data (string or array of strings).
Click Save (or Submit).