The dhcp server ip-range command sets the range of IP addresses that a DHCP server pre-allocates to DHCP clients.
The undo dhcp server ip-range command deletes the configured IP address range.
By default, the range of IP addresses that a DHCP server pre-allocates to DHCP clients is not configured.
Parameter | Description | Value |
---|---|---|
start-ip-address |
Specifies the start IP address. |
The value is in decimal dotted notation. |
end-ip-address |
Specifies the end IP address. |
The value is in decimal dotted notation. |
Prerequisites
Usage Scenario
You can run the dhcp server ip-range start-ip-address end-ip-address command to change the range of IP addresses in an address pool based on actual usage of IP addresses.
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.
# Enable a DHCP server on a VLANIF100 to pre-allocate IP addresses 192.168.1.2 to 192.168.1.100 to DHCP clients.
<HUAWEI> system-view [HUAWEI] dhcp enable [HUAWEI] interface vlanif 100 [HUAWEI-Vlanif100] ip address 192.168.1.1 24 [HUAWEI-Vlanif100] dhcp select interface [HUAWEI-Vlanif100] dhcp server ip-range 192.168.1.2 192.168.1.100
<HUAWEI> system-view [HUAWEI] dhcp enable [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] undo portswitch [HUAWEI-GigabitEthernet0/0/1] ip address 192.168.1.1 24 [HUAWEI-GigabitEthernet0/0/1] dhcp select interface [HUAWEI-GigabitEthernet0/0/1] dhcp server ip-range 192.168.1.2 192.168.1.100