< 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, and the device uses the IP addresses of the interface address pool.

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

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. In addition, in the scenario where the DHCP server and clients are on different network segments and a DHCP relay agent exists, you can run the dhcp server ip-range start-ip-address end-ip-address command to change the range of IP addresses in the address pool to be different from the IP address range on the interface.

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.

Precautions

When DHCP clients are directly connected to the DHCP server, the DHCP clients can only be allocated IP addresses on the same network segment as the DCHP server's interface IP address, but not IP addresses out of the network segment (changed using the dhcp server ip-range start-ip-address end-ip-address command or expanded using the dhcp server mask{ mask | mask-length } 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.

<sysname> system-view
[sysname] dhcp enable
[sysname] interface vlanif 100
[sysname-Vlanif100] ip address 192.168.1.1 24
[sysname-Vlanif100] 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 >