option
Use option to customize a DHCP option.
Use undo option to remove a customized DHCP option.
Syntax
option code { ascii ascii-string | hex hex-string | ip-address ip-address&<1-8> }
undo option code
Default
No DHCP option is customized.
Views
DHCP address pool view
DHCP option group view
Predefined user roles
network-admin
mdc-admin
Parameters
code: Specifies the number of the customized option, in the range of 2 to 254, excluding 50 through 54, 56, 58, 59, 61, and 82.
ascii ascii-string: Specifies a case-sensitive ASCII string of 1 to 255 characters as the option content.
hex hex-string: Specifies a hexadecimal number as the option content. The length of the hexadecimal number must be an even number in the range of 2 to 256.
ip-address ip-address&<1-8>: Specifies a space-separated list of up to eight IP addresses as the option content.
Usage guidelines
The DHCP server fills the customized option with the specified ASCII string, hexadecimal number, or IP addresses, and sends it in a response to the client.
You can customize options for the following purposes:
Add newly released options.
Add options for which the vendor defines the contents, for example, Option 43.
Add options for which the CLI does not provide a dedicated configuration command. For example, you can use the option 4 ip-address 1.1.1.1 command to define the time server address 1.1.1.1 for DHCP clients.
Add all option values if the actual requirement exceeds the limit for a dedicated option configuration command. For example, the dns-list command can specify up to eight DNS servers. To specify more than eight DNS server, you must use the option 6 command to define all DNS servers.
DHCP options specified by dedicated commands take precedence over those specified by the option commands. For example, if a DNS server address is specified by both the dns-list command and the option 6 command, the server uses the address specified by the dns-list command.
DHCP options specified in DHCP option groups take precedence over those specified in DHCP address pools.
If you execute this command multiple times with the same code specified, the most recent configuration takes effect.
Examples
# Configure Option 7 to specify log server address 2.2.2.2 in DHCP address pool 0.
<Sysname> system-view [Sysname] dhcp server ip-pool 0 [Sysname-dhcp-pool-0] option 7 ip-address 2.2.2.2
Related commands
display dhcp server pool