< Home

dhcp server ip-range

Function

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.

Format

dhcp server ip-range start-ip-address end-ip-address

undo dhcp server ip-range

Parameters

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.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

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

  1. The DHCP function has been enabled using the dhcp enable command in the system view.
  2. IP addresses in the interface address pool have been configured using the ip address command.

  3. The DHCP server function has been enabled on the interface using the dhcp select interface command.

Example

# 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
# Enable a DHCP server on GE0/0/1 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 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
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >