The dhcp server option121 command configures a classless static route allocated by a DHCP server to a client.
The undo dhcp server option121 command deletes a classless static route allocated by a DHCP server to a client.
By default, the classless static route allocated to a client is not configured.
dhcp server option121 ip-address { ip-address mask-length gateway-address } &<1-8>
undo dhcp server option121 [ ip-address ip-address mask-length gateway-address ]
Parameter |
Description |
Value |
---|---|---|
ip-address |
Specifies the destination IP address. |
The value is in dotted decimal notation. |
mask-length |
Specifies the mask length. |
The value is an integer that ranges from 0 to 32. |
gateway-address |
Specifies the gateway address of a route. |
The value is in dotted decimal notation. |
Usage Scenario
The dhcp server option121 ip-address command applies to only the DHCP server. The dhcp server option121 ip-address command configures Option 121 that defines a classless static route allocated to a client from an interface address pool.
mask-length and gateway-address specify a classless static route. The dhcp server option121 ip-address command configures a maximum of eight classless static routes.
Prerequisites
IP addresses in the interface address pool have been configured using the ip address command.
The DHCP server function has been enabled on the interface using the dhcp select interface command.
<HUAWEI> system-view [HUAWEI] dhcp enable [HUAWEI] interface vlanif 100 [HUAWEI-Vlanif100] ip address 10.1.1.2 24 [HUAWEI-Vlanif100] dhcp select interface [HUAWEI-Vlanif100] dhcp server option121 ip-address 10.10.10.10 24 192.168.11.11
<HUAWEI> system-view [HUAWEI] dhcp enable [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] undo portswitch [HUAWEI-GigabitEthernet0/0/1] ip address 10.1.1.2 24 [HUAWEI-GigabitEthernet0/0/1] dhcp select interface [HUAWEI-GigabitEthernet0/0/1] dhcp server option121 ip-address 10.10.10.10 24 192.168.11.11