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 6, which specifies the IPv4 addresses of the DNS servers that the client uses for name resolution. DHCPv6, for example, provides option 23 which specifies the IPv6 addresses of the DNS servers that the client uses for name resolution.
DHCPv4 and DHCPv6 custom options are defined by specifying the name, key, code, option space, and schema.
Note
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.
For DHCPv4, the vendor-encapsulated-options-space is “empty” by default, but any options defined in it are carried in the vendor-encapsulated-specific option, code 43. For DHCPv6, the vendor-opts-space is also “empty” by default, but any options defined in it are carried in the vendor-encapsulated-specific option, code 17.
New custom option spaces can be created to convey sub-options. For example, when an administrator creates a new option in the standard option space (e.g. DHCPv4) and they want this option to convey sub-options, the custom option space is where the sub-options are defined and their codes can overlap with the standard option codes.
Follow the instructions below to create and apply the custom DHCP option. 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.
-
In the NS1 Connect portal, click DHCP in the main navigation and select the Options sub-menu. This is where you will define the custom DHCP option.
Note
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 + to create a new custom DHCP option.
-
In the Custom DHCP Option modal, enter the Option Name. This is the nominal label that you will 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.
-
Under Select Option Space, select one of the following:
Custom to create a new option space
DHCPv4 standard option spaces
DHCPv6 standard option spaces
Vendor-encapsulated-options-space standard space for DHCPv4 vendor options
Vendor-opts-space standard space for DHCPv6 vendor options
-
Select the checkbox next to Encapsulate when defining sub-options for a custom option in the DHCPv4 or DHCPv6 space. This is not required when using vendor-encapsulation (i.e. code 43 for DHCPv4 or code 17 for DHCPv6).
Note
If you do not see the Encapsulate checkbox in the modal, first create an option in a custom option space then try to create another custom option and the checkbox should display.
Enter a description (internal only) for the DHCP custom option type.
-
Select the custom schema (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)
Note
When configuring a custom DHCP option with “array” schema selected, You cannot create an array of "string", "binary", or "empty" field types.
-
Complex: a mix of primitive types (multiple instances/fields of varying types)
Note
When configuring a custom DHCP option with “complex” schema selected, the record must consist of at least two fields. “String” and “binary” fields must be last in the order of primitive types. “Empty” type is not permitted for complex records. You cannot create an array of “string” or “binary” field types. If a string contains commas, they must be escaped with a double-backslash (\\). If you select Simple or Array, then select a data type from the drop-down menu. The available options in the drop-down will vary based on which schema you select. If you select Complex, enter a name and data type for each field.
-
Click Save. The new custom option appears in the list.
Click DHCP in the main navigation and select the Management sub-menu to view a list of all scope groups associated with your account.
-
To apply the option to a scope group, click the menu (three-dots) icon to the right of your desired scope group and select Edit Scope Group from the list.
-
In the Edit Scope Group dialog, select the DHCPv4 Settings (alternatively, DHCPv6 Settings) tab, then scroll to the Filter by option space section.
-
To apply the option to a scope, click the name of a scope group from the list to drill down to select a specific scope. In the list of scopes within the scope group, click the menu (three-dots) icon to the right of your desired scope and select Edit from the list.
-
This brings you to the Edit Scope dialog.
-
In the Filter by option space section, begin typing the name of the custom option you just created, and then select it from the list. Optionally, select/deselect the checkboxes to filter by the option space type, including:
dhcpv4 to display standard DHCPv4 options
dhcpv6 to display standard DHCPv6 options
vendor-encapsulated-options-space (DHCPv4 only) to display vendor-specific options
vendor-opts-space (DHCPv6 only) to display vendor-specific options
Custom to display user-created options in custom option spaces
-
In the field under the name of the custom option you just applied, enter the associated data (string or array of strings).
Click Submit. DHCP servers are now configured to provide the custom option to clients upon request.