Custom options

The DHCP server supports custom options in addition to the above options. This allows to specify all possible DHCP options in client and general sections. (New in V1.7)

The syntax for custom options is:

[00-01-02-03-04-6A]
OPTION_nn="whatever text"     ; text
OPTION_nn=02:03:04:05         ; hex bytes
OPTION_nn=192.168.2.1         ; IP address
OPTION_nn= 01 "whatever text" ; combination of hex byte and text

nn is the option number (decimal) such as OPTION_66 for TFTP server IP address. Leading zeros, such as OPTION_060, will cause problems in earlier versions. Version 2.7 and newer support leading zeros.
Please note that all the examples above have a trailing comment in each line. This is necessary and is not optional. The comment even if it is only the semi-colon (;) is needed.

OPTION_nn=”whatever text” ;

If there is no comment symbol at the end then the OPTION_nn setting will not be recognized correctly and is treated as malformed and therefore ignored.

The custom option syntax understands hex bytes as two digit values, IP addresses as a group of four decimal numbers separated by ‘.’, and “text”. As separators are allowed: blanks and colons (:). Two special syntax features make it easier to deal with custom options (available since V2.4). The first is the auto-len prefix for everything inside of parentheses (). You can group all data (hex bytes, IP addresses and text) as you whish and put parentheses around them. The resulting encoding will automatically prefix the data with a length field. An example can be seen in the FAQ.
The second new feature in V2.4 is related to IP address encodings. Sometimes it is necessary to encode, e.g. in OPTION_121, a network ID in a compact form. Example:

OPTION_121= 10.10.30.0/24 10.10.20.254 ; encodes to 18 0A 0A 1E 0A 0A 14 FE

This defines a classless static route for all addresses in the 10.10.30.0/24 network to be routed via 10.10.20.254. The encoding for this is an 8 byte octect sequence as shown above, where the first 4 octects are a compact CIDR syntax. Compact CIDR syntax means, that 10.10.30.0/24 only consists of the relevant octets for the network id. The relevant octets in this case are 3, because /24 makes the 4th octet of 10.10.30.0 irrelevant.