Customizing DHCP options
DHCP option customization applications
You can customize DHCP 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 servers, you must use the option 6 command to define all DNS servers.
Common DHCP options
Table 2 lists common DHCP options and their parameters.
Table 2: Common DHCP options
Option | Option name | Corresponding command | Recommended parameter in the option command |
---|---|---|---|
3 | Router Option | gateway-list | ip-address |
6 | Domain Name Server Option | dns-list | ip-address |
15 | Domain Name | domain-name | ascii |
44 | NetBIOS over TCP/IP Name Server Option | nbns-list | ip-address |
46 | NetBIOS over TCP/IP Node Type Option | netbios-type | hex |
66 | TFTP server name | tftp-server | ascii |
67 | Boot file name | bootfile-name | ascii |
43 | Vendor Specific Information | N/A | hex |
Restrictions and guidelines
Use caution when customizing DHCP options because the configuration might affect DHCP operation.
You can customize a DHCP option in a DHCP address pool
You can customize a DHCP option in a DHCP option group, and specify the option group for a user class in an address pool. A DHCP client in the user class will obtain the option configuration.
Customizing a DHCP option in a DHCP address pool
Enter system view.
system-view
Enter DHCP address pool view.
dhcp server ip-pool pool-name
Customize a DHCP option.
option code { ascii ascii-string | hex hex-string | ip-address ip-address&<1-8> }
By default, no DHCP option is customized in a DHCP address pool.
DHCP options specified in DHCP option groups take precedence over those specified in DHCP address pools.
Customizing a DHCP option in a DHCP option group
Enter system view.
system-view
Create a DHCP option group and enter DHCP option group view.
dhcp option-group option-group-number
Customize a DHCP option.
option code { ascii ascii-string | hex hex-string | ip-address ip-address&<1-8> }
By default, no DHCP option is customized in a DHCP option group.
If multiple DHCP option groups have the same option, the server selects the option in the DHCP option group first matching the user class.
Return to system view.
quit
Enter DHCP address pool view.
dhcp server ip-pool pool-name
Specify the DHCP option group for the DHCP user class.
class class-name option-group option-group-number
By default, no DHCP option group is specified for a DHCP user class.