< Home

dhcp server mask

Function

The dhcp server mask command sets the subnet mask of IP addresses that a DHCP server pre-allocates to DHCP clients.

The undo dhcp server mask command deletes the configured subnet mask.

By default, the subnet mask of IP addresses that a DHCP server pre-allocates to DHCP clients is not configured.

Format

dhcp server mask { mask | mask-length }

undo dhcp server mask

Parameters

Parameter Description Value

mask

Specifies a subnet mask.

The value is in decimal dotted notation.

mask-length

Specifies the length of the subnet.

The value is an integer ranging from 0 to 32.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

After enabling the DHCP server function on an interface, you can configure the range and subnet mask of IP addresses that a DHCP server pre-allocates to DHCP clients. Run the dhcp server ip-range command to configure the IP address range and run the dhcp server mask command to configure the subnet mask of the 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

# Set the subnet mask of IP addresses that a DHCP server on a VLANIF100 pre-allocates to DHCP clients to 255.255.255.0.

<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ip address 10.1.1.1 24 
[HUAWEI-Vlanif100] dhcp select interface
[HUAWEI-Vlanif100] dhcp server mask 255.255.255.0
# Set the subnet mask of IP addresses that a DHCP server on GE0/0/1 pre-allocates to DHCP clients to 255.255.255.0.
<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.1 24 
[HUAWEI-GigabitEthernet0/0/1] dhcp select interface
[HUAWEI-GigabitEthernet0/0/1] dhcp server mask 255.255.255.0
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >