No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

Command Reference

S1720, S2700, S5700, and S6720 V200R011C10

This document describes all the configuration commands of the device, including the command function, syntax, parameters, views, default level, usage guidelines, examples, and related commands.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
DHCP Configuration Commands

DHCP Configuration Commands

Command Support

Layer 3 ethernet interface, VLANIF interface, and sub-interface all support the DHCP function.

Only the S5720EI, S5720HI, S6720EI, and S6720S-EI support the Layer 3 ethernet interface and sub-interface.

More details about sub-interface, see Configuring an Ethernet Sub-interface.

alarm ip-used percentage

Function

The alarm ip-used percentage command configures the percentage of the alarms indicating that the addresses in an address pool are used up, and the percentage of the clear alarms.

The undo alarm ip-used percentage command restores the default percentages of the alarms and clear alarms.

By default, the percentage of the alarms indicating that the addresses in an IP address pool are used up is 100%, and the percentage of the clear alarms is 50%.

Format

alarm ip-used percentage alarm-resume-percentage alarm-percentage

undo alarm ip-used percentage

Parameters

Parameter

Description

Value

alarm-resume-percentage Specifies the percentage of the clear alarms. The value is an integer that ranges from 1 to 100. The default value is 50.
NOTE:
The percentage of the clear alarms cannot exceed that of the alarms.
alarm-percentage Specifies the percentage of the alarms indicating that the addresses in an address pool are used up. The value is an integer that ranges from 1 to 100. The default value is 100.

Views

IP address pool view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

When the addresses in an IP address pool are used up, alarms are sent to notify the administrator.

Precautions

The percentage of the clear alarms cannot exceed that of the alarms.

Example

# Configure the percentage of the alarms indicating that the addresses in an address pool are used up, and the percentage of the clear alarms in the IP address pool view.

<HUAWEI> system-view
[HUAWEI] ip pool p1
[HUAWEI-ip-pool-p1] alarm ip-used percentage 80 90

bootfile

Function

The bootfile command configures the name of the startup configuration file for a DHCP client.

The undo bootfile command deletes the configured name of the startup configuration file for a DHCP client.

By default, the startup configuration file name is not configured for a DHCP client.

Format

bootfile bootfile

undo bootfile

Parameters

Parameter

Description

Value

bootfile

Specifies the name of the startup configuration file for a DHCP client.

The value is a string of 1 to 127 case-sensitive characters without spaces.

Views

IP address pool view, DHCP Option template view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command is used on a DHCP server. Besides assigning IP addresses, a DHCP server can also provide the required network configuration parameters, such as the startup configuration file name for the DHCP clients. After the startup configuration file name is configured using the bootfile command, the Offer and ACK packets sent from the DHCP server carry this file name. The DHCP client can acquire the startup configuration file from the specified server based on the file name.

Precautions

Usually, the startup configuration file is saved on a specified file server. Therefore, the route between the DHCP client and the file server must be reachable and the ip address or name of the file server must be specified.

Example

# In the IP address pool view, configure the name of the startup configuration file as start.ini for the DHCP client.
<HUAWEI> system-view
[HUAWEI] ip pool p1
[HUAWEI-ip-pool-p1] bootfile start.ini
# In the DHCP Option template view, configure the name of the startup configuration file as start.ini for the DHCP client.
<HUAWEI> system-view
[HUAWEI] dhcp option template template1
[HUAWEI-dhcp-option-template-template1] bootfile start.ini

conflict auto-recycle interval

Function

The conflict auto-recycle interval command enables automatic reclaim of conflicting IP addresses in the global address pool and configures the interval for the automatic reclaim.

The undo conflict auto-recycle interval command disables automatic reclaim of conflicting IP addresses in the global address pool and deletes the configured interval for the automatic reclaim.

By default, automatic reclaim of conflicting IP addresses in the global address pool is disabled.

Format

conflict auto-recycle interval day day [ hour hour [ minute minute ] ]

undo conflict auto-recycle interval

Parameters

Parameter

Description

Value

day day

Specifies the interval for the automatic reclaim, in days.

The value is an integer that ranges from 0 to 999, in days. The default value is 0.

hour hour

Specifies the interval for the automatic reclaim, in hours.

The value is an integer that ranges from 0 to 23, in hours. The default value is 0.

minute minute

Specifies the interval for the automatic reclaim, in minutes.

The value is an integer that ranges from 0 to 59, in minutes. The default value is 0.

Views

IP address pool view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command is used on a DHCP server. When a DHCP server allocates IP addresses to clients, IP address conflict may occur because IP addresses of some hosts have been manually configured. In this case, the DHCP server considers these IP addresses as conflicting IP addresses, and allocates available IP addresses from the conflicting IP addresses to clients only after available IP addresses in the address pool are used up. To reclaim conflicting IP addresses promptly, the administrator can run the conflict auto-recycle interval command to enable automatic reclaim and specify the reclaim interval.

Prerequisites

The global address pool has been created using the ip pool (system view) command.

Example

# Enable automatic reclaim for conflicting IP addresses in the global address pool global1, and set the interval for automatic reclaim to one day.

<HUAWEI> system-view 
[HUAWEI] ip pool global1 
[HUAWEI-ip-pool-global1] conflict auto-recycle interval day 1

dhcp anti-attack check duplicate option

Function

The dhcp anti-attack check duplicate option command enables the device to check and discard DHCP messages with duplicate options.

The undo dhcp anti-attack check duplicate option command disables the device from checking and discarding DHCP messages with duplicate options.

By default, the device is disabled from checking and discarding DHCP messages with duplicate options.

Format

dhcp anti-attack check duplicate option [ option-start [ to option-end ] ] &<1-254>

undo dhcp anti-attack check duplicate option [ option-start [ to option-end ] ] &<1-254>

Parameters

Parameter Description Value
option-start [ to option-end ] Specifies the option value.
  • option-start: Specifies the start value of an option in a DHCP packet.
  • option-end: Specifies the end value of an option in a DHCP packet.
The value is an integer in the range 1 to 254. For an option, the end value must be larger than the start value.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

To discard DHCP messages with duplicate options 1 to 254, run the dhcp anti-attack check duplicate option command.

Prerequisites

DHCP has been enabled using the dhcp enable command.

Example

# Configure the device to discard DHCP messages with duplicate options.

<HUAWEI> system-view
[HUAWEI] dhcp enable 
[HUAWEI] dhcp anti-attack check duplicate option
Related Topics

dhcp anti-attack check udp-checksum

Function

The dhcp anti-attack check udp-checksum command enables the function of checking the UDP header checksum in a DHCP packet and discarding a DHCP packet with an incorrect checksum.

The undo dhcp anti-attack check udp-checksum command disables the function of checking the UDP header checksum in a DHCP packet.

By default, a device checks the UDP header checksum in a DHCP packet and discards a DHCP packet with an incorrect checksum.

Format

dhcp anti-attack check udp-checksum

undo dhcp anti-attack check udp-checksum

Parameters

None

Views

System view, VLAN view, Ethernet interface view, GE interface view, XGE interface view, MultiGE interface view, 40GE interface view, Eth-Trunk interface view, port group view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The dhcp anti-attack check udp-checksum command applies to DHCP servers, DHCP relay agents, DHCP clients, and DHCP snooping-enabled devices. Devices from different vendors may use different DHCP implementation mechanisms. After checking the UDP header checksum in a received DHCP packet, a device may not allow the DHCP packet to pass through and discards the packet. As a result, DHCP becomes unavailable. To solve this problem, you can run the undo dhcp anti-attack check udp-checksum command to disable the function of checking the UDP header checksum in a DHCP packet, so that a DHCP packet with an incorrect UDP header checksum can be properly forwarded.

Prerequisites

DHCP has been enabled on the device using the dhcp enable command.

Example

# Disable the function of checking the UDP header checksum in a DHCP packet.

<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] undo dhcp anti-attack check udp-checksum

dhcp client class-id (interface view)

Function

The dhcp client class-id command sets the Option60 field in the DHCP request packet sent by the DHCP client.

The undo dhcp client class-id command deletes the configured Option60 field in the DHCP request packet sent by the DHCP client.

By default, no Option60 field is configured.

Format

dhcp client class-id class-id

undo dhcp client class-id

Parameters

Parameter Description Value
class-id Indicates the value of the Option60 field. The value is a string of 1 to 64 case-sensitive characters.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

The DHCP server identifies the devices according to the Option60 field in the DHCP request packet. you can run the dhcp client class-id class-id command to customize the Option60 field in the DHCP request packet sent from the DHCP client.

After you run the dhcp client class-id class-id command in the VLANIF interface view, the device that functions as the DHCP client fills the set Option60 in the DHCP request packet on the VLANIF interface.

Example

# Set the class-id of a DHCP client to huawei on VLANIF100.

<HUAWEI> system-view
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] dhcp client class-id huawei

# Set the class-id of a DHCP client to huawei on GE0/0/1.

<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] dhcp client class-id huawei

dhcp client class-id (system view)

Function

The dhcp client class-id command is used to set the Option60 field in the DHCP request packet sent by the DHCP client.

The undo dhcp client class-id command is used to restore the default value of the Option60 field.

By default, the default value of the Option60 field depends on the device type, which is " huawei Device Model".

Format

dhcp client class-id class-id

undo dhcp client class-id

Parameters

Parameter Description Value
class-id Indicates the value of the Option60 field. The value is a string of 1 to 64 case-sensitive characters.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

The DHCP server identifies the devices according to the Option60 field in the DHCP request packet. you can run the dhcp client class-id class-id command to customize the Option60 field in the DHCP request packet sent from the DHCP client.

Configuration information of the Option60 field is saved in the storage device:/dhcp-client.options file. By default, the storage device needs to provide more than 80-byte storage space. You can run the more dhcp-client.options command in the user view to check configuration information of the Option60 field.

After you run the dhcp client class-id class-id command in the system view, the device that functions as the DHCP client fills the set Option60 in the DHCP request packet sent from all of the interfaces.

Example

# Set the class-ID of a DHCP client to huawei.

<HUAWEI> system-view
[HUAWEI] dhcp client class-id huawei

dhcp client client-id

Function

The dhcp client client-id command configures an identifier for a DHCP client.

The undo dhcp client client-id command restores the default identifier of a DHCP client.

By default, the identifier of a DHCP client is the client's MAC address.

Format

dhcp client client-id client-id

undo dhcp client client-id

Parameters

Parameter

Description

Value

client-id

Specifies the identifier of a DHCP client.

The value is a string of 2 to 64 case-sensitive characters without spaces.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

The dhcp client client-id command configures an identifier for a DHCP client. The identifier is encapsulated into a DHCP Request message. When a DHCP client requests an IP address from a DHCP server, the DHCP server obtains the identifier of the DHCP client and assigns an IP address to the DHCP client with the specified identifier.

Example

# Set the identifier of the DHCP client to huawei_client on VLANIF100.

<HUAWEI> system-view
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] dhcp client client-id huawei_client
# Set the identifier of the DHCP client to huawei_client on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] dhcp client client-id huawei_client

dhcp client default-route preference

Function

The dhcp client default-route preference command configures the default route preference that a DHCP server delivers to a DHCP client.

The undo dhcp client default-route preference command restores the default value of the default route preference that a DHCP server delivers to a DHCP client.

By default, the default route preference that a DHCP server delivers to a DHCP client is 60.

Format

dhcp client default-route preference preference-value

undo dhcp client default-route preference

Parameters

Parameter

Description

Value

preference-value

Specifies the default route preference.

The value is an integer that ranges from 1 to 255. A smaller value indicates a higher preference.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

A DHCP client can obtain the default route through the DHCP server to dynamically update the routing table. The next-hop address of the default route is the DHCP client's gateway address carried in Option3.

The default route that a DHCP server delivers is the user network router (UNR) route with the default preference 60. You can run the dhcp client default-route preference command to change the default route preference.

Example

# In the view of VLANIF100, set the default route preference that a DHCP server delivers to a DHCP client to 30.

<HUAWEI> system-view
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] dhcp client default-route preference 30

# In the view of GE0/0/1, set the default route preference that a DHCP server delivers to a DHCP client to 30.

<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] dhcp client default-route preference 30

dhcp client expected-lease

Function

The dhcp client expected-lease command enables expected lease on a DHCP client.

The undo dhcp client expected-lease command disables expected lease on a DHCP client.

By default, expected lease is disabled on the DHCP client.

Format

dhcp client expected-lease time

undo dhcp client expected-lease

Parameters

Parameter

Description

Value

time

Specifies an expected lease for a DHCP client.

The value is an integer that ranges from 60 to 864000, in seconds.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

The dhcp client expected-lease command applies to DHCP clients. An expected lease can be contained in Option 51 of a DHCP Request message sent to the server. The server compares the expected lease with the lease in the address pool and assigns a shorter lease to the client.

Example

# Set the expected lease to 7200s on VLANIF100.
<HUAWEI> system-view
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] dhcp client expected-lease 7200
# Set the expected lease to 7200s on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] dhcp client expected-lease 7200

dhcp client gateway-detect

Function

The dhcp client gateway-detect command enables gateway detection on a DHCP client.

The undo dhcp client gateway-detect command disables gateway detection on a DHCP client.

By default, gateway detection is disabled on a DHCP client.

Format

dhcp client gateway-detect period period retransmit retransmit timeout time

undo dhcp client gateway-detect

Parameters

Parameter

Description

Value

period period

Specifies an interval for gateway detection on a DHCP client.

The value is an integer that ranges from 1 to 86400, in seconds.

retransmit retransmit

Specifies the retransmission count of gateway detection on a DHCP client.

The value is an integer that ranges from 1 to 10.

timeout time

Specifies the timeout period of gateway detection on a DHCP client.

It is an integer that ranges from 300 to 2000, in milliseconds.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The dhcp client gateway-detect command applies to DHCP clients. After a DHCP client obtains an IP address, the dhcp client gateway-detect command enables the DHCP client to detect the status of the gateway being used. If the gateway has an incorrect address or the gateway device fails, the DHCP client requests a new IP address from the DHCP server.

Precautions

Gateway detection applies to dual-homed scenarios.

Example

# Enable gateway detection on VLANIF100 of the DHCP client. Set the detection interval to 3600s, retransmission count to 3, and timeout period to 500ms.

<HUAWEI> system-view
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] dhcp client gateway-detect period 3600 retransmit 3 timeout 500
# Enable gateway detection on GE0/0/1 of the DHCP client. Set the detection interval to 3600s, retransmission count to 3, and timeout period to 500ms.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] dhcp client gateway-detect period 3600 retransmit 3 timeout 500

dhcp client hostname

Function

The dhcp client hostname command configures a host name for a DHCP/BOOTP client.

The undo dhcp client hostname command deletes the configured host name of a DHCP/BOOTP client.

By default, no host name is configured for a DHCP/BOOTP client.

Format

dhcp client hostname hostname

undo dhcp client hostname

Parameters

Parameter

Description

Value

hostname

Specifies the name of a DHCP/BOOTP client.

The value is a string of 1 to 64 case-sensitive characters.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

A DHCP server must obtain the host name of a client before assigning an IP address to the client. To configure a host name for a DHCP/BOOTP client, run the dhcp client hostname command. The host name is used to match the local domain name of the DHCP/BOOTP client.

Follow-up Procedure

After DHCP/BOOTP client is enabled, the device can use DHCP to obtain an IP address.

Example

# Set the host name of a DHCP/BOOTP client to huawei gateway on VLANIF100.

<HUAWEI> system-view
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] dhcp client hostname huawei gateway
# Set the host name of a DHCP/BOOTP client to huawei gateway on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] dhcp client hostname huawei gateway

dhcp client renew

Function

The dhcp client renew command renews the lease of the IP address obtained by a DHCP client.

Format

dhcp client renew

Parameters

None

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

This command applies to the following scenarios:

  • Manually renewing the lease

    If a DHCP server assigns the original IP address to the client, only the lease is renewed. If another DHCP server assigns an IP address to the client, the client obtains a new IP address and related network parameters.

  • Updating the IP address

    When the DHCP client is migrated from a network segment to another network segment and the original IP address lease does not expire, the client needs to update the IP address.

After the dhcp client renew command is run, the DHCP client sends a lease renewal request to the DHCP server.

  • If the DHCP client receives a positive reply from the server, the client updates the parameters such as the lease duration.
  • If the DHCP client receives a negative reply from the server, the client releases the applied parameters and re-applies to the DHCP server for an IP address and other network parameters.
  • If no reply is received, the client does not perform any operation.

The dhcp client renew command can be normally run only after the DHCP client function is enabled on the interface and an IP address is obtained.

Example

# Renew the IP address lease on VLANIF100.

<HUAWEI> system-view  
[HUAWEI] interface vlanif 100 
[HUAWEI-Vlanif100] dhcp client renew
# Renew the IP address lease on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] dhcp client renew

dhcp client request option-list exclude

Function

The dhcp client request option-list exclude command configures a list of default request options that are not carried in the Option55 field of DHCP Request messages.

The undo dhcp client request option-list exclude command deletes the list of default request options that are not carried in the Option55 field of DHCP Request messages.

By default, the device does not configure the option to be excluded from the DHCP client request list.

Format

dhcp client request option-list exclude option-code &<1-3>

undo dhcp client request option-list exclude option-code &<1-3>

Parameters

Parameter

Description

Value

option-code

Specifies a list of default request options that are excluded from the Option55 field.

The value is of enumerated type and can be 3, 33, and 121.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

The Option55 field in DHCP Request messages is used to set the request option list. DHCP clients use this option to specify network configuration parameters that need to be obtained from the DHCP server. By default, the Option55 field carries request options 3, 33, and 121 by default. You can run the dhcp client request option-list exclude command to configure a list of default options that are excluded from the Option55 field based on network requirements.

For option meanings, see DHCP Options in Configuration- IP Service Configuration Guide - DHCP Configuration.

Example

# Configure the default request option 3 to be excluded from the Option55 field in DHCP Request messages on VLANIF100.

<HUAWEI> system-view
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] dhcp client request option-list exclude 3

dhcp enable

Function

The dhcp enable command enables the DHCP function.

The undo dhcp enable command disables the DHCP function.

By default, the DHCP function is disabled.

NOTE:

When the S1720GFR, S1720GW, S1720GW-E, S1720GWR, S1720GWR-E, S1720X, S1720X-E, S2720EI, S2750EI, S5700LI, S5700S-LI, S5710-X-LI, S5720LI, S5720S-LI, S5720S-SI, S5720SI, S5730S-EI, S5730SI, S6720LI, S6720S-LI, S6720S-SI, and S6720SI do not work as a DHCP server or DHCP relay, do not configure this command; otherwise, users may go online slowly.

Format

dhcp enable

undo dhcp enable

Parameters

None

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

Network scale and complexity increase makes network configurations complex. For example, computers frequently change their locations, and IP addresses are insufficient for these computers. The DHCP protocol is developed to address these problems. The dhcp enable command enables the DHCP function on the device.

Precautions

The dhcp enable command is the prerequisite for configuring DHCP-related functions, including DHCP relay, DHCP snooping, and DHCP server. These functions take effect only after the dhcp enable command is run. After the undo dhcp enable command is run, all DHCP-related configurations of the device are deleted. After DHCP is enabled again using the dhcp enable command, all DHCP-related configurations of the device are restored to the default configurations.

Example

# Enable the DHCP function on the device.

<HUAWEI> system-view
[HUAWEI] dhcp enable

dhcp option template

Function

The dhcp option template command creates a DHCP Option template and enters the DHCP Option template view.

The undo dhcp option template command deletes a configured DHCP Option template.

By default, no DHCP Option template is created on the device.

Format

dhcp option template template-name

undo dhcp option template template-name

Parameters

Parameter

Description

Value

template-name

Specifies the name of the DHCP Option template.

The value is a string of 1 to 31 case-sensitive characters without spaces. The value can contain digits, letters, underscores (_), hyphens (-), and dots (.), but cannot be set to - or --.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command is used on a DHCP server. During network deployment, a DHCP server dynamically allocates IP addresses with leases to clients or allocates fixed IP addresses to some clients. For example, laptops or terminals are often moved to different places in enterprises, and they can obtain IP addresses using the dynamic allocation mode. However, IP addresses obtained dynamically are randomly allocated, and cannot be set to specified IP addresses. To allocate fixed IP addresses to some fixed terminals (such as IP phones), run the static-bind command in the global address view to bind IP addresses to MAC addresses of the clients so that the clients are allocated fixed IP addresses.

In some cases, you need to allocate other network configuration parameters except IP addresses to fixed static terminals. For example, besides obtaining an IP address, an IP phone needs information such as the startup configuration file to register normally. In this case, you can configure a DHCP Option template and configure network configuration parameters except the IP address required by the client in the DHCP Option template. Then bind the DHCP Option template to the fixed terminal in the global address pool. The DHCP server then allocates the IP address and other parameters to the terminal.

Precautions

Network parameters configured in the DHCP Option template view take effect only for static clients. A DHCP Option template can be bound to multiple clients. Run the static-bind ip-address ip-address mac-address mac-address [ option-template template-name ] command to configure a DHCP Option template that is bound to static clients.

Example

# Create a DHCP Option template named test.

<HUAWEI> system-view
[HUAWEI] dhcp option template test

dhcp relay gateway-switch enable

Function

Using the dhcp relay gateway-switch enable command, you can enable DHCP relay gateway switching.

Using the undo dhcp relay gateway-switch enable command, you can disable DHCP relay gateway switching.

By default, DHCP relay gateway switching is disabled.

Format

dhcp relay gateway-switch enable

undo dhcp relay gateway-switch enable

Parameters

None

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The dhcp relay gateway-switch enable command is used on DHCP relay agents. This command allows a DHCP relay agent to use a secondary IP address as the gateway address to apply for IP addresses for users when it fails to use the primary IP address to apply for IP addresses.

Prerequisites

  • Global DHCP has been enabled by using the dhcp enable command in the system view.
  • DHCP relay has been enabled on an interface by using the dhcp select relay command.

Precautions

  • After VRRP is configured, the gateway address for the DHCP relay agent switches among IP addresses of the VRRP groups.
  • The gateway address switches from the primary IP address to a secondary IP address only when a user fails to obtain an IP address by using the primary IP address for at least three times and the interval between the last failure and first failure exceeds 24 seconds.
  • Before running this command on an interface, ensure that the interface has a primary IP address and at least one secondary IP address.
  • If a primary IP address and multiple secondary IP addresses are configured on an interface, the system tries the secondary IP addresses one by one until users successfully obtain IP addresses.

Example

# Enable DHCP relay gateway switching on VLANIF10.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface vlanif 10
[HUAWEI-Vlanif10] ip address 192.168.30.1 255.255.255.0
[HUAWEI-Vlanif10] ip address 192.168.31.1 255.255.255.0 sub
[HUAWEI-Vlanif10] dhcp select relay
[HUAWEI-Vlanif10] dhcp relay server-ip 192.168.20.1
[HUAWEI-Vlanif10] dhcp relay gateway-switch enable
# Enable DHCP relay gateway switching on GE0/0/1.
<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.30.1 255.255.255.0
[HUAWEI-GigabitEthernet0/0/1] ip address 192.168.31.1 255.255.255.0 sub
[HUAWEI-GigabitEthernet0/0/1] dhcp select relay
[HUAWEI-GigabitEthernet0/0/1] dhcp relay server-ip 192.168.20.1
[HUAWEI-GigabitEthernet0/0/1] dhcp relay gateway-switch enable

dhcp relay information enable

Function

The dhcp relay information enable command enables the Option 82 function for the DHCP relay agent.

The undo dhcp relay information enable command disables the Option 82 function for the DHCP relay agent.

By default, the Option 82 function is disabled for the DHCP relay agent.

Format

dhcp relay information enable

undo dhcp relay information enable

Parameters

None

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to the DHCP relay agent. When DHCP Request messages carry Option 82 information, the DHCP server can locate user positions accurately and assign IP addresses to users using different policies. After the Option 82 function is enabled on the DHCP relay agent, the device checks the Option 82 field contained in the packets and processes the packets using corresponding policies.

Prerequisites

DHCP has been enabled by running the dhcp enable command in the system view.

DHCP relay has been enabled by running the dhcp select relay command in the interface view.

Precautions

If you run the dhcp relay information enable command on an interface and the dhcp option82 { insert | rebuild } enable command in the VLAN view or on a physical interface in the VLAN simultaneously, only the dhcp relay information enable command takes effect.

Follow-up Tasks

Run the dhcp relay information strategy { drop | keep | replace } command in the interface view to configure strategies for the DHCP relay agent to process Option 82 information.

Example

# Enable the Option 82 function for the DHCP relay agent on the VLANIF100 interface.

<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] vlan 100
[HUAWEI-vlan100] quit
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] dhcp select relay
[HUAWEI-Vlanif100] dhcp relay information enable
# Enable the Option 82 function for the DHCP relay agent on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] dhcp select relay
[HUAWEI-GigabitEthernet0/0/1] dhcp relay information enable

dhcp relay information strategy

Function

The dhcp relay information strategy command configures the strategies used by a DHCP relay agent to process Option 82 information.

The undo dhcp relay information strategy command restores the default setting.

By default, the strategy used by a DHCP relay agent to process Option 82 information is replace.

Format

dhcp relay information strategy { drop | keep | replace }

undo dhcp relay information strategy

Parameters

Parameters

Description

Value

drop

Configures the DHCP relay agent to drop Option 82 information.

-

keep

Configures the DHCP relay agent to keep Option 82 information.

-

replace

Configures the DHCP relay agent to replace Option 82 information.

-

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to the DHCP relay agent. When DHCP Request messages carry Option 82 information, the DHCP server can locate user positions accurately and assign IP addresses to users using different policies. When a DHCP relay agent receives DHCP Request messages, it uses one of the following strategies to process Option 82 information:
  • Drop:
    • If the received DHCP message does not carry an Option 82 field, the DHCP relay agent forwards the message directly without processing it.
    • If the received DHCP message carries an Option 82 field, the DHCP relay agent drops the Option 82 field and forwards the message.
  • Keep:
    • If the received DHCP message does not carry an Option 82 field, the DHCP relay agent forwards the message directly without processing it.
    • If the received DHCP message carries an Option 82 field, the DHCP relay agent keeps the Option 82 field and forwards the message.
  • Replace:
    • If the received DHCP message does not carry an Option 82 field, the DHCP relay agent inserts an Option 82 field configured by the administrator into the received message and forwards the message.
    • If the received DHCP message carries an Option 82 field, the DHCP relay agent replaces it with the Option 82 field configured by the administrator and forwards the message.

Prerequisites

DHCP has been enabled by running the dhcp enable command in the system view.

DHCP relay has been enabled by running the dhcp select relay command in the interface view.

The Option 82 function has been enabled for the DHCP relay agent by using the dhcp relay information enable command.

Example

# Configure the DHCP relay agent to drop Option 82 information on VLANIF 100.

<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] vlan 100
[HUAWEI-vlan100] quit
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] dhcp select relay
[HUAWEI-Vlanif100] dhcp relay information enable
[HUAWEI-Vlanif100] dhcp relay information strategy drop
# Configure the DHCP relay agent to drop Option 82 information on the GE0/0/1 interface.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] dhcp select relay
[HUAWEI-GigabitEthernet0/0/1] dhcp relay information enable
[HUAWEI-GigabitEthernet0/0/1] dhcp relay information strategy drop

dhcp relay release

Function

The dhcp relay release command configures a DHCP relay agent to send a release message to a DHCP server for releasing the IP address assigned to a DHCP client.

Format

In the system view:

dhcp relay release client-ip-address mac-address [ vpn-instance vpn-instance-name ] [ server-ip-address ]

NOTE:

Only the S1720GW, S1720GW-E, S1720GWR, S1720GWR-E, S1720X, S1720X-E, S2720EI, S5720EI, S5720HI, S5720LI, S5720S-LI, S5720S-SI, S5720SI, S5730S-EI, S5730SI, S6720EI, S6720LI, S6720S-EI, S6720S-LI, S6720SI, and S6720S-SI support vpn-instance vpn-instance-name.

In the interface view:

dhcp relay release client-ip-address mac-address [ server-ip-address ]

Parameters

Parameter

Description

Value

client-ip-address

Specifies the IP address of a DHCP client.

The value is in dotted decimal notation.

mac-address

Specifies the MAC address of a DHCP client.

The value is in H-H-H format. H is a hexadecimal number of 1 to 4 digits.

server-ip-address

Specifies the IP address of a DHCP server. If this parameter is specified, a DHCP relay agent sends a release message to the specified DHCP server for releasing the IP address assigned to a DHCP client.

The value is in dotted decimal notation.

vpn-instance vpn-instance-name

Specifies the name of the VPN instance to which the specified DHCP server releasing IP addresses belongs.

The value must be an existing VPN instance name.

Views

Interface view, system view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP relay agents. In some situations, for example, a user is forced to go offline, the user's IP address is no longer used. However, the user cannot access the network, and will not send a DHCP release message to the DHCP server to release the IP address assigned by the DHCP server. Before the IP address lease expires, the DHCP server will not assign the user's IP address to another client, wasting IP addresses. In this case, you can run the dhcp relay release command to configure a DHCP relay agent to send a DHCP release message to the DHCP server. After receiving the message, the DHCP server sets the status of the IP address to idle. The DHCP server then can assign the released IP address to another client.

If a DHCP server address is specified, the DHCP relay agent sends an address release request only to the specified DHCP server. If no DHCP server address is specified, the following situations occur:
  • When the dhcp relay release command is run in the system view, the DHCP relay agent sends an address release request to DHCP servers on all the interfaces working in DHCP relay mode.
  • When the dhcp relay release command is run in the interface view, the DHCP relay agent sends an address release request to all DHCP servers on the VLANIF interface.

Precautions

The dhcp relay release command only releases the IP addresses dynamically assigned by DHCP servers.

When multiple DHCP relay agents are connected between the DHCP client and server, this command must be executed on the first DHCP relay agent.

Example

# Configure a DHCP relay agent to send a release message to the DHCP server at 10.1.1.1 for releasing the IP address 192.168.1.1 assigned to the DHCP client whose MAC address is 0050-ba34-2000.

<HUAWEI> system-view
[HUAWEI] dhcp relay release 192.168.1.1 0050-ba34-2000 10.1.1.1

dhcp relay server-ip

Function

The dhcp relay server-ip command configures a DHCP server address on an interface enabled with DHCP relay.

The undo dhcp relay server-ip command deletes the configured DHCP server addresses on an interface enabled with DHCP relay.

By default, no DHCP server address on an interface enabled with DHCP relay is configured.

Format

dhcp relay server-ip ip-address

undo dhcp relay server-ip { ip-address | all }

Parameters

Parameter

Description

Value

ip-address

Specifies the IP address of a DHCP server.

The value is in dotted decimal notation.

all

Deletes all the DHCP server addresses configured on an interface.

-

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP relay agents. When a DHCP client needs to send a DHCP Discover message to a DHCP server on a different network segment through a DHCP relay agent, you must configure the DHCP server address on the DHCP relay agent.

When a DHCP relay agent forwards a DHCP Discover message, it does not check whether the DHCP server status is Down. If multiple DHCP server addresses are configured on an interface, multiple DHCP servers respond with DHCP Offer messages to the DHCP client. However, the DHCP client uses the first received DHCP Offer message. As a result, IP addresses in the IP address pool on the first DHCP server are insufficient, but available IP addresses in the IP address pools on the other DHCP servers are not allocated. To make each DHCP server allocate the same number of IP addresses, a DHCP relay agent changes the forwarding order each time it forwards a DHCP Discover message, so that load balancing is implemented among DHCP servers. A DHCP relay agent forwards a DHCP Discover message as follows:
  • The DHCP relay agent forwards the message to all DHCP servers by default, and changes the forwarding order each time it forwards a DHCP Discover message.
  • You can configure the ip relay address cycle command to reduce the number of packets received by a DHCP server and lessen the load of a DHCP server. After this command is configured, the DHCP relay agent forwards a received DHCP Discover message to one DHCP server at a time, and forwards the DHCP Discover message to a different DHCP server each time it receives the message.

Prerequisites

DHCP relay has been enabled on the interface using the dhcp select relay command.

Precautions

If you run the dhcp relay server-ip command for multiple times, multiple DHCP server addresses are configured.

Each interface that is enabled with DHCP relay can be configured with a maximum of 20 DHCP server addresses.

Example

# Configure DHCP relay and two DHCP server addresses on VLANIF 10.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] vlan 10
[HUAWEI-vlan10] quit
[HUAWEI] interface vlanif 10
[HUAWEI-Vlanif10] dhcp select relay
[HUAWEI-Vlanif10] dhcp relay server-ip 10.1.1.2
[HUAWEI-Vlanif10] dhcp relay server-ip 10.1.1.3
# Configure DHCP relay and two DHCP server addresses on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] dhcp select relay
[HUAWEI-GigabitEthernet0/0/1] dhcp relay server-ip 10.1.1.2
[HUAWEI-GigabitEthernet0/0/1] dhcp relay server-ip 10.1.1.3
Related Topics

dhcp relay server-select

Function

The dhcp relay server-select command configures a DHCP server group for a DHCP relay agent.

The undo dhcp relay server-select command deletes the configured DHCP server group of a DHCP relay agent.

By default, no DHCP server group is configured.

Format

dhcp relay server-select group-name

undo dhcp relay server-select

Parameters

Parameter

Description

Value

group-name

Specifies the name of a DHCP server group.

The value is a string of 1 to 32 case-sensitive characters without spaces.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The dhcp relay server-select command applies to DHCP relay agents. When a DHCP client needs to send DHCP requests to a DHCP server using a DHCP relay agent, you can run the dhcp relay server-select command to specify a DHCP server group for the DHCP relay agent and configure the DHCP server address.

Prerequisites

  1. A DHCP server group has been created using the dhcp server group command.
  2. The DHCP relay function has been enabled using the dhcp select relay command so that the system can forward DHCP packets to the specified DHCP server.

Precautions

  • Multiple interfaces can be configured with the same DHCP server group, and one interface can be configured with only one DHCP server group.
  • If you run the dhcp relay server-select command in the same interface view for multiple times, only the latest configuration takes effect. If a specified DHCP server group does not exist, the configuration fails; however, the latest configured DHCP server group still takes effect.

Example

# Configure the DHCP server group of a DHCP relay agent as group1 on VLANIF100.

<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp server group group1
[HUAWEI-dhcp-server-group-group1] dhcp-server 10.10.10.10
[HUAWEI-dhcp-server-group-group1] quit
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] dhcp select relay
[HUAWEI-Vlanif100] dhcp relay server-select group1
# Configure the DHCP server group of a DHCP relay agent as group1 on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp server group group1
[HUAWEI-dhcp-server-group-group1] dhcp-server 10.10.10.10
[HUAWEI-dhcp-server-group-group1] quit
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] dhcp select relay
[HUAWEI-GigabitEthernet0/0/1] dhcp relay server-select group1

dhcp relay trust option82

Function

The dhcp relay trust option82 command enables Option 82 on the DHCP relay agent.

The undo dhcp relay trust option82 command disables Option 82 on the DHCP relay agent.

By default, Option 82 is enabled on the DHCP relay agent.

Format

dhcp relay trust option82

undo dhcp relay trust option82

Parameters

None

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command is used on the DHCP relay agent to enable the Option 82 function. After receiving a DHCP packet that carries the Option 82 field but the giaddr field of the packet is 0, the DHCP relay agent processes the packet by default. Using the undo dhcp relay trust option82 command, the DHCP relay agent discards the packet.

Prerequisites

DHCP has been enabled globally by using the dhcp enable command.

Example

# Enable Option 82 trusted of the DHCP relay agent.

<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp relay trust option82

dhcp select global

Function

The dhcp select global command enables an interface to use the global address pool.

The undo dhcp select global command disables an interface from using the global address pool.

By default, an interface is disabled from using the global address pool.

Format

dhcp select global

undo dhcp select global

Parameters

None

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The dhcp select global command applies to DHCP servers. After receiving a DHCP Request message from a DHCP client, a DHCP server assigns an IP address from the local address pool to the client. Run the dhcp select global command to configure the device to assign IP addresses from the global address pool. When no interface address pool is created for the DHCP server, the DHCP server assigns an IP address from the global address pool to an online user.

The device can also assign IP addresses from an interface address pool using the dhcp select interface command in the interface view.

Prerequisites
  • DHCP has been enabled using the dhcp enable command in the system view.

Example

# Enable VLANIF100 to use the global address pool.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ip address 10.1.1.1 24
[HUAWEI-Vlanif100] dhcp select global
# Enable GE0/0/1 to use the global address pool.
<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 global

dhcp select interface

Function

The dhcp select interface command enables an interface to use the interface address pool.

The undo dhcp select interface command disables an interface from using the interface address pool.

By default, the DHCP server function using the interface address pool is disabled on an interface.

Format

dhcp select interface

undo dhcp select interface

Parameters

None

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The dhcp select interface command applies to DHCP servers. After receiving a DHCP Request message from a DHCP client, a DHCP server assigns an IP address from the local address pool to the client. Run the dhcp select interface command to configure a DHCP server to assign IP addresses from the interface address pool to clients.

The device can also assign IP addresses from a global address pool using the dhcp select global command.

Prerequisites

DHCP has been enabled globally using the dhcp enable command in the system view.

An IP address has been configured for an interface using the ip address command. The IP addresses assigned by the address pool and configured on the interface are on the same network segment.

Example

# Enable VLANIF100 to use the interface address pool.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ip address 10.1.1.2 24
[HUAWEI-Vlanif100] dhcp select interface
# Enable GE0/0/1 to use the interface address pool.
<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

dhcp select relay

Function

The dhcp select relay command enables the DHCP relay function.

The undo dhcp select relay command disables the DHCP relay function.

By default, the DHCP relay function is disabled.

Format

dhcp select relay

undo dhcp select relay

Parameters

None

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The dhcp select relay command applies to DHCP relay agents. If the DHCP server and client are on the same network segment, they can directly communicate with each other using DHCP. In this case, no DHCP relay agent is needed. If the DHCP server and client are on different network segments, the DHCP relay function must be enabled to forward DHCP messages.

Prerequisites

The DHCP function has been enabled using the dhcp enable command in the system view.

Follow-up Tasks

  • To ensure that a DHCP relay agent can forward DHCP packets to a DHCP server, run the dhcp relay server-select or dhcp relay server-ip command on the DHCP relay-enabled interface to configure the correct IP address of the DHCP server.
  • To ensure that a DHCP server can forward DHCP packets to a DHCP relay agent, you must configure a route to the DHCP relay agent on the DHCP server.

Precautions

  • The DHCP server must select an IP address in the same network segment with the DHCP relay agent from the global address pool to ensure that the DHCP client obtains an IP address on the local network segment. No interface address pool can be configured on the interface that connects the DHCP server and relay agent.

Example

# Enable the DHCP relay function on VLANIF100.

<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] dhcp select relay
# Enable the DHCP relay function on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] dhcp select relay

dhcp server alarm ip-used percentage

Function

The dhcp server alarm ip-used percentage command configures the percentage of the alarms indicating that the addresses in an interface address pool are used up, and the percentage of the clear alarms.

The undo dhcp server alarm ip-used percentage command restores the default percentages of the alarms and clear alarms.

By default, the percentage of the alarms indicating that the addresses in an interface address pool are used up is 100%, and the percentage of the clear alarms is 50%.

Format

dhcp server alarm ip-used percentage alarm-resume-percentage alarm-percentage

undo dhcp server alarm ip-used percentage

Parameters

Parameter

Description

Value

alarm-resume-percentage Specifies the percentage of the clear alarms. The value is an integer that ranges from 1 to 100. The default value is 50.
NOTE:
The percentage of the clear alarms cannot exceed that of the alarms.
alarm-percentage Specifies the percentage of the alarms indicating that the addresses in an address pool are used up. The value is an integer that ranges from 1 to 100. The default value is 100.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

When the addresses in an interface address pool are used up, alarms are sent to notify the administrator.

Precautions

The percentage of the clear alarms cannot exceed that of the alarms.

Example

# Configure the percentage of the alarms indicating that the addresses in an interface address pool are used up, and the percentage of the clear alarms in the interface address pool of the VLANIF100.

<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ip address 10.10.10.10 24
[HUAWEI-Vlanif100] dhcp select interface
[HUAWEI-Vlanif100] dhcp server alarm ip-used percentage 80 90
# Configure the percentage of the alarms indicating that the addresses in an interface address pool are used up, and the percentage of the clear alarms in the interface address pool of the GE0/0/1.
<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.10.10.10 24 
[HUAWEI-GigabitEthernet0/0/1] dhcp select interface
[HUAWEI-GigabitEthernet0/0/1] dhcp server alarm ip-used percentage 80 90

dhcp server bootfile

Function

The dhcp server bootfile command configures the name of the startup configuration file for a DHCP client.

The undo dhcp server bootfile command deletes the configured name of the startup configuration file for a DHCP client.

By default, the startup configuration file name is not configured for a DHCP client.

Format

dhcp server bootfile bootfile

undo dhcp server bootfile

Parameters

Parameter

Description

Value

bootfile

Specifies the name of the startup configuration file for a DHCP client.

The value is a string of 1 to 127 case-sensitive characters without spaces.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

Besides assigning IP addresses, a DHCP server can also provide the required network configuration parameters, such as the startup configuration file name for the DHCP clients. After the name of the startup configuration file is configured using the dhcp server bootfile command, the Offer and ACK packets sent from the DHCP server carry this file name. The DHCP client can acquire the startup configuration file from the specified server based on the file name.

Prerequisites

  1. The DHCP function has been enabled using the dhcp enable command in the system view.

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

Example

# Configure the name of the startup configuration file as start.ini for the DHCP client on the Vlanif100.

<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ip address 192.168.1.1 255.255.255.0
[HUAWEI-Vlanif100] dhcp select interface
[HUAWEI-Vlanif100] dhcp server bootfile start.ini
# Configure the name of the startup configuration file as start.ini for the DHCP client on the GE0/0/1.
<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 255.255.255.0
[HUAWEI-GigabitEthernet0/0/1] dhcp select interface
[HUAWEI-GigabitEthernet0/0/1] dhcp server bootfile start.ini

dhcp server bootp

Function

Using the dhcp server bootp command, you can enable a DHCP server to respond to a Bootstrap Protocol (BOOTP) request.

Using the undo dhcp server bootp command, you can disable a DHCP server from responding to a BOOTP request.

By default, a DHCP server does not respond to a BOOTP request.

Format

dhcp server bootp

undo dhcp server bootp

Parameters

None

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

A DHCP server and a BOOTP server may reside on the same network segment. The BOOTP server assigns static IP addresses to BOOTP clients. As defined in the DHCP protocol, a DHCP server can also respond to BOOTP requests to assign IP addresses to BOOTP clients. BOOTP clients may obtain IP addresses from the DHCP server but not the BOOTP server.

Prerequisites

DHCP has been enabled globally using the dhcp enable command in the system view.

Follow-up Procedure

Using the dhcp server bootp automatic command in the system view, you can enable the DHCP server to allocate IP addresses to BOOTP clients.

Example

# Enable a DHCP server to respond to a BOOTP request.

<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp server bootp
Related Topics

dhcp server bootp automatic

Function

The dhcp server bootp automatic command enables the DHCP server to dynamically allocate IP addresses to BOOTP clients.

The undo dhcp server bootp automatic command disables the DHCP server from dynamically allocating IP addresses to BOOTP clients.

By default, a DHCP server does not dynamically allocate IP addresses to BOOTP clients.

Format

dhcp server bootp automatic

undo dhcp server bootp automatic

Parameters

None

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP servers. When BOOTP clients need to obtain their IP addresses, DNS server's IP address, and gateway IP address from a DHCP server, you need to run the dhcp server bootp automatic command to enable the DHCP server to dynamically allocate IP addresses to BOOTP clients.

Prerequisites
  • DHCP has been enabled globally using the dhcp enable command in the system view.

  • The DHCP server has been enabled to respond to BOOTP requests by using the dhcp server bootp command, or dhcp server bootp automatic cannot take effect.

Precautions

When the device functions as the DHCP server, the device can allocate IP addresses to BOOTP clients if the BOOTP clients reside on the same network as the DHCP server. You can run the dhcp server bootp automatic command to dynamically allocate IP addresses. You can also run the static-bind command or the dhcp server static-bind command to allocate IP addresses to BOOTP clients in the static binding mode.

Example

# Enable the DHCP server to allocate IP addresses to BOOTP clients.

<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp server bootp
[HUAWEI] dhcp server bootp automatic

dhcp server conflict auto-recycle interval

Function

The dhcp server conflict auto-recycle interval command enables automatic reclaim of conflicting IP addresses in the interface address pool and configures the interval for the automatic reclaim.

The undo dhcp server conflict auto-recycle interval command disables automatic reclaim of conflicting IP addresses in the interface address pool and deletes the configured interval for the automatic reclaim.

By default, automatic reclaim of conflicting IP addresses in the interface address pool is disabled.

Format

dhcp server conflict auto-recycle interval day day [ hour hour [ minute minute ] ]

undo dhcp server conflict auto-recycle interval

Parameters

Parameter

Description

Value

day day

Specifies the interval for the automatic reclaim, in days.

The value is an integer that ranges from 0 to 999, in days. The default value is 0.

hour hour

Specifies the interval for the automatic reclaim, in hours.

The value is an integer that ranges from 0 to 23, in hours. The default value is 0.

minute minute

Specifies the interval for the automatic reclaim, in minutes.

The value is an integer that ranges from 0 to 59, in minutes. The default value is 0.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command is used on a DHCP server. When a DHCP server allocates IP addresses to clients, IP address conflict may occur because IP addresses of some hosts have been manually configured. In this case, the DHCP server considers these IP addresses as conflicting IP addresses, and allocates available IP addresses from the conflicting IP addresses to clients only after available IP addresses in the address pool are used up. To reclaim conflicting IP addresses promptly, the administrator can run this command to enable automatic reclaim and specify the reclaim interval.

Prerequisites

  1. IP addresses in the interface address pool have been configured using the ip address command.

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

Example

# Enable automatic reclaim for conflicting IP addresses in the address pool on VLANIF 100, and set the interval for automatic reclaim to one day.

<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 conflict auto-recycle interval day 1
# Enable automatic reclaim for conflicting IP addresses in the address pool on GE0/0/1, and set the interval for automatic reclaim to one day.
<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 conflict auto-recycle interval day 1

dhcp server database

Function

The dhcp server database command enables the function to save the current DHCP data to storage devices.

The undo dhcp server database command disables the function to save the DHCP data to storage devices.

By default, DHCP data is not saved to storage devices.

Format

dhcp server database { enable | recover | write-delay interval }

undo dhcp server database { enable | recover | write-delay }

Parameters

Parameter

Description

Value

enable

Enables the function to save DHCP data to storage devices.

-

recover

Recovers DHCP configurations using DHCP data in storage device.

-

write-delay interval

Specifies the interval at which DHCP data is saved.

The value is an integer ranging from 300 to 86400, in seconds. The default value is 7200 seconds.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

When the device functions as a DHCP server, run the dhcp server database enable command to enable the device to save DHCP data to storage devices. This avoids data loss caused by device faults. Then the system generates lease.txt and conflict.txt files in the storage device. The two files save address lease information and address conflict information respectively. Run the display dhcp server database command to check the storage device for saving DHCP data. After the dhcp server database enable command is run, current DHCP data is automatically saved at the specified interval, and previous data files are overwritten. The interval can be set using the dhcp server database write-delay interval command.

If a fault occurs on the device, run the dhcp server database recover command to recover DHCP data from storage devices during the system restarts.

Prerequisites

The dhcp server database enable command has been run to enable the device to save DHCP data to storage devices, and ensure that the storage devices work properly.

Precautions

  • The lease.txt and conflict.txt files are overwritten periodically; therefore, you are advised to back up and save the two files to other locations.

  • The time displayed in the lease.txt and conflict.txt files is the UTC time rather than the system time, and you do not need to pay attention to time zone information.
  • During the interval, if the device restarts unexpectedly, DHCP data generated at the interval are lost. Users can only recover the last successfully saved DHCP data from storage device files.

Example

# Enable the device to save the current DHCP data to storage devices and set the interval at which DHCP data is saved to 2000s.

<HUAWEI> system-view
[HUAWEI] dhcp server database enable
[HUAWEI] dhcp server database write-delay 2000

# Recover DHCP configuration using the DHCP data saved on storage devices.

<HUAWEI> system-view
[HUAWEI] dhcp server database recover

dhcp server dns-list

Function

The dhcp server dns-list command configures DNS server addresses for an interface address pool.

The undo dhcp server dns-list command deletes the specified DNS server addresses of an interface address pool.

By default, no DNS server address is configured in an interface address pool.

Format

dhcp server dns-list { ip-address &<1-8> | unnumbered interface interface-type interface-number }

undo dhcp server dns-list { all | ip-address | unnumbered interface }

Parameters

Parameter Description Value
ip-address Specifies the IP address of the DNS server. You can configure up to eight IP addresses for the DNS servers and separate two IP addresses with a space. The value is in dotted decimal notation.
unnumbered interface interface-type interface-number Borrows the DNS server address obtained by the interface as the DNS server IP address. -
all Deletes all IP addresses of DNS servers specified for the client. -

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP servers. If user hosts access hosts on the network through the domain name, user hosts need to send DNS Request messages to the DNS server and resolve the domain name. To enable DNS services on the DHCP client, specify the DNS server address for the interface address pool on the DHCP server. The DHCP server can assign both the specified DHCP server address and an IP address to the client. To configure DNS server addresses for a global address pool, run the dns-list command.

Prerequisites
  • The address of an interface address pool has been configured using the ip address command.

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

Precautions

  • Each address pool can be configured with a maximum of eight DNS server addresses. If multiple DNS server addresses are configured, the first DNS server address assigned to the DHCP client functions as the primary address and other addresses are secondary addresses.
  • To specify multiple DNS servers, enter multiple DNS server addresses in the dhcp server dns-list command.

Example

# Specify a DNS server at 10.10.1.254 for domain name resolution when IP addresses in the interface address pool on VLANIF100 are assigned to clients.
<HUAWEI> system-view
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ip address 10.1.1.1 24
[HUAWEI-Vlanif100] dhcp select interface
[HUAWEI-Vlanif100] dhcp server dns-list 10.10.1.254
# Specify a DNS server at 192.168.1.254 for domain name resolution when IP addresses in the interface address pool on GE0/0/1 are assigned to 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 10.10.10.10 24 
[HUAWEI-GigabitEthernet0/0/1] dhcp select interface
[HUAWEI-GigabitEthernet0/0/1] dhcp server dns-list 192.168.1.254

dhcp server domain-name (interface view)

Function

The dhcp server domain-name command configures a DNS domain name assigned to a DHCP client.

The undo dhcp server domain-name command deletes a specified domain name.

By default, no domain name is configured for the DHCP client.

Format

dhcp server domain-name domain-name

undo dhcp server domain-name

Parameters

Parameter Description Value
domain-name Specifies the domain name that the DHCP server assigns to the client. The value is a string of 1 to 63 characters, spaces not supported. The string is a combination of digits, letters, underscores (_), and dots (.).

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP servers. Run the dhcp server domain-name command on a DHCP server to specify a domain name for each interface address pool. When allocating IP addresses to clients, the DHCP server also sends the domain names to the clients.

Prerequisites
  • The address of an interface address pool has been configured using the ip address command.

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

Precautions

If no domain name is specified for an interface address pool, a DHCP server does not send a domain name to clients, and users cannot access the Web service by using a domain name.

To configure a domain name for the global address pool, run the domain-name command.

Example

# Set the domain name assigned by the DHCP address pool on the interface to example.com.
<HUAWEI> system-view
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ip address 10.1.1.1 24
[HUAWEI-Vlanif100] dhcp select interface
[HUAWEI-Vlanif100] dhcp server domain-name example.com
# Specify the domain name in the address pool on GE0/0/1 as huawei.com.
<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.10.10.10 24 
[HUAWEI-GigabitEthernet0/0/1] dhcp select interface
[HUAWEI-GigabitEthernet0/0/1] dhcp server domain-name huawei.com

dhcp server excluded-ip-address

Function

The dhcp server excluded-ip-address command specifies the range of IP addresses that cannot be automatically assigned to clients from an interface address pool.

The undo dhcp server excluded-ip-address command deletes the specified range of IP addresses that cannot be automatically assigned to clients from the interface address pool.

By default, all IP addresses in the address pool can be automatically assigned to clients.

Format

dhcp server excluded-ip-address start-ip-address [ end-ip-address ]

undo dhcp server excluded-ip-address start-ip-address [ end-ip-address ]

Parameters

Parameter

Description

Value

start-ip-address

Specifies the start IP address that cannot be automatically assigned.

The value is in dotted decimal notation.

end-ip-address

Specifies the end IP address that cannot be automatically assigned. If end-ip-address is not specified, only start-ip-address cannot be automatically assigned.

The value is in dotted decimal notation. end-ip-address and start-ip-address must be on the same network segment and end-ip-address must be larger than start-ip-address.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The dhcp server excluded-ip-address command applies to DHCP servers. Fixed IP addresses are allocated to some specific hosts (such as the WWW server) on the network for a long time. If these hosts' IP addresses are overlapped with IP addresses in the address pool and the DHCP server allocates these overlapped IP addresses to other hosts, IP address conflicts may occur. To prevent the IP address conflict, you need to exclude these IP addresses from being automatically allocated in the address pool.

You can run the dhcp server excluded-ip-address command to specify the IP addresses or the range of IP addresses that cannot be automatically assigned to clients in the interface address pool.

You can run the excluded-ip-address command to specify the IP addresses or the range of IP addresses that cannot be automatically assigned to clients in the global address pool.

Prerequisites

  • An address segment in the interface address pool is configured using the ip address command.
  • The DHCP server function has been enabled on the interface using the dhcp select interface command.

Precautions

  • IP addresses that cannot be automatically assigned must be in the address pool. If the range of IP addresses in the address pool is changed using the dhcp server ip-range command, IP addresses that are configured not to be automatically assigned must be within the changed IP address range.
  • You do not need to exclude the gateway address configured using the dhcp server gateway-list command from being automatically allocated. The device automatically adds the gateway address into the list of IP addresses that cannot be automatically allocated.

    You do not need to exclude the IP address of a server's interface connecting to a client from being automatically allocated. The device automatically sets the interface IP address to the Conflict status during address allocation.

  • If you run this command multiple times, you can specify multiple IP addresses or IP address segments that cannot be automatically assigned to clients from the specified address pool.
  • You can run the display ip pool command to check used IP addresses in the current address pool, and then specify unused IP addresses that cannot be automatically assigned. To exclude used IP addresses from being automatically assigned, run the reset ip pool command to reclaim used IP addresses first.

Example

# Specify that IP addresses 192.168.1.1 to 192.168.1.20 cannot be automatically assigned to clients from the address pool on VLANIF100.
<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 excluded-ip-address 192.168.1.1 192.168.1.20
# Specify that IP addresses 10.10.10.11 to 10.10.10.20 cannot be automatically assigned to clients from the address pool on GE0/0/1.
<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.10.10.10 24 
[HUAWEI-GigabitEthernet0/0/1] dhcp select interface
[HUAWEI-GigabitEthernet0/0/1] dhcp server excluded-ip-address 10.10.10.11 10.10.10.20

dhcp server force insert option

Function

The dhcp server force insert option command configures a DHCP server to forcibly insert an Option field specified in the interface address pool to a DHCP Response packet that it sends to a DHCP client.

The undo dhcp server force insert option command deletes the Option field forcibly inserted to a DHCP Response packet that a DHCP server sends to a DHCP client.

By default, a DHCP server does not forcibly insert an Option field to a DHCP Response packet that it sends to a DHCP client.

Format

dhcp server force insert option code &<1-254>

undo dhcp server force insert option code &<1-254>

Parameters

Parameter

Description

Value

code

Specifies the code for a forcibly replied option. You can configure a DHCP server to forcibly reply one or more options.

The value is an integer that ranges from 1 to 254.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

In general, when a DHCP client applies for an IP address from a DHCP server, parameters contained in the DHCP Request packet specify the options the client requires. The DHCP server inserts the required options to a DHCP Response packet.

Sometimes, a device, functioning as a DHCP server, receives a DHCP Request packet that contains no parameter specifying the options the client requires. However, the client still wants to obtain the options configured on the interface address pool. You can run the dhcp server force insert option code &<1-254> command to configure the DHCP server to forcibly insert an Option field to the DHCP Response packet.

Prerequisites

  1. The device has been configured to assign IP addresses in the interface address pool using the dhcp select interface command.

  2. The Option field has been configured in the interface address pool using the dhcp server option code [ sub-option sub-code ] { ascii ascii-string | hex hex-string | cipher cipher-string | ip-address ip-address &<1-8> } command in the interface view.

Example

# Configure a DHCP server to forcibly insert Option 4 to a DHCP Response packet on VLANIF100.

<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] vlan 100
[HUAWEI-vlan100] quit
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] dhcp select interface
[HUAWEI-Vlanif100] dhcp server option 4 hex 11 22
[HUAWEI-Vlanif100] dhcp server force insert option 4
# Configure a DHCP server to forcibly insert Option 4 to a DHCP Response packet on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] dhcp select interface
[HUAWEI-GigabitEthernet0/0/1] dhcp server option 4 hex 11 22
[HUAWEI-GigabitEthernet0/0/1] dhcp server force insert option 4

dhcp server gateway-list

Function

The dhcp server gateway-list command sets the default gateway IP address that a DHCP server pre-allocates to DHCP clients.

The undo dhcp server gateway-list command deletes the configured default gateway IP address.

By default, the default gateway IP address that a DHCP server pre-allocates to DHCP clients is not configured.

Format

dhcp server gateway-list ip-address &<1-8>

undo dhcp server gateway-list { ip-address | all }

Parameters

Parameter Description Value
ip-address Specifies an IP address. You can configure a maximum of eight gateway addresses, which are separated by spaces. The value is in decimal dotted notation.
all Indicates all IP addresses. -

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

To load balance traffic and improve network reliability, you can configure multiple default gateway addresses.

Do not configure the default gateway address allocated to DHCP clients as a broadcast address.

If the VRRP virtual IP address is configured on the interface and no gateway address is pre-allocated to the DHCP client using the dhcp server gateway-list command, the DHCP server uses the first VRRP virtual IP address as the gateway address to be allocated to the client. If no VRRP virtual IP address is configured on the interface, the DHCP server uses the physical IP address of the interface as the gateway address to be allocated to the client.

If the dhcp server gateway-list command is not configured, the gateway address allocated by the DHCP server to the DHCP client may fail to be displayed in trace information during fault diagnosis. Therefore, you are advised to configure this command if the DHCP server function based on an interface address pool is used.

Example

# Enable a DHCP server on a VLANIF100 to pre-allocate default gateway address 10.1.1.1 to DHCP clients.

<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 gateway-list 10.1.1.1
# Enable a DHCP server on GE0/0/1 to pre-allocate default gateway address 10.1.1.1 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 10.1.1.1 24 
[HUAWEI-GigabitEthernet0/0/1] dhcp select interface
[HUAWEI-GigabitEthernet0/0/1] dhcp server gateway-list 10.1.1.1

dhcp server group

Function

The dhcp server group command creates a DHCP server group and displays the DHCP server group view or directly displays the view of the existing DHCP server group.

The undo dhcp server group command deletes an existing DHCP server group.

By default, no DHCP server group is configured.

Format

dhcp server group group-name

undo dhcp server group group-name

Parameters

Parameter

Description

Value

group-name

Specifies the name of a DHCP server group.

The value is a string of 1 to 32 case-sensitive characters without spaces.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP relay agents. Generally, a DHCP relay agent serves multiple DHCP servers. To manage these DHCP servers in a unified manner, run the dhcp server group command to create a DHCP server group. The DHCP server group then assigns IP addresses to users using the DHCP relay agent.

Follow-up Procedure
  • Run the dhcp-server command to add DHCP servers to the DHCP server group.

  • Run the dhcp relay server-select command in the interface view to specify a DHCP server group for the DHCP relay agent.

Precautions

You can configure a maximum of 32 DHCP server groups in the system, and a maximum of 20 DHCP servers in a DHCP server group.

Example

# Create a DHCP server group named dhcp-srv1.

<HUAWEI> system-view
[HUAWEI] dhcp server group dhcp-srv1

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

The DHCP server function of the interface address pool has been enabled on interfaces 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

dhcp server lease

Function

The dhcp server lease command specifies the IP address lease for addresses in an interface address pool.

The undo dhcp server lease command restores the default IP address lease of addresses in an interface address pool.

By default, the IP address lease of addresses in an interface address pool is one day.

Format

dhcp server lease { day day [ hour hour [ minute minute ] ] | unlimited }

undo dhcp server lease

Parameters

Parameter

Description

Value

day day

Specifies the number of days in the IP address lease.

The value is an integer that ranges from 0 to 999. The default value is 1.

hour hour

Specifies the number of hours in the IP address lease.

The value is an integer that ranges from 0 to 23. The default value is 0.

minute minute

Specifies the number of minutes in the IP address lease.

The value is an integer that ranges from 0 to 59. The default value is 0.

unlimited

Indicates that the IP address lease is unlimited.

-

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP servers. To meet different client requirements, DHCP supports dynamic, automatic, and static address assignment.

DHCP clients require different IP address leases.
  • If a host (such as the DNS server) needs to use a fixed IP address for a long time, run the dhcp server lease unlimited command to configure the IP address lease as unlimited.
  • If a host (such as a portable computer) needs to use a temporary IP address, run the dhcp server lease command to specify an IP address lease. After the lease expires, the DHCP server withdraws the IP address and assigns the address to other clients.
When a DHCP client starts and 50% or 87.5% of its IP address lease has passed, the DHCP client sends a DHCP Request message to the DHCP server to renew the lease.
  • If the IP address can still be assigned to the client, the DHCP server informs the client of a renewed IP address lease.
  • If the IP address can no longer be assigned to the client, the DHCP server informs the client that the IP address lease cannot be renewed.

You can run the display ip pool command to view information about the IP address lease. The values of the lease and left fields in the command output indicate the configured lease time and remaining lease time, respectively.

Prerequisites
  • The address of an interface address pool has been configured using the ip address command.

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

Precautions

Different IP address leases can be specified for different interface address pools on a DHCP server. All IP addresses in an interface address pool have the same lease.

If the IP address lease of an address pool is changed using this command, newly assigned IP addresses use the new IP address lease. IP addresses assigned before the change still use the original IP address lease before the lease is updated, and use the new lease after the lease is updated.

Example

# Set the IP address lease of the address pool on VLANIF100 to 2 days 2 hours and 30 minutes.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ip address 10.10.10.10 24 
[HUAWEI-Vlanif100] dhcp select interface
[HUAWEI-Vlanif100] dhcp server lease day 2 hour 2 minute 30
# Set the IP address lease of the address pool on GE0/0/1 to 2 days 2 hours and 30 minutes.
<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.10.10.10 24 
[HUAWEI-GigabitEthernet0/0/1] dhcp select interface
[HUAWEI-GigabitEthernet0/0/1] dhcp server lease day 2 hour 2 minute 30

dhcp server logging

Function

The dhcp server logging command enables the logging function during IP address allocation of the DHCP server in the interface view.

The undo dhcp server logging command disables the logging function during IP address allocation of the DHCP server in the interface view.

By default, the logging function during IP address allocation of the DHCP server is disabled.

Format

dhcp server logging [ allocation-fail | allocation-success | release | renew-fail | renew-success | detect-conflict | recycle-conflict ] *

undo dhcp server logging [ allocation-fail | allocation-success | release | renew-fail | renew-success | detect-conflict | recycle-conflict ] *

Parameters

Parameter

Description

Value

allocation-fail Displays logs when address allocation fails. -
allocation-success Displays logs when address allocation succeeds. -
release Displays logs when addresses are released. -
renew-fail Displays logs when address lease renewal fails. -
renew-success Displays logs when address lease renewal succeeds. -
detect-conflict Displays logs when address conflict occurs. -
recycle-conflict Displays logs when conflicting addresses are reclaimed. -

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command is used on a DHCP server. When the DHCP server allocates IP addresses to clients, it records address allocation information to facilitate routine maintenance and fault location. After the logging function during IP address allocation of the DHCP server is configured using the dhcp server logging command, the DHCP server records logs about address allocation, conflict, lease renewal, and release.

Run the display ip pool interface interface-pool-name command to check the status of the logging function during IP allocation of the DHCP server.

Prerequisites

The DHCP server function of the interface address pool has been enabled on interfaces using the dhcp select interface command.

Precautions

If a large number of DHCP clients request for IP addresses after the logging function during IP address allocation of the DHCP server is configured, the server frequently records logs and therefore the device performance may be affected.

Example

# Enable the logging function during IP address allocation of the DHCP server on the interface VLANIF100.

<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 logging
# Enable the logging function during IP address allocation of the DHCP server on the interface GE0/0/1.
<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 logging
Related Topics

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

The DHCP server function of the interface address pool has been enabled on interfaces 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

dhcp server nbns-list

Function

The dhcp server nbns-list command configures Network Basic Input Output System (NetBIOS) server addresses for an interface address pool.

The undo dhcp server nbns-list command deletes the NetBIOS server address from an interface address pool.

By default, no NetBIOS server address is configured for an interface address pool.

Format

dhcp server nbns-list ip-address &<1-8>

undo dhcp server nbns-list { ip-address | all }

Parameters

Parameter

Description

Value

ip-address

Specifies the NetBIOS server address.

The value is in dotted decimal notation.

all

Deletes all NetBIOS server addresses.

-

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP servers. Before hosts communicate with each other, a NetBIOS server needs to resolve the accessed NetBIOS hostname to an IP address. To enable hosts to communicate with each other, run the dhcp server nbns-list command to configure NetBIOS server addresses for an interface address pool. When assigning IP addresses to clients, a DHCP server also assigns the configured NetBIOS server addresses to clients. To configure NetBIOS server addresses for a global address pool, run the nbns-list command.

Prerequisites
  • The address of an interface address pool has been configured using the ip address command.

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

Precautions

Each interface can be configured with a maximum of eight NetBIOS server addresses. The first assigned address functions as the primary address, and other addresses function as secondary addresses.

Example

# Specify a NetBIOS server at 192.168.1.99 for domain name resolution when IP addresses in the interface address pool on VLANIF100 are assigned to clients.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ip address 10.10.10.10 24 
[HUAWEI-Vlanif100] dhcp select interface
[HUAWEI-Vlanif100] dhcp server nbns-list 192.168.1.99
# Specify a NetBIOS server at 192.168.1.99 for domain name resolution when IP addresses in the interface address pool on GE0/0/1 are assigned to 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 10.10.10.10 24 
[HUAWEI-GigabitEthernet0/0/1] dhcp select interface
[HUAWEI-GigabitEthernet0/0/1] dhcp server nbns-list 192.168.1.99

dhcp server netbios-type

Function

The dhcp server netbios-type command specifies the NetBIOS node type for a DHCP client connecting to an interface.

The undo dhcp server netbios-type command deletes the specified NetBIOS node type of a DHCP client connecting to an interface.

By default, no NetBIOS node type is specified for a DHCP client connecting to an interface.

Format

dhcp server netbios-type { b-node | h-node | m-node | p-node }

undo dhcp server netbios-type

Parameters

Parameter

Description

Value

b-node

Indicates a node in broadcast mode. A b-node obtains the mapping in broadcast mode.

-

h-node

Indicates a node in hybrid mode. An h-node is a b-type node enabled with the end-to-end communication mechanism.

-

m-node

Indicates a node in mixed mode. An m-node is a p-type node with some broadcast features.

-

p-node

Indicates a node in peer-to-peer mode. This node obtains mappings by communicating with the NetBIOS server.

-

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP servers. When DHCP clients use NetBIOS on the WAN to communicate, their host names and IP addresses need to be mapped. You can run the dhcp server netbios-type command to configure the NetBIOS node type for an interface address pool. When assigning an IP address to the client, the DHCP server also sends the specified NetBIOS node type to the client.

Prerequisites
  • The address of an interface address pool has been configured using the ip address command.

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

Precautions

To specify the NetBIOS node type for a client in the global address pool, run the netbios-type command.

Example

# Set the NetBIOS node type for a client in the address pool on VLANIF100 to p-node.

<HUAWEI> system-view 
[HUAWEI] dhcp enable
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ip address 10.10.10.10 24 
[HUAWEI-Vlanif100] dhcp select interface
[HUAWEI-Vlanif100] dhcp server netbios-type p-node
# Set the NetBIOS node type for a client in the address pool on GE0/0/1 to p-node.
<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.10.10.10 24 
[HUAWEI-GigabitEthernet0/0/1] dhcp select interface
[HUAWEI-GigabitEthernet0/0/1] dhcp server netbios-type p-node

dhcp server next-server

Function

The dhcp server next-server command specifies a server IP address for DHCP clients.

The undo dhcp server next-server command cancels the configuration.

By default, no server IP address is specified by the DHCP Server for DHCP clients.

Format

dhcp server next-server ip-address

undo dhcp server next-server

Parameters

Parameter

Description

Value

ip-address

Specifies a server IP address.

The value is in dotted decimal notation.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The dhcp server next-server command is used on DHCP servers. When assigning a DHCP client an IP address, a DHCP server can also assign the DHCP client an IP address of the server that provides network services for the client. For example, some clients like IP phones still need other configuration parameters after automatically obtaining IP addresses. You can run the dhcp server next-server command to specify the server address used after a client obtains an IP address. The client then requests the configuration parameters from the specified server after obtaining an IP address.

If users use addresses in the interface address pool, run the dhcp server next-server command to specify the DHCP server IP address. If users use addresses in the global address pool, run the next-server command to specify the DHCP server IP address.

Prerequisites
  • The address of an interface address pool has been configured using the ip address command.

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

Precautions

  • The dhcp server next-server command takes effect for only users that use addresses in the interface address pool.
  • If you run the dhcp server next-server command multiple times, only the latest configuration takes effect.

Example

# Specify the server IP address 192.168.1.2 in the interface address pool on VLANIF100 used to provide services for terminal users.
<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 next-server 192.168.1.2
# Specify the server IP address 192.168.1.2 in the interface address pool on GE0/0/1 used to provide services for terminal users.
<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 next-server 192.168.1.2
Related Topics

dhcp server option

Function

The dhcp server option command sets user-defined option for an interface address pool.

The undo dhcp server option command deletes user-defined option from an interface address pool.

By default, no user-defined option is configured in an interface address pool.

Format

dhcp server option code [ sub-option sub-code ] { ascii ascii-string | hex hex-string | cipher cipher-string | ip-address ip-address &<1-8> }

undo dhcp server option [ code [ sub-option sub-code ] ]

Parameters

Parameter

Description

Value

code

Specifies the code for a user-defined option.

The value is an integer that ranges from 1 to 254, except values 1, 3, 6, 15, 44, 46, 50, 51, 52, 53, 54, 55, 57, 58, 59, 61, 82, 120, 121 and 184.
NOTE:
  • The format of option82, Option121 and Option184 are different from the other codes of a customized option.
  • There are well-known options and customized options. For details about well-known options, see RFC 2132.

sub-option sub-code

Specifies the code of a user-defined sub-option.

The value is an integer that ranges from 1 to 254. For details about well-known options, see RFC 2132.

ascii ascii-string

Specifies the user-defined option code as an ASCII character string.

The value is a string of 1 to 255 characters when sub-option is not specified, or a string of 1 to 253 characters when sub-option is specified.

hex hex-string

Specifies the user-defined option code as a hexadecimal string.

The value is a hexadecimal string with an even number of digits, for example, hh or hhhh. If sub-option is not specified, the even number is in the range of 2 to 254. If sub-option is specified, the even number is in the range of 2 to 252. The value can be a combination of digits (0-9) and letters (A-F and a-f).

cipher cipher-string

Specifies the user-defined option code as a ciphertext character string.

The value is a string, you can enter a character string in explicit text or cipher text.

  • The character string in explicit text is a string of 1 to 64 characters.
  • The character string in cipher text is a string of 32 to 104 characters.

No matter whether the character string is entered in explicit or cipher text, the character string is displayed in cipher text in the configuration file and in explicit text in packets.

ip-address ip-address

Specifies the user-defined option code as an IP address.

The value is in dotted decimal notation.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP servers. The Option field in a DHCP packet carries control information and parameters, including basic information such as the DNS service, NetBIOS service, and IP address lease. If a DHCP server is configured with option, when a DHCP client applies for an IP address from an interface address pool, the client can obtain configurations in the Option field of the DHCP response packet from the DHCP server without having to configure the DNS service, NetBIOS service, or IP address lease separately.

Prerequisites
  • The address of an interface address pool has been configured using the ip address command.

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

Precautions

  • When the password is contained in option, the ascii or hex type is insecure. Set the option type to cipher. A secure password should contain at least two types of the following: lowercase letters, uppercase letters, number, and special characters. In addition, the password must consist of six or more than six characters.
  • The dhcp server option command configures basic functions, such as the NetBIOS service and IP address lease. The system also provides commands to configure these functions separately. These commands take precedence over the dhcp server option command.
  • To set user-defined option for a global address pool, run the option command.

Example

# Set Option64 to 0x11 (a hexadecimal number) for the interface address pool on VLANIF100.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ip address 10.10.10.10 24 
[HUAWEI-Vlanif100] dhcp select interface
[HUAWEI-Vlanif100] dhcp server option 64 hex 11
# Set Option64 to 0x11 (a hexadecimal number) for the interface address pool on GE0/0/1.
<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.10.10.10 24 
[HUAWEI-GigabitEthernet0/0/1] dhcp select interface
[HUAWEI-GigabitEthernet0/0/1] dhcp server option 64 hex 11

dhcp server option121

Function

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.

Format

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 ]

Parameters

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.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

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.

Precautions

  • To configure multiple classless static routes, run the dhcp server option121 ip-address command repeatedly.

  • The undo dhcp server option121 command will delete all classless static routes. To delete one classless static route, run the undo dhcp server option121 ip-address ip-address mask-length gateway-address command.

Example

# Configure a classless static route allocated by a DHCP server to a client in the interface address pool on VLANIF100.
<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
# Configure a classless static route allocated by a DHCP server to a client in the interface address pool on GE0/0/1.
<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

dhcp server option184

Function

The dhcp server option184 command configures Option 184 allocated by a DHCP server to a client.

The undo dhcp server option184 command deletes Option 184 allocated by a DHCP server to a client.

By default, Option 184 allocated by a DHCP server to a client is not configured.

Format

dhcp server option184 { as-ip ip-address | fail-over ip-address dialer-string | ncp-ip ip-address | voice-vlan vlan-id }

undo dhcp server option184 [ as-ip | fail-over | ncp-ip | voice-vlan ]

Parameters

Parameter

Description

Value
ncp-ip ip-address Specifies the IP address of the network call processor (NCP). The value is in dotted decimal notation.
as-ip ip-address Specifies the IP address of the backup NCP. The value is in dotted decimal notation.
fail-over ip-address Specifies the IP address in the failover route. The value is in dotted decimal notation.
dialer-string Specifies the dialer string. The value is a string of 1 to 64 characters.
voice-vlan vlan-id Specifies the ID of a voice VLAN. The value is an integer that ranges from 1 to 4094.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

The dhcp server option184 command applies to only the DHCP server and configures Option 184 allocated by a DHCP server to a client in an interface address pool.

Example

# Configure Option 184 allocated by a DHCP server to a client in the interface address pool on VLANIF100.
<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 option184 as-ip 10.10.10.10
# Configure Option 184 allocated by a DHCP server to a client in the interface address pool on GE0/0/1.
<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 option184 as-ip 10.10.10.10

dhcp server ping

Function

The dhcp server ping command sets the maximum number of ping packets to be sent and the maximum response time of a ping packet.

The undo dhcp server ping command restores the default setting.

By default, the DHCP server sends 2 ping packets and the maximum response time is 500 ms.

Format

dhcp server ping { packet number | timeout milliseconds } *

undo dhcp server ping { packet | timeout }

Parameters

Parameter Description Value
packet number Specifies the maximum number of ping packets to be sent. The value is an integer ranging from 0 to 10. The value 0 indicates that no ping operation is performed.
timeout milliseconds Specifies the maximum response time of a ping packet. The value is an integer that ranges from 0 to 10000, in milliseconds. The value 0 indicates that no ping operation is performed.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP servers. Repetitive IP address assignment will cause IP address conflicts. To solve this problem, before assigning an IP address to a client, the DHCP server needs to send ping packets using the dhcp server ping command to check whether the IP address is in use. Address detection checks whether the DHCP server receives any response within a certain period of time. If there is no response within a certain period of time, the DHCP server continues to send ping packets to this address until the number of ping packets reaches the maximum value. If there is still no response, it indicates that the IP address is not in use. This ensures that the IP address assigned to the client is unique.

Prerequisites

DHCP has been enabled using the dhcp enable command.

Example

# Set the maximum number of ping packets to 3 and the maximum response time to 400 ms.

<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp server ping packet 3
[HUAWEI] dhcp server ping timeout 400
Related Topics

dhcp server sip-server

Function

The dhcp server sip-server command configures the SIP server IP address assigned to a DHCP client on an interface address pool.

The undo dhcp server sip-server command deletes the configured SIP server IP address assigned to a DHCP client on an interface address pool.

By default, the SIP server IP address assigned to a DHCP client on an interface address pool is not configured..

Format

dhcp server sip-server { ip-address ip-address &<1-2> | list domain-name &<1-2> }

undo dhcp server sip-server

Parameters

Parameter Description Value
ip-address ip-address

Specifies an IP address for the SIP server.

The value is in dotted decimal notation.
list domain-name

Specifies the domain name of the SIP server.

The value is a string of 1 to 63 characters.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to the DHCP server. To enable DHCP clients to normally access the Internet, the DHCP server needs to specify the SIP server IP address in the interface address pool when assigning IP addresses to the clients.

Precautions

  • A maximum of two SIP server addresses can be configured in each address pool. The first assigned address functions as the primary address, and the other address functions as a secondary address.
  • Before specifying the IP address or name for a SIP server, ensure that the SIP server exists.
  • If you run this command repeatedly, the latest configuration overrides the previous ones.

Example

# Specify 10.1.1.1 as the IP address of the SIP server when addresses in the interface VLANIF100 address pool are assigned to clients.

<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 sip-server ip-address 10.1.1.1
# Specify 10.1.1.1 as the IP address of the SIP server when addresses in the interface GE0/0/1 address pool are assigned to 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 10.1.1.1 24 
[HUAWEI-GigabitEthernet0/0/1] dhcp select interface
[HUAWEI-GigabitEthernet0/0/1] dhcp server sip-server ip-address 10.1.1.1

dhcp server sname

Function

The dhcp server sname command configures the name of the server where the DHCP client obtains the startup configuration file.

The undo dhcp server sname command deletes the configured name of the server where the DHCP client obtains the startup configuration file.

By default, the name of the server where the DHCP client obtains the startup configuration file is not configured.

Format

dhcp server sname sname

undo dhcp server sname

Parameters

Parameter

Description

Value

sname

Specifies the name of the server where the DHCP client obtains the startup configuration file.

The value is a string of 1 to 63 case-sensitive characters without spaces.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

Besides assigning IP addresses, a DHCP server can also provide the required network configuration parameters, such as the startup configuration file name for the DHCP clients. After the name of the server where the DHCP client obtains the startup configuration file is configured using the dhcp server sname command, the DHCP client obtains the startup configuration file from this server.

Prerequisites

  1. The DHCP function has been enabled using the dhcp enable command in the system view.

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

  3. The startup configuration file name has been configured for the DHCP client using the dhcp server bootfile.

Follow-up Procedures

Ensure that the route between the DHCP client and the file server where the DHCP client obtains the startup configuration file is reachable.

Example

# Configure the name of the server where the DHCP client obtains the startup configuration file as Huawei in the interface address pool on VLANIF100.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] vlan 100
[HUAWEI-vlan100] quit
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ip address 10.1.1.1 255.255.255.0
[HUAWEI-Vlanif100] dhcp select interface
[HUAWEI-Vlanif100] dhcp server bootfile start.ini
[HUAWEI-Vlanif100] dhcp server sname Huawei
# Configure the name of the server where the DHCP client obtains the startup configuration file as Huawei in the interface address pool on GE0/0/1.
<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 255.255.255.0
[HUAWEI-GigabitEthernet0/0/1] dhcp select interface
[HUAWEI-GigabitEthernet0/0/1] dhcp server bootfile start.ini
[HUAWEI-GigabitEthernet0/0/1] dhcp server sname Huawei

dhcp server static-bind

Function

The dhcp server static-bind command binds an IP address in an interface address pool to a MAC address.

The undo dhcp server static-bind command unbinds the IP address in an interface address pool from a MAC address.

By default, an IP address in an interface address pool is not bound to any MAC address.

Format

dhcp server static-bind ip-address ip-address mac-address mac-address [ description description ]

undo dhcp server static-bind [ ip-address ip-address | mac-address mac-address ]

Parameters

Parameter

Description

Value

ip-address ip-address

Specifies the IP address to be bound. The IP address must be valid in an interface address pool.

The value is in dotted decimal notation.

mac-address mac-address

Specifies the user MAC address.

The value is in H-H-H format. An H is a hexadecimal number of 1 to 4 digits.

description description

Specifies the user description.

The value is a string of 1 to 256 case-sensitive characters. It can contain spaces.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The dhcp server static-bind command applies to DHCP servers. When planning a network, you need to allocate fixed IP addresses to some important hosts to ensure reliability. In this case, you can bind IP addresses in the address pool to the MAC addresses of these hosts. After the preceding configuration is complete, if the host of the MAC address to which the IP address is bound request an IP address from the DHCP server, the DHCP server finds the bound IP address based on the host's MAC address and allocates this IP address to the host, ensuring that the IP address obtained by the host is fixed.

You can run the dhcp server static-bind command to bind an IP address in an interface address pool to a MAC address.

You can run the static-bind command to bind an IP address in a global address pool to a MAC address.

Prerequisites
  • The address of an interface address pool has been configured using the ip address command.

  • Enable the DHCP server function based on the interface address pool on the interface using the dhcp select interface command.

Precautions

  • Ensure that the bound IP address is not configured as the IP address that cannot be allocated using the dhcp server excluded-ip-address command and is not allocated by the DHCP server.
  • You can run the display ip pool command to view the used IP addresses in the current address pool and select an available IP address to be bound to the MAC address. To bind used IP addresses to MAC addresses, run the reset ip pool command to reclaim used IP addresses first.
  • The DHCP server preferentially allocates the IP address that has been statically bound to the client's MAC address.
  • After an IP address is bound to a MAC address, the IP address does not expire; the binding between the IP and MAC addresses cannot be deleted when the IP address is in use.

Example

# Configure a DHCP server to assign a fixed IP address 10.10.10.20 in the interface address pool on vlanif 100 to a host with the MAC address 2020-e2f3-2a3b.

<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ip address 10.10.10.10 24
[HUAWEI-Vlanif100] dhcp select interface
[HUAWEI-Vlanif100] dhcp server static-bind ip-address 10.10.10.20 mac-address 2020-e2f3-2a3b
# Configure a DHCP server to assign a fixed IP address 10.10.10.20 in the interface address pool on GE0/0/1 to a host with the MAC address 2020-e2f3-2a3b.
<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.10.10.10 24
[HUAWEI-GigabitEthernet0/0/1] dhcp select interface
[HUAWEI-GigabitEthernet0/0/1] dhcp server static-bind ip-address 10.10.10.20 mac-address 2020-e2f3-2a3b

dhcp server trust option82

Function

The dhcp server trust option82 command enables Option 82 on the DHCP server.

The undo dhcp server trust option82 command disables Option 82 on the DHCP server.

By default, the DHCP server trusts Option 82.

Format

dhcp server trust option82

undo dhcp server trust option82

Parameters

None

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command is used on the DHCP server to enable the Option 82 function. After receiving a DHCP packet that carries the Option 82 field but the giaddr is 0, the DHCP server processes the packet by default. Using the undo dhcp server trust option82 command, the DHCP server discards the packet.

Prerequisites

DHCP has been enabled globally by using the dhcp enable command.

Example

# Enable Option 82 of the DHCP server.

<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp server trust option82

dhcp-server

Function

The dhcp-server command adds DHCP servers to a DHCP server group.

The undo dhcp-server command deletes DHCP servers from a DHCP server group.

By default, no DHCP server is configured in a DHCP server group.

Format

dhcp-server ip-address [ ip-address-index ]

undo dhcp-server { ip-address | ip-address-index }

Parameters

Parameter

Description

Value

ip-address

Specifies the IP address of a DHCP server.

The value is in dotted decimal notation.

ip-address-index

When you specify the IP address for a DHCP server, you can specify ip-address-index for the IP address. If you do not specify the server index, the system assigns an idle index to the server.

The value is an integer that ranges from 0 to 19.

Views

DHCP server group view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The dhcp-server command applies to DHCP relay agents. To ensure that the DHCP relay agent can forward messages to multiple DHCP servers, configure multiple DHCP servers in a DHCP server group.

Precautions

  • Each DHCP server group can be configured with a maximum of twenty DHCP servers. You can delete a DHCP server by specifying ip-address-index.
  • If a VPN instance is bound to an interface, the DHCP server group must be bound to this VPN instance.

Example

# Add the DHCP server at 10.10.78.56 to a DHCP server group dhcp-srv1.

<HUAWEI> system-view
[HUAWEI] dhcp server group dhcp-srv1
[HUAWEI-dhcp-server-group-dhcp-srv1] dhcp-server 10.10.78.56

dhcp set ttl

Function

The dhcp set ttl command sets the TTL value for DHCP Discover messages after they are forwarded by the DHCP relay agent at Layer 3.

The undo dhcp set ttl command restores the default setting.

By default, the TTL value of DHCP Discovery messages decreases by 1 after they are forwarded by the DHCP relay agent at Layer 3.

Format

dhcp set ttl { unvaried | ttl-value }

undo dhcp set ttl

Parameters

Parameter Description Value
unvaried Indicates that the TTL value of DHCP Discovery messages remains unchanged after the messages are forwarded by the DHCP relay agent at Layer 3. That is, the device does not reduce the TTL value by 1. -
ttl-value Specifies a fixed TTL value for DHCP Discovery messages after they are forwarded by the DHCP relay agent at Layer 3. The value is an integer that ranges from 1 to 255.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The dhcp set ttl command is used on DHCP relay agents. When a DHCP relay agent forwards DHCP Discovery messages at Layer 3, it reduces the TTL value of the messages by 1 by default. Assume that the TTL value of a DHCP Discovery message received by the DHCP relay agent is 1. If the DHCP relay agent reduces the TTL value by 1, the TTL value changes to 0. The next-hop routing device will discard the message as its TTL value is 0. As a result, the DHCP server cannot receive the DHCP Discovery message forwarded by the DHCP relay agent. To ensure that the DHCP server can receive the DHCP Discovery message sent from the client, run the dhcp set ttl command to set the TTL value of the DHCP Discovery message to a non-zero value after the message is forwarded at Layer 3.

NOTE:
If the DHCP relay agent connects to a special client whose TTL value of DHCP Discovery messages is 1, and if there are routing devices between the DHCP relay agent and DHCP server, run the dhcp set ttl ttl-value command to specify a fixed TTL value (16 is recommended) for DHCP Discovery messages after they are forwarded by the DHCP relay agent at Layer 3.

Prerequisites

The DHCP function has been enabled globally using the dhcp enable command.

Example

# Set the TTL value of DHCP Discovery messages to 16 after the messages are forwarded by the DHCP relay agent at Layer 3.

<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp set ttl 16

dhcp speed-limit auto

Function

The dhcp speed-limit auto command enables dynamic rate limiting on DHCP packets.

The undo dhcp speed-limit auto command disables dynamic rate limiting on DHCP packets.

By default, dynamic rate limiting is disabled on DHCP packets.

Format

dhcp speed-limit auto

undo dhcp speed-limit auto

Parameters

None

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

To ensure security or facilitate management, users may require that the DHCP packet processing rate should be limited. If the rate is not limited, CPU and memory resources can be used up due to malicious attacks.

Table 6-18 and Table 6-19 list the mapping between the DHCP packet rate and CPU/memory usage after dynamic rate limiting on DHCP packets is enabled.
Table 6-18  DHCP packet rate and CPU usage

CPU Usage (%)

DHCP Packet Rate (packets/second)

(70–85)

100

[85–100)

50

100

10

Table 6-19  DHCP packet rate and memory usage

Memory Usage (%)

DHCP Packet Rate (packets/second)

(65–75)

100

[75–85)

50

[85–100)

10

Prerequisites

DHCP has been enabled globally by using the dhcp enable command.

Precautions

  • When the CPU usage is higher than 70% or the memory usage is higher than 65%, the DHCP packet processing rate is limited.
  • The DHCP packet processing rate is the same as the smaller rate among the rates corresponding to the CPU or memory usage. For example, when the CPU usage is 80% and the memory usage is 80%, the DHCP packet rate is 50.

Example

# Enable dynamic rate limiting on DHCP packets.

<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp speed-limit auto

display dhcp client

Function

The display dhcp client command displays DHCP/BOOTP client lease information.

Format

display dhcp client [ interface interface-type interface-number ]

Parameters

Parameter

Description

Value

interface interface-type interface-number

Displays DHCP/BOOTP client lease information on a specified interface:
  • interface-type specifies the interface type.
  • interface-number specifies the interface number.

-

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

When a device functions as the DHCP/BOOTP client, this command displays DHCP/BOOTP client lease information.

Example

# Display DHCP client lease information.

<HUAWEI> display dhcp client
DHCP client lease information on interface Vlanif119 :                           
 Current machine state         : Bound                                          
 Internet address assigned via : DHCP                                           
 Physical address              : 0819-a6cd-a896                                 
 IP address                    : 192.168.119.254                                
 Subnet mask                   : 255.255.255.0                                  
 Gateway ip address            : 192.168.119.1                                  
                                 192.168.119.3                                  
                                 192.168.119.2                                  
 DHCP server                   : 192.168.119.1                                  
 Lease obtained at             : 2008-10-01 04:35:10                            
 Lease expires at              : 2008-10-01 04:36:10                            
 Lease renews at               : 2008-10-01 04:35:40                            
 Lease rebinds at              : 2008-10-01 04:36:03                            
 Classless static route        : 192.168.0.0/16 via 192.168.119.1               
                                 10.10.0.0/16 via 192.168.119.2       
Table 6-20  Description of the display dhcp client command output

Item

Description

DHCP client lease information on interface if1 DHCP client lease information on the interface if1.

Current machine state

Current device status.

Internet address assigned via

IP address obtained using DHCP or BOOTP.

Physical address

Device MAC address.

IP address

Device IP address.

Subnet mask

Mask of the device IP address.

Gateway ip address

Gateway address of the DHCP or BOOTP server.

DHCP server

DHCP server address (no value for a BOOTP client).

Lease obtained at

Time the lease is obtained.

Lease expires at

Time the lease expires (no value for a BOOTP client).

Lease renews at

Time the lease needs to be renewed (no value for a BOOTP client). The lease of an IP address needs to be renewed when half of the lease expires.

Lease rebinds at

Time the lease is renewed (no value for a BOOTP client). The lease of an IP address is renewed when 87.5% of the lease expires.

Classless static route

Classless static route.

display dhcp client statistics

Function

The display dhcp client statistics command displays message statistics on a DHCP/BOOTP client.

Format

display dhcp client statistics [ interface interface-type interface-number ]

Parameters

Parameter

Description

Value

interface interface-type interface-number

Displays message statistics on a specified interface:
  • interface-type specifies the interface type.
  • interface-number specifies the interface number.

-

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

When the device functions as the DHCP client, the display dhcp client statistics command displays message statistics.

Example

# Display message statistics on a DHCP/BOOTP client.

<HUAWEI> display dhcp client statistics
DHCP message statistics on interface GigabitEthernet0/0/1GigabitEthernet0/0/1 :                     
Input: total 0 packets                                                          
  Bootp reply             :          0                                          
  Offer                   :          0                                          
  Ack                     :          0                                          
  Nak                     :          0                                          
Output: total 0 packets                                                         
  Bootp request           :          0                                          
  Discover                :          0                                          
  Request                 :          0                                          
    Request of init-reboot:          0                                          
    Request of selecting  :          0                                          
    Request of renewing   :          0                                          
    Request of rebinding  :          0                                          
  Decline                 :          0                                          
  Release                 :          0 
Table 6-21  Description of the display dhcp client statistics command output

Item

Description

Input

Total number of DHCP messages received by the client.

Bootp reply

Number of BOOTP replies received by the client from the server.

Offer

Number of Offer messages received by the client from the server.

Ack

Number of ACK messages received by the client from the server.

Nak

Number of NAK messages received by the client from the server.

Output

Total number of messages forwarded by the client.

Bootp request

Number of BOOTP requests received by the server from the client.

Discover

Number of Discover messages received by the server from the client.

Request

Number of Request messages received by the server from the client.

Request of init-reboot

Number of Request of init-reboot messages received by the server from the client.

Request of selecting

Number of Request of selecting messages received by the server from the client.

Request of renewing

Number of Request of renewing messages received by the server from the client.

Request of rebinding

Number of Request of rebinding messages received by the server from the client.

Decline

Number of Decline messages received by the server from the client.

Release

Number of Release messages received by the server from the client.

display dhcp option template

Function

The display dhcp option template command displays the configuration of a DHCP Option template.

Format

display dhcp option template [ name template-name ]

Parameters

Parameter

Description

Value

name template-name

Displays the configuration of a specified DHCP Option template.

The template must be an existing DHCP Option template.

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

After configuring a DHCP Option template, you can run the display dhcp option template command to view the configuration of the DHCP Option template, including the template name, number, IP address of a server configured for the client after the client automatically obtains the IP address, domain name, and values of customized options.

Example

# Display the configuration of the DHCP Option template named test.

<HUAWEI> display dhcp option template name test
 -----------------------------------------------------------------------------  
  Template-Name  : test                                                    
  Template-No    : 1                                                            
  Next-server    : 192.168.1.5                                                     
  Domain-name    : huawei.com                                                   
  DNS-server0    : 192.168.2.7                                                     
  DNS-server1    : 192.168.2.8                                                     
  NBNS-server0   : 192.168.1.7                                                     
  NBNS-server1   : 192.168.1.8                                                     
  Netbios-type   : b-node                                                       
  Gateway-0      : 192.168.1.10                                                    
                                                                                

# Display the configurations of all DHCP Option templates.

<HUAWEI> display dhcp option template
 -----------------------------------------------------------------------------  
  Template-Name  : template1                                                    
  Template-No    : 0                                                            
  Next-server    : 10.1.1.4                                                     
  Domain-name    : -                                                            
  DNS-server0    : -                                                            
  NBNS-server0   : -                                                            
  Netbios-type   : -                                                            
  Gateway-0      : -                                                            
                                                                                
 -----------------------------------------------------------------------------  
  Template-Name  : template2                                                    
  Template-No    : 1                                                            
  Next-server    : 192.168.1.5                                                     
  Domain-name    : huawei.com                                                   
  Option-code      : 64                                                         
    Option-subcode : 3                                                          
      Option-type  : hex                                                        
      Option-value : 11                                                         
  DNS-server0    : 192.168.2.7         
  DNS-server1    : 192.168.2.8                                                     
  NBNS-server0   : 192.168.2.7                                                     
  NBNS-server1   : 192.168.2.8                                                     
  Netbios-type   : b-node                                                       
  Gateway-0      : 192.168.1.10                                                    
                                                                                
Table 6-22  Description of the display dhcp option template command output

Item

Description

Template-Name

Name of the DHCP Option template.

To specify the parameter, run the dhcp option template command.

Template-No

Index value of the DHCP Option template.

Next-server

IP address of a server configured for the client after the client automatically obtains the IP address.

To specify the parameter, run the next-server command in the DHCP Option template view.

Domain-name

Name of a domain.

To specify the parameter, run the domain-name command in the DHCP Option template view.

Option-code Code for a customized option.

To specify the parameter, run the option command in the DHCP Option template view.

Option-subcode Code for a customized sub-option.

To specify the parameter, run the option command in the DHCP Option template view.

Option-type Character string type for a customized option.

To specify the parameter, run the option command in the DHCP Option template view.

Option-value Character string value for a customized option.

To specify the parameter, run the option command in the DHCP Option template view.

DNS-server0

Address of the DNS server. Currently, a maximum of eight DNS server addresses can be configured. Values 0 and 1 indicate the first and second DNS server addresses respectively.

To specify the parameter, run the dns-list command in the DHCP Option template view.

NBNS-server0

Address of the NetBIOS server. Currently, a maximum of eight NetBIOS server addresses can be configured in a DHCP Option template. Values 0 and 1 indicate the first and second NetBIOS server addresses respectively.

To specify the parameter, run the nbns-list command in the DHCP Option template view.

Netbios-type

NetBIOS node type.

To specify the parameter, run the netbios-type command in the DHCP Option template view.

Gateway-0

Gateway address. Currently, a maximum of eight gateway addresses can be configured. The value 0 indicates the first gateway address.

To specify the parameter, run the gateway-list command in the DHCP Option template view.

Related Topics

display dhcp relay

Function

The display dhcp relay command displays configuration information about a DHCP relay agent.

Format

display dhcp relay { all | interface interface-type interface-number }

Parameters

Parameter

Description

Value

all

Displays configuration information about DHCP relay agents configured on all interfaces.

-

interface interface-type interface-number

Displays configuration information about a DHCP relay agent configured on a specified interface.
  • interface-type specifies the interface type.
  • interface-number specifies the interface number.

-

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

You can run this command to check configuration information about DHCP relay agents configured on interfaces.

Example

# Display configuration information about DHCP relay agents on all interfaces.

<HUAWEI> display dhcp relay all
 DHCP relay agent running information of interface Vlanif5 :
 Server group name      : group1
 Gateway address in use : 10.100.100.1                      

 DHCP relay agent running information of interface Vlanif100 :
 Server IP address [00] : 10.2.2.3
 Gateway address in use : 10.2.2.2
Table 6-23  Description of the display dhcp relay all command output

Item

Description

DHCP relay agent running information of interface if

DHCP relay agent configuration of the if interface.

Server group name

Group name of the DHCP Server.

To specify the parameter, run the dhcp relay server-select command.

Server IP address [x]

IP address of a DHCP server in the DHCP server group. The value x is the index of a DHCP server.

To specify the parameter, run the dhcp-server command.

Gateway address in use

IP address of the DHCP gateway.

To specify the parameter, run the gateway (DHCP server group view) command.

display dhcp relay statistics

Function

The display dhcp relay statistics command displays message statistics on a DHCP relay agent.

Format

display dhcp relay statistics [ server-group group-name ]

Parameters

Parameter

Description

Value

server-group group-name

Displays message statistics on DHCP relay agents connected to DHCP servers in a specified DHCP server group.

If this parameter is not specified, message statistics on DHCP relay agents connected to all DHCP servers are displayed.

The value must be an existing DHCP server group on the device.

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

Usage Scenario

Run the display dhcp relay statistics command to check whether the client is correctly configured or the network is connected.

  • Run the display dhcp relay statistics server-group group-name command to check message statistics on DHCP relay agents connected to DHCP servers in a specified DHCP server group. The DHCP server group name needs to be specified.
  • Run the display dhcp relay statistics command to check message statistics on all DHCP relay agents besides DHCP relay agents connected to DHCP servers in the DHCP server group.

Follow-up Procedure

After detecting incorrect message statistics on a DHCP relay agent, run the reset dhcp relay statistics [ server-group group-name ] command to clear message statistics on the DHCP relay agent.

Example

# Display message statistics on a DHCP relay agent.

<HUAWEI> display dhcp relay statistics
  The statistics of DHCP RELAY:
    DHCP packets received from clients         : 0
        DHCP DISCOVER packets received         : 0
        DHCP REQUEST packets received          : 0
        DHCP RELEASE packets received          : 0
        DHCP INFORM packets received           : 0
        DHCP DECLINE packets received          : 0
    DHCP packets sent to clients               : 0
        Unicast packets sent to clients        : 0
        Broadcast packets sent to clients      : 0
    DHCP packets received from servers         : 0
        DHCP OFFER packets received            : 0
        DHCP ACK packets received              : 0
        DHCP NAK packets received              : 0
    DHCP packets sent to servers               : 0
    DHCP Bad packets received                  : 0
Table 6-24  Description of the display dhcp relay statistics command output

Item

Description

DHCP packets received from clients

DHCP messages received from clients.

DHCP DISCOVER packets received

DHCP Discover messages received from clients.

DHCP REQUEST packets received

DHCP Request messages received from clients.

DHCP RELEASE packets received

DHCP Release messages received from clients.

DHCP INFORM packets received

DHCP Inform messages received from clients.

DHCP DECLINE packets received

DHCP Decline messages received from clients.

DHCP packets sent to clients

DHCP messages sent to clients.

Unicast packets sent to clients

Unicast packets sent to clients.

Broadcast packets sent to clients

Broadcast packets sent to clients.

DHCP packets received from servers

DHCP messages received from servers.

DHCP OFFER packets received

DHCP Offer messages received from servers.

DHCP ACK packets received

DHCP ACK messages received from servers.

DHCP NAK packets received

DHCP NAK messages received from servers.

DHCP packets sent to servers

DHCP messages sent to servers.

DHCP Bad packets received

DHCP error messages received.

display dhcp server database

Function

The display dhcp server database command displays information about the DHCP database.

Format

display dhcp server database

Parameters

None

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

Usage Scenario

The display dhcp server database command displays the storage path and file name of DHCP data on a DHCP server. This information helps to check:
  • Whether the function that saves DHCP data to the storage device is enabled. If this function is not enabled, run the dhcp server database command to enable it.
  • Whether the interval at which DHCP data is saved is proper.
  • Whether the function that recovers DHCP data from the storage device after the system restarts is enabled.

Precautions

The function that saves DHCP data to storage devices and the function that recovers DHCP data from storage devices can be enabled in any sequence.

Example

# Display information about the DHCP database.

<HUAWEI> display dhcp server database
 Status: disable
 Recover from files after reboot: disable
 File saving lease items: flash:/dhcp/lease.txt
 File saving conflict items: flash:/dhcp/conflict.txt
 Save Interval: 300 (seconds)
Table 6-25  Description of the display dhcp server database command output

Item

Description

Status

Whether to save the data to the storage device:
  • disable
  • enable

The value is set using the dhcp server database command.

Recover from files after reboot

Whether to recover data from the file on the storage device after the system restarts:
  • disable
  • enable

The value is set using the dhcp server database command.

File saving lease items

File name and path of the file for storing address lease information.

File saving conflict items

File name and path of the file for storing address conflict information.

Save Interval

Interval at which DHCP data is saved, in seconds.

The value is set using the dhcp server database command.

display dhcp server group

Function

The display dhcp server group command displays the configuration of a DHCP server group.

Format

display dhcp server group [ group-name ]

Parameters

Parameter

Description

Value

group-name

Displays the configuration of a specified DHCP server group.

The value must be an existing DHCP server group on the device.

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

Usage Scenario

This command applies to DHCP relay agents. The display dhcp server group command displays information about all the DHCP server groups of a DHCP relay agent and the number of DHCP servers in the DHCP server groups. If group-name is specified, the display dhcp server group group-name command displays DHCP server addresses and the number of DHCP servers in a specified DHCP server group.

Prerequisites

A DHCP server group has been created on a DHCP relay agent using the dhcp server group command.

Example

# Display the configuration of the DHCP server group myServers.

<HUAWEI> display dhcp server group myServers
  Group-name          : myServers                                               
    (0)  Server-IP    : 10.1.1.1 
    Gateway           : 10.10.10.1
    VPN instance      : --   
Table 6-26  Description of the display dhcp server group command output

Item

Description

Group-name

Name of a DHCP server group.

To specify the parameter, run the dhcp server group command.

(x) Server-IP

IP addresses of DHCP servers in a DHCP server group. x is the index of the IP addresses and ranges from 0 to 19.

To specify the parameter, run the dhcp-server command.

Gateway

Gateway address of the DHCP server in the DHCP server group.

To specify the parameter, run the gateway (DHCP server group view) command.

VPN instance

VPN instance to which the DHCP server group belongs.

To specify the parameter, run the vpn-instance (DHCP server group view) command.

display dhcp server statistics

Function

The display dhcp server statistics command displays statistics on a DHCP server.

Format

display dhcp server statistics

Parameters

None

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

Usage Scenario

You can run the display dhcp server statistics command to check whether the client is correctly configured or the network is connected.

Follow-up Procedure

After detecting incorrect message statistics on a DHCP server, run the reset dhcp server statistics command to clear message statistics on the DHCP server.

Example

# Display statistics on the DHCP server.

<HUAWEI> display dhcp server statistics
 DHCP Server Statistics: 
 
 Client Request:             6 
  Dhcp Discover:             1 
  Dhcp Request:              4 
  Dhcp Decline:              0 
  Dhcp Release:              1 
  Dhcp Inform:               0 
 Server Reply:               4 
  Dhcp Offer:                1 
  Dhcp Ack:                  3 
  Dhcp Nak:                  0 
 Bad Messages:               0 
 
Table 6-27  Description of the display dhcp server statistics command output

Item

Description

DHCP Server Statistics

Statistics on the DHCP server.

Client Request

Number of DHCP messages sent from the DHCP client to the DHCP server.

Dhcp Discover, Dhcp Request, Dhcp Decline, Dhcp Release, Dhcp Inform

Numbers of different types of DHCP messages sent from the DHCP client to the DHCP server.

Server Reply

Number of DHCP messages sent from the DHCP server to the DHCP client.

Dhcp Offer, Dhcp Ack, Dhcp Nak

Numbers of different types of DHCP messages sent from the DHCP server to the DHCP client.

Bad Messages

Number of unknown messages.

display dhcp statistics

Function

The display dhcp statistics command displays DHCP message statistics.

Format

display dhcp statistics

Parameters

None

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

The display dhcp statistics command displays statistics about sent and received DHCP messages.

Example

# Display DHCP message statistics.

<HUAWEI> display dhcp statistics
Input: total 172 packets, discarded 0 packets                                   
  Bootp request           :          0,  Bootp reply             :          0   
  Discover                :          0,  Offer                   :        172   
  Request                 :          0,  Ack                     :          0   
  Release                 :          0,  Nak                     :          0   
  Decline                 :          0,  Inform                  :          0   
                                                                                
Output: total 172 packets, discarded 0 packets                                  
Table 6-28  Description of the display dhcp statistics command output

Item

Description

Bootp request

Number of BOOTP requests sent by the device that functions as the client.

Bootp reply

Number of BOOTP replies received by the client from the server.

Discover

Number of Discover messages received by the server from the client.

Offer

Number of Offer messages received by the client from the server.

Request

Number of BOOTP requests received by the server from the client.

Ack

Number of ACK messages received by the client from the server.

Release

Number of Release messages received by the server from the client.

Nak

Number of NAK messages received by the client from the server.

Decline

Number of Decline messages sent by the client.

Inform

Number of Inform messages sent by the client.

display ip pool

Function

The display ip pool command displays the configurations of an address pool.

Format

display ip pool

display ip pool interface interface-pool-name [ start-ip-address [ end-ip-address ] | all | conflict | expired | used ]

display ip pool name ip-pool-name [ start-ip-address [ end-ip-address ] | all | conflict | expired | used [ user-type { dhcp | pppoe | l2tp | ipsec | ssl-vpn | ppp } ] ]

display ip pool vpn-instance vpn-instance-name

display ip pool global interface interface-type interface-number

NOTE:

Only the S1720GW, S1720GW-E, S1720GWR, S1720GWR-E, S1720X, S1720X-E, S2720EI, S5720EI, S5720HI, S5720LI, S5720S-LI, S5720S-SI, S5720SI, S5730S-EI, S5730SI, S6720EI, S6720LI, S6720S-EI, S6720S-LI, S6720SI, and S6720S-SI support vpn-instance vpn-instance-name.

Parameters

Parameter Description Value
interface interface-pool-name Displays the configuration of the specified interface address pool.
NOTE:

An interface address pool is specified using the type and number of an interface without spaces between them.

The interface address pool must exist on the device.
name ip-pool-name Displays the configuration of the specified global address pool. The global address pool must exist on the device.
start-ip-address [ end-ip-address ]

Displays the IP addresses within the range specified by the start IP address in the address pool.

If end-ip-address is set, the end IP address is also specified.

The value is in dotted decimal notation.
all Displays all IP addresses in the address pool. -
conflict

Displays the conflicting IP addresses in the address pool. (If an IP address that the DHCP server prepares to allocate to a user exists on the network, the IP address will be added to the conflict list. This problem occurs when a static IP address is configured or an active/standby switchover occurs in a VRRP group if the range of IP addresses in the address pools on the master and backup devices overlap.)

-
expired Displays the expired and idle IP addresses in the address pool. -
used [ user-type { dhcp | pppoe | l2tp | ipsec | ssl-vpn | ppp } ]
Display the IP addresses used in the address pool by the specific type of users.
  • Select dhcp, to specify the users who obtain IP addresses by DHCP.
  • Select pppoe, to specify the users who obtain IP addresses by PPPoE dial-up.
  • Select l2tp, to specify the L2TP users.
  • Select ipsec, to specify the IPSec users.
  • Select ssl-vpn, to specify the SSL VPN users.
  • Select ppp, to specify the PPP users.
-
vpn-instance vpn-instance-name

Displays information about the address pool in a specified VPN instance.

The value must be an existing VPN instance name.

global interface interface-type interface-number
Displays information about the address pool on a specified interface.
  • interface-type specifies the interface type.
  • interface-number specifies the interface number.
-

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

You can run the display ip pool command to view information about a configured address pool and IP addresses in the address pool, including the address pool name, lease, lock status, and status of IP addresses in the address pool.

Example

# Display information about conflicting IP addresses in the address pool huawei.

<HUAWEI> display ip pool name huawei conflict                                               
  Pool-name        : huawei                                                        
  Pool-No          : 1                                                          
  Lease            : 1 Days 0 Hours 0 Minutes                                   
  Domain-name      : -                                                          
  Option-code      : 60                                                         
    Option-subcode : --                                                         
    Option-type    : cipher                                                     
    Option-value   : %^%#5g)NPN1M,$M;pQ-lT\P>Al6QN4#ldIVVjD69XlCN%^%#           
  DNS-server0      : -                                                          
  NBNS-server0     : -                                                          
  Netbios-type     : -                                                          
  Position         : Local           
  Status           : Unlocked              
  Gateway-0        : -                                                          
  Network          : 192.168.0.0                                                   
  Mask             : 255.255.255.0                                              
  VPN instance     : --                                                         
  Bootfile         : 43534                                                      
  Logging          : Enable                                                     
  Conflicted address recycle interval: 1 Days 0 Hours 0 Minutes                 
  Address Statistic: Total       :254       Used        :1                      
                     Idle        :252       Expired     :2                       
                     Conflict    :1         Disabled    :0                      
                                                                                
 -------------------------------------------------------------------------------
  Network section                                                               
         Start           End       Total    Used Idle(Expired) Conflict Disabled
 -------------------------------------------------------------------------------
     192.168.0.1   192.168.0.254     254       1        252(2)       1     0    
 -------------------------------------------------------------------------------
 Client-ID format as follows:                                                   
   DHCP  : mac-address                 PPPoE   : mac-address                    
   IPSec : user-id/portnumber/vrf      PPP     : interface index                
   L2TP  : cpu-slot/session-id         SSL-VPN : user-id/session-id             
 -------------------------------------------------------------------------------
  Index              IP             Client-ID    Type       Left   Status       
 -------------------------------------------------------------------------------
    109   192.168.0.110                     -       -          -   Conflict     
 -------------------------------------------------------------------------------
Table 6-29  Description of the display ip pool command output

Item

Description

Pool-name

Name of an IP address pool.

To configure the IP address pool name, run the ip pool (system view) command.

Pool-No Index of the IP address pool.
Lease

Lease of the IP address pool.

To configure the lease of the IP address pool, run the lease command.

Domain-name

Name of a domain.

To configure the domain name, run the domain-name command.

Option-code

Value of a customized option.

To configure the value, run the option command.

Option-subcode

Value of a customized sub-option.

To configure the value, run the option command.

Option-type
Type of a customized option code:
  • ascii: indicates that the customized option code is an ASCII character string.
  • hex: indicates that the customized option code is a hexadecimal string.
  • cipher: indicates that the customized option code is a ciphertext character string.

To configure the type, run the option command.

Option-value

Content of a customized option.

To configure the content, run the option command.

DNS-server0

Address of the DNS server. Currently, an IP address pool can be configured with up to eight DNS servers. The value 0 indicates the first DNS server address and the value 1 indicates the second DNS server address.

To configure the DNS server address, run the dns-list command.

NBNS-server0

Address of the NetBIOS server. Currently, an address pool can be configured with up to eight NetBIOS server addresses. The value 0 indicates the first NetBIOS server address.

To configure the NetBIOS server address, run the nbns-list command.

Netbios-type

NetBIOS type.

To configure the NetBIOS type, run the netbios-type command.

Position Location of the IP address pool.
Status ( First )

Status of the address pool.

To configure the address pool status, run the lock (IP address pool view) command.

Gateway-0

Gateway address. Currently, a maximum of eight gateway addresses can be configured in an IP address pool. The value 0 indicates the first gateway address.

To configure the gateway address, run the gateway-list command.

Network Network segment of the address pool.
Mask

Subnet mask of the address pool.

To configure the subnet mask of the address pool, run the network (IP address pool view) command.

Bootfile

Name of the startup configuration file configured for the DHCP client.

To configure the name, run the bootfile command.

VPN instance

Name of a VPN instance.

NOTE:

Only the S1720GW, S1720GW-E, S1720GWR, S1720GWR-E, S1720X, S1720X-E, S2720EI, S5720EI, S5720HI, S5720LI, S5720S-LI, S5720S-SI, S5720SI, S5730S-EI, S5730SI, S6720EI, S6720LI, S6720S-EI, S6720S-LI, S6720SI, and S6720S-SI support this parameter.

Logging
Status of the logging function when the DHCP server allocates IP addresses.
  • Enable
  • Disable

To configure the status of the logging function, run the logging or dhcp server logging command.

Conflicted address recycle interval

The interval for the automatic reclaim of conflicting IP addresses in the address pool.

To configure the status of the logging function, run the conflict auto-recycle interval day day [ hour hour [ minute minute ] ] command.

Address Statistic Statistics about IP addresses in the address pool.
Start Start IP address of the IP address pool.
End End IP address of the IP address pool.
Total

Total number of IP addresses in the address pool.

Total = Used + Idle(Expired) + Conflict + Disable

Used Number of used IP addresses in the address pool.
Idle(Expired) Number of idle(expired) IP addresses in the address pool.
Conflict Number of conflicting IP addresses in the address pool.
NOTE:

If there are many conflicting IP addresses in the address pool, it is recommended that you configure the conflict auto-recycle interval command to reclaim conflicting IP addresses periodically. This configuration reduces occupation of idle IP addresses in the address pool and prevents IP address conflicts on the network.

Disabled Number of disabled IP addresses in the address pool.
Client-ID format as follows
Client ID format:
  • DHCP: mac-address. The client ID format of DHCP users is a MAC address.
  • PPPoE: mac-address. The client ID format of PPPoE users is a MAC address.
  • IPSec: user-id/portnumber/vrf. The client ID format of IPSec users is a user ID, port number, or VPN index.
  • PPP: interface index. The client ID format of PPP users is an interface index.
  • L2TP: cpu-slot/session-id. The client ID format of L2TP users is a CPU ID-slot ID or session ID.
  • SSL-VPN: user-id/session-id. The client ID format of SSL-VPN users is a user ID or session ID.
Index Index.
IP IP address.
Client-ID DHCP client ID.
Type DHCP client type. The types include DHCP, PPPoE, IPSec, PPP, L2TP, and SSL-VPN.
Left Remaining lease of an IP address.

When the result of the calculation formula ([Lease - Left]/Lease) is 50% or 87.5%, the DHCP client sends a DHCP Request message to the DHCP server to renew the lease. If the renewal succeeds, the value of the Left field is recounted. If the renewal fails, the DHCP client requests an IP address again and the status of its original IP address is set to Expired.

Status ( Second )

Status of an IP address:

  • Used: indicates that the IP address is used.
  • Idle: indicates that the IP address is idle.
  • Expired: indicates that the lease of the IP address expires and the IP address is idle.
  • Conflict: indicates that the IP address conflicts with another IP address on the network.
  • Disable: indicates that the IP address cannot be used.
  • Static-bind: indicates that the IP address is bound to a MAC address.
  • Static-bind used: indicates that the IP address is bound to a MAC address and used.

display snmp-agent trap feature-name dhcp all

Function

The display snmp-agent trap feature-name dhcp all command displays the status of all traps on the DHCP module.

Format

display snmp-agent trap feature-name dhcp all

Parameters

None

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

Usage Scenario

After enabling the trap function for the DHCP module, you can run this command to check the status of all traps on the DHCP module. To enable the trap function for the DHCP module, run the snmp-agent trap enable feature-name dhcp command.

Prerequisites

The SNMP function has been enabled on the device. For details, see snmp-agent.

Example

# Display the status of all traps on the DHCP module.

<HUAWEI>display snmp-agent trap feature-name dhcp all
------------------------------------------------------------------------------                                                      
Feature name: dhcp                                                                                                                  
Trap number : 14
------------------------------------------------------------------------------                                                      
Trap name                       Default switch status   Current switch status                                                       
hwNomatchSnpBindTblDhcpPktAlarm                                                                                                     
                                off                     off                                                                         
hwDhcpSnpChaddrAlarm            off                     off                                                                         
hwUntrustedReplyPktAlarm        off                     off                                                                         
hwDhcpPktRateAlarm              off                     on                                                                          
hwSnpUserNumberAlarmIf          off                     off                                                                         
hwSnpUserNumberAlarmIfResume    off                     off                                                                         
hwSnpUserNumberAlarmVlan        off                     off                                                                         
hwSnpUserNumberAlarmVlanResume  off                     off                                                                         
hwSnpUserNumberAlarmGlobal      off                     off                                                                         
hwSnpUserNumberAlarmGlobalResume                                                                                                    
                                off                     off                                                                         
hwNdSnpUserNumberAlarmIf        off                     off                                                                         
hwNdSnpUserNumberAlarmIfResume  off                     off                                                                         
hwNdSnpUserNumberAlarmGlobal    off                     off                                                                         
hwNdSnpUserNumberAlarmGlobalResume                                                                                                  
                                off                     off 
Table 6-30  Description of the display snmp-agent trap feature-name dhcp all command output

Item

Description

Feature name

Name of the module to which a trap belongs.

Trap number

Number of traps.

Trap name

Name of a trap. Traps on the DHCP module include:

  • hwNomatchSnpBindTblDhcpPktAlarm: The device sends a Huawei proprietary trap when the number of DHCP Request packets that do not match DHCP snooping binding entries and are discarded on an interface exceeds the threshold.
  • hwDhcpSnpChaddrAlarm: The device sends a Huawei proprietary trap when the number of discarded DHCP packets whose CHADDR field differs from the source MAC address exceeds the threshold.
  • hwUntrustedReplyPktAlarm: The device sends a Huawei proprietary trap message when the number of DHCP Reply packets discarded on an untrusted interface exceeds the threshold.
  • hwDhcpPktRateAlarm: The device sends a Huawei proprietary trap message when the number of discarded DHCP packets whose rate exceeds the limit exceeds the threshold.
  • hwSnpUserNumberAlarmIf: The device sends a Huawei proprietary trap message when the number of DHCP access users on an interface exceeds the upper threshold.
  • hwSnpUserNumberAlarmIfResume: The device sends a Huawei proprietary trap message when the number of DHCP access users on an interface falls below the lower threshold.
  • hwSnpUserNumberAlarmVlan: The device sends a Huawei proprietary trap message when the number of DHCP access users in a VLAN exceeds the upper threshold.
  • hwSnpUserNumberAlarmVlanResume: The device sends a Huawei proprietary trap message when the number of DHCP access users in a VLAN falls below the lower threshold.
  • hwSnpUserNumberAlarmGlobal: The device sends a Huawei proprietary trap message when the number of DHCP access users on the device exceeds the upper threshold.
  • hwSnpUserNumberAlarmGlobalResume: The device sends a Huawei proprietary trap message when the number of DHCP access users on the device falls below the lower threshold.
  • hwNdSnpUserNumberAlarmIf: The device sends a Huawei proprietary trap message when the number of ND access users on an interface exceeds the upper threshold.
  • hwNdSnpUserNumberAlarmIfResume: The device sends a Huawei proprietary trap message when the number of ND access users on an interface falls below the lower threshold.
  • hwNdSnpUserNumberAlarmGlobal: The device sends a Huawei proprietary trap message when the number of ND access users on the device exceeds the upper threshold.
  • hwNdSnpUserNumberAlarmGlobalResume: The device sends a Huawei proprietary trap message when the number of ND access users on the device falls below the lower threshold.

Default switch status

Default status of the trap function:
  • on: The trap function is enabled by default.

  • off: The trap function is disabled by default.

Current switch status

Trap status:

  • on: The trap is enabled.

  • off: The trap is disabled.

dns-list

Function

The dns-list command configures the DNS server address for the DHCP client.

The undo dns-list command deletes a configured DNS server address.

By default, no DNS server address is configured.

Format

IP address pool view

dns-list { ip-address &<1-8> | unnumbered interface interface-type interface-number }

undo dns-list { ip-address | unnumbered interface | all }

DHCP Option template view

dns-list ip-address &<1-8>

undo dns-list { ip-address | all }

Parameters

Parameter

Description

Value

ip-address

Specifies the DNS server address.

The value is in dotted decimal notation. A maximum of eight DNS server addresses can be configured. These IP addresses are separated by spaces.

unnumbered interface interface-type interface-number

Borrows the DNS server address obtained by the interface as the DNS server IP address.

-

all

Deletes all DNS server addresses.

-

Views

IP address pool view, DHCP Option template view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP servers. If user hosts access hosts on the network by domain names, user hosts need to send DNS requests to the DNS server and resolve the domain name to access for communication. To connect a DHCP client to the network, configure a DHCP server address so that the DHCP server can assign both the specified DNS server address and an IP address to the client. To configure DNS server addresses for an interface address pool, run the dhcp server dns-list command.

Precautions

In the IP address pool view and DHCP Option template view, a device can be configured with a maximum of eight DNS server addresses respectively. The address first assigned to the clients functions as the primary address, and the other seven addresses function as secondary addresses.

Example

# In the IP address pool view, set the IP address of the DNS server to 10.10.10.10.
<HUAWEI> system-view
[HUAWEI] ip pool global1
[HUAWEI-ip-pool-global1] dns-list 10.10.10.10
# In the DHCP Option template view, set the IP address of the DNS server to 10.10.10.10.
<HUAWEI> system-view
[HUAWEI] dhcp option template template1
[HUAWEI-dhcp-option-template-template1] dns-list 10.10.10.10

domain-name

Function

The domain-name command configures the domain name suffix for the DHCP client.

The undo domain-name command deletes a configured domain name suffix.

By default, no domain name suffix is configured.

Format

domain-name domain-name

undo domain-name

Parameters

Parameter

Description

Value

domain-name

Specifies a domain name to be assigned to a DHCP client.

The value is a string of 1 to 63 characters without spaces.

NOTE:
When quotation marks are used around the string, spaces are allowed in the string.

Views

IP address pool view, DHCP Option template view

Default Level

2: Configuration level

Usage Guidelines

This command applies to DHCP servers. When allocating IP addresses to the client, the DHCP server also specifies domain names for clients. Run the domain-name command on the DHCP server to specify a domain name. When allocating IP addresses to clients, the DHCP server also sends the domain names to the clients.

To configure a domain name for an interface address pool, run the dhcp server domain-name (interface view) command.

Example

# In the IP address pool view, configure the domain name suffix assigned to the DHCP client as example.com.
<HUAWEI> system-view
[HUAWEI] ip pool test
[HUAWEI-ip-pool-test] domain-name example.com
# In the DHCP Option template, configure the domain name suffix assigned to the DHCP client as huawei.com.
<HUAWEI> system-view
[HUAWEI] dhcp option template template1
[HUAWEI-dhcp-option-template-template1] domain-name huawei.com

excluded-ip-address

Function

The excluded-ip-address command specifies the range of IP addresses that cannot be automatically assigned to clients from the address pool.

The undo excluded-ip-address command deletes the specified range of IP addresses that cannot be automatically assigned to clients from the address pool.

By default, all IP addresses in the address pool can be automatically assigned to clients.

Format

excluded-ip-address start-ip-address [ end-ip-address ]

undo excluded-ip-address start-ip-address [ end-ip-address ]

Parameters

Parameter

Description

Value

start-ip-address

Specifies the start IP address that cannot be automatically assigned.

The value is in dotted decimal notation.

end-ip-address

Specifies the end IP address that cannot be automatically assigned. If end-ip-address is not specified, only start-ip-address cannot be automatically assigned.

The value is in dotted decimal notation. end-ip-address and start-ip-address must be on the same network segment and end-ip-address must be larger than start-ip-address.

Views

IP address pool view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The excluded-ip-address command applies to DHCP servers. Fixed IP addresses are allocated to some specific hosts (such as the WWW server) on the network for a long time. If these hosts' IP addresses are overlapped with IP addresses in the address pool and the DHCP server allocates these overlapped IP addresses to other hosts, IP address conflicts may occur. To prevent the IP address conflict, you need to exclude these IP addresses from being automatically allocated in the address pool.

You can run the excluded-ip-address command to specify the IP addresses or the range of IP addresses that cannot be automatically assigned to clients in the global address pool.

You can run the dhcp server excluded-ip-address command to specify the IP addresses or the range of IP addresses that cannot be automatically assigned to clients in the interface address pool.

Prerequisites

Network segment addresses that can be assigned from the global address pool have been configured using the network (address pool view) command.

Precautions

  • The excluded IP address or IP address segment must be in the local address pool.
  • You do not need to exclude the gateway address configured using the gateway-list command from being automatically allocated. The device automatically adds the gateway address into the list of IP addresses that cannot be automatically allocated.

    You do not need to exclude the IP address of a server's interface connecting to a client from being automatically allocated. The device automatically sets the interface IP address to the Conflict status during address allocation.

  • If you run the excluded-ip-address command multiple times, you can specify multiple IP addresses or IP address segments that cannot be automatically assigned to clients from the specified address pool.
  • You can run the display ip pool command to check used IP addresses in the current address pool, and then specify unused IP addresses that cannot be automatically assigned. To exclude used IP addresses from being automatically assigned, run the reset ip pool command to reclaim used IP addresses first.

Example

# Specify that IP addresses 10.10.10.10 to 10.10.10.20 cannot be automatically assigned to clients from the address pool global1.

<HUAWEI> system-view
[HUAWEI] ip pool global1
[HUAWEI-ip-pool-global1] network 10.10.10.0 mask 24
[HUAWEI-ip-pool-global1] excluded-ip-address 10.10.10.10 10.10.10.20

force insert option

Function

The force insert option command configures a DHCP server to forcibly insert an Option field specified in the global address pool or DHCP Option template to a DHCP Response packet that it sends to a DHCP client.

The undo force insert option command deletes the Option field forcibly inserted to a DHCP Response packet that a DHCP server sends to a DHCP client.

By default, a DHCP server does not forcibly insert an Option field to a DHCP Response packet that it sends to a DHCP client.

Format

force insert option code &<1-254>

undo force insert option code &<1-254>

Parameters

Parameter

Description

Value

code

Specifies the code for a forcibly replied option. You can configure a DHCP server to forcibly reply one or more options.

The value is an integer that ranges from 1 to 254.

Views

IP address pool view, DHCP Option template view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

When a DHCP client applies for an IP address from a DHCP server, parameters contained in the DHCP Request packet specify the options the client requires. The DHCP server inserts the required options to a DHCP Response packet.

Sometimes, the DHCP server on the existing network receives a DHCP Request packet that contains no parameter specifying the options the client requires. However, the client still wants to obtain the options configured on the global address pool. You can run the force insert option code &<1-254> command to configure the DHCP server to forcibly insert an Option field to the DHCP Response packet.

Prerequisites

The Option field has been configured in the global address pool by running the option code [ sub-option sub-code ] { ascii ascii-string | hex hex-string | cipher cipher-string | ip-address ip-address &<1-8> } command in the global address pool view.

Example

# Configure a DHCP server to forcibly insert Option 4 to a DHCP Response packet in the address pool pool1.

<HUAWEI> system-view
[HUAWEI] ip pool pool1
[HUAWEI-ip-pool-pool1] option 4 hex 11 22
[HUAWEI-ip-pool-pool1] force insert option 4
# Configure a DHCP server to forcibly insert Option 4 to a DHCP Response packet in the DHCP Option template template1.
<HUAWEI> system-view
[HUAWEI] dhcp option template template1
[HUAWEI-dhcp-option-template-template1] option 4 hex 11 22
[HUAWEI-dhcp-option-template-template1] force insert option 4

gateway (DHCP server group view)

Function

The gateway command specifies an egress gateway address of the DHCP server in the DHCP server group view.

The undo gateway command restores the default setting.

By default, no egress gateway address is specified.

Format

gateway ip-address

undo gateway

Parameters

Parameter

Description

Value

ip-address

Specifies the IP address of an egress gateway.

The value is in dotted decimal notation.

Views

DHCP server group view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP relay agents. If a DHCP server and its DHCP relay agent are on different network segments, you can run the gateway command to specify an egress gateway address for the DHCP relay agent. In this way, the DHCP relay agent can communicate with the DHCP server. Run the gateway-list command to configure an egress gateway for the DHCP server.

Precautions

  • If an egress gateway is not configured for a DHCP relay agent using the gateway command, the DHCP relay agent uses the interface address as the gateway address to communicate with the DHCP server.
  • When two switch devices function as the DHCP server and DHCP relay agent respectively, they must use the same egress gateway address.

Example

# Specify the egress gateway address of the server group myServers as 10.10.10.1.

<HUAWEI> system-view
[HUAWEI] dhcp server group myServers
[HUAWEI-dhcp-server-group-myServers] gateway 10.10.10.1

gateway-list

Function

The gateway-list command configures the egress gateway address for the DHCP client.

The undo gateway-list command deletes a configured egress gateway address.

By default, no egress gateway address is configured.

Format

gateway-list ip-address &<1-8>

undo gateway-list { ip-address | all }

Parameters

Parameter

Description

Value

ip-address

Specifies an egress gateway address.

The value is in dotted decimal notation.

all

Deletes all gateway addresses.

-

Views

IP address pool view, DHCP Option template view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP servers. If a DHCP server and its client are on different network segments, you can run the gateway-list command to specify an egress gateway address. In this way, the DHCP server and client can communicate with each other. Then the DHCP server can assign both an IP address and the specified egress gateway address to the client. You can configure multiple gateways in a global address pool to load balance traffic and improve network reliability.

Run the gateway (DHCP server group view) command to configure an egress gateway for a DHCP relay agent.

Configuration Impact

If a gateway address is configured on the DHCP server, a DHCP client obtains the gateway address from the DHCP server and automatically generates a default route to the gateway address. If you run the option121 command on the DHCP server to allocate classless static routes to DHCP clients, the DHCP client uses an allocated classless static route and does not automatically generate a default route to the gateway address.

Precautions

In the IP address pool view and DHCP Option template view, the Switch can be configured with a maximum of eight egress gateway addresses respectively. These gateway addresses cannot be subnet broadcast addresses.

When configuring an egress gateway address for the global address pool of a DHCP server, ensure that this egress gateway address is the same as that of the DHCP relay agent.

Example

# In the IP address pool view, set the egress gateway address for the DHCP client to 10.1.1.1.

<HUAWEI> system-view
[HUAWEI] ip pool global1
[HUAWEI-ip-pool-global1] gateway-list 10.1.1.1
# In the DHCP Option template, set the egress gateway address for the DHCP client to 10.1.1.1.
<HUAWEI> system-view
[HUAWEI] dhcp option template template1
[HUAWEI-dhcp-option-template-template1] gateway-list 10.1.1.1

ip address bootp-alloc

Function

The ip address bootp-alloc command enables the BOOTP client function on an interface.

The undo ip address bootp-alloc command disables the BOOTP client function from an interface.

By default, the BOOTP client function is disabled on an interface.

Format

ip address bootp-alloc [ unicast ]

undo ip address bootp-alloc

Parameters

Parameter

Description

Value

unicast

Indicates that the client requests the server to unicast response packets to the client.

-

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

DHCP is developed based on the BOOTP protocol. The device supports both DHCP and BOOTP and allows hosts to obtain IP addresses by BOOTP.

To enable an interface to obtain IP addresses using BOOTP, you can enable the BOOTP client function on the interface. A BOOTP client requests for an IP address from the server using BOOTP. The BOOTP client has two functions:
  • Sends BOOTP Request messages to the server.
  • Processes BOOTP Reply messages from the server.

To obtain an IP address, the BOOTP client sends a BOOTP Request message to the server. When the server receives the BOOTP Request message, it sends a BOOTP response message to the BOOTP client. The BOOTP client obtains the assigned IP address from the response message.

Precautions

Interfaces of the Switch can have IP addresses statically configured using the ip address command or dynamically obtain IP addresses using the ip address bootp-alloc command. A static IP address takes precedence over a dynamic IP address. If the interface has dynamically obtained an IP address after the ip address bootp-alloc command is executed, running the undo ip address command deletes the IP address and the ip address bootp-alloc command. If the interface does not obtain an IP address after the ip address bootp-alloc command is executed, running the undo ip address command does not delete the ip address bootp-alloc command.

Example

# Enable the BOOTP client function on VLANIF100 to obtain an IP address.

<HUAWEI> system-view
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ip address bootp-alloc
# Enable the BOOTP client function on GE0/0/1 to obtain an IP address.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] ip address bootp-alloc

ip address dhcp-alloc

Function

The ip address dhcp-alloc command enables the DHCP client function on an interface.

The undo ip address dhcp-alloc command disables the DHCP client function on an interface.

By default, the DHCP client function is enabled on VLANIF1 of the S1720GW, S1720GWR, S1720GW-E, and S1720GWR-E. The DHCP client function is disabled on the interfaces of other switches.

Format

ip address dhcp-alloc [ unicast ]

undo ip address dhcp-alloc

Parameters

Parameter

Description

Value

unicast

Indicates that the client requests the server to unicast response packets.

-

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

To enable an interface of the Switch to obtain IP addresses using DHCP, enable the DHCP client function on the interface. A BOOTP client applies for an IP address from the server using DHCP. The DHCP client has two functions:
  • Sends DHCP Request messages to the server.
  • Processes DHCP Reply messages from the server.

To obtain an IP address, the DHCP client sends a DHCP Request message to the server. After the server receives the DHCP Request message, it sends a DHCP response message to the DHCP client. The DHCP client obtains the assigned IP address from the response message.

Precautions

Interfaces of the device can have IP addresses statically configured using the ip address command or dynamically obtain IP addresses using the ip address dhcp-alloc command. A static IP address takes precedence over a dynamic IP address. If the interface has dynamically obtained an IP address after the ip address dhcp-alloc command is executed, running the undo ip address command deletes the IP address and the ip address dhcp-alloc command. If the interface does not obtain an IP address after the ip address dhcp-alloc command is executed, running the undo ip address command does not delete the ip address dhcp-alloc command.

On the S1720GW, S1720GWR, S1720GW-E, and S1720GWR-E, if no IP address is configured, VLANIF1 uses the IP address 192.168.1.253 255.255.255.0 by default, and the ip address dhcp-alloc unicast command is configured on the interface by default. After VLANIF1 obtains an IP address through DHCP successfully, the IP address 192.168.1.253 255.255.255.0 is deleted. If the DHCP client function is enabled on another VLANIF interface, the VLANIF interface cannot obtain the IP address in the same network segment as that of VLANIF1, which prevents address conflict.

Example

# Enable the DHCP client function on VLANIF100 to obtain an IP address.

<HUAWEI> system-view
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ip address dhcp-alloc
# Enable the DHCP client function on GE0/0/1 to obtain an IP address.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] ip address dhcp-alloc

ip pool (system view)

Function

The ip pool command creates a global address pool.

The undo ip pool command deletes a global address pool.

By default, no global address pool is created.

Format

ip pool ip-pool-name

undo ip pool ip-pool-name

Parameters

Parameter

Description

Value

ip-pool-name

Specifies the name for an IP address pool.

The value is a string of 1 to 64 characters without spaces. It can contain digits, letters, and special characters such as underscores (_), hyphens (-), and periods (.). It cannot be set to - or --.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP servers. When configuring a DHCP server, run the ip pool (system view) command in the system view to create a global IP address pool and set parameters for the global IP address pool, including a gateway address, the IP address lease, and a VPN instance. Then the configured DHCP server can assign IP addresses in the IP address pool to clients.

Precautions

A maximum of 128 address pools, including global address pools and interface address pools, can be created on the device.

Follow-up Procedure

Run the network (IP address pool view) command to specify the range of the IP addresses in the pool.

Example

# Create a global address pool named global1.

<HUAWEI> system-view
[HUAWEI] ip pool global1

ip relay address cycle

Function

The ip relay address cycle command enables the DHCP server polling function on a DHCP relay agent.

The undo ip relay address cycle command disables the DHCP server polling function on a DHCP relay agent.

By default, DHCP server polling is disabled on a DHCP relay agent.

Format

ip relay address cycle

undo ip relay address cycle

Parameters

None

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP relay agents. When multiple DHCP server addresses are configured on a DHCP relay agent, the DHCP relay agent forwards DHCP Discover messages to all servers by default. As a result, DHCP servers need to process a large number of messages, leading to heavy loads of servers. To solve this problem, configure the ip relay address cycle command. After this command is configured, the DHCP relay agent forwards a received DHCP Discover message to one DHCP server at a time, and forwards the DHCP Discover message to a different DHCP server each time it receives the message. Multiple DHCP servers then can allocate the same number of IP addresses, implementing load balancing among DHCP servers.

Prerequisites

DHCP has been enabled globally using the dhcp enable command.

Example

# Enable DHCP server polling on the switch in the system view.

<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] ip relay address cycle
Related Topics

ip route dhcp

Function

The ip route dhcp command configures a routing entry delivered by the DHCP server to a DHCP client.

The undo ip route dhcp command cancels the configuration.

By default, no routing entry is delivered by the DHCP server to a DHCP client.

Format

ip route ip-address { mask | mask-length } interface-type interface-number dhcp [ preference-value ]

undo ip route ip-address { mask | mask-length } interface-type interface-number dhcp [ preference-value ]

Parameters

Parameter

Description

Value

ip-address

Specifies the destination IP address.

The value is in dotted decimal notation.

mask

Specifies the mask of the IP address.

The value is in dotted decimal notation.

mask-length

Specifies the mask length. The 32-bit mask is represented by consecutive 1s, and the mask in dotted decimal notation can be replaced by the mask length.

The value is an integer that ranges from 0 to 32.

interface-type interface-number

Specifies the type and number of the interface that forwards packets.

-

dhcp

Indicates that the DHCP client obtains routing entries using DHCP.

-

preference-value

Specifies the priority of the routing protocol.

The value is an integer that ranges from 1 to 255.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

The ip route dhcp command is used on DHCP clients. After the ip route ip-address { mask | mask-length } interface-type interface-number dhcp [ preference-value ] command is run, a route with the gateway address as the next-hop IP address is automatically generated when a DHCP client obtains an IP address from the DHCP server through a DHCP request.

Example

# Configure a routing entry to be obtained in DHCP mode on the DHCP client, and specify VLANIF100 as the outbound interface for forwarding packets and 30 as the routing protocol priority.

<HUAWEI> system-view
[HUAWEI] ip route 10.1.1.1 24 vlanif 100 dhcp 30

lease

Function

The lease command sets the lease for IP addresses in a global IP address pool.

The undo lease command restores the default lease of IP addresses in a global IP address pool.

By default, the lease of IP addresses is one day.

Format

lease { day day [ hour hour [ minute minute ] ] | unlimited }

undo lease

Parameters

Parameter

Description

Value

day day

Specifies the number of days in the IP address lease.

The value is an integer that ranges from 0 to 999. The default value is 1.

hour hour

Specifies the number of hours in the IP address lease.

The value is an integer that ranges from 0 to 23. The default value is 0.

minute minute

Specifies the number of minutes in the IP address lease.

The value is an integer that ranges from 0 to 59. The default value is 0.

unlimited

Indicates that the IP address lease is unlimited.

-

Views

IP address pool view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP servers. To meet different client requirements, DHCP supports dynamic, automatic, and static address assignment.

Different hosts require different IP address leases. For example, if some hosts such as a DNS server need to use certain IP addresses for a long time, run the lease command to set the IP address lease of the current global address pool to unlimited. If some hosts such as a portable computer just need to use temporary IP addresses, run the lease command to set the IP address lease of the current global address pool to the required time so that the expired IP addresses can be released and assigned to other clients.

When a DHCP client starts and 50% or 87.5% of its IP address lease has passed, the DHCP client sends a DHCP Request message to the DHCP server to renew the lease.

  • If the IP address can be assigned to the client, the DHCP server informs the client that the IP address lease can be renewed.
  • If the IP address can no longer be assigned to the client, the DHCP server informs the client that the IP address lease cannot be renewed. The client needs to request for another IP address.

You can run the display ip pool command to view information about the IP address lease. The values of the lease and left fields in the command output indicate the configured lease time and remaining lease time, respectively.

Prerequisites

A global IP address pool has been created using the ip pool (system view) command.

Precautions

Different IP address leases can be specified for different global address pools on a DHCP server. In a global address pool, all addresses have the same lease.

To specify the IP address lease for an interface address pool, run the dhcp server lease command.

If the IP address lease of an address pool is changed using this command, newly assigned IP addresses use the new IP address lease. IP addresses assigned before the change still use the original IP address lease before the lease is updated, and use the new lease after the lease is updated.

Example

# Set the lease of a global address pool global1 to 2 days 2 hours and 30 minutes.

<HUAWEI> system-view
[HUAWEI] ip pool global1
[HUAWEI-ip-pool-global1] lease day 2 hour 2 minute 30
Related Topics

lock (IP address pool view)

Function

The lock command locks an IP address pool.

The undo lock restores the default configuration.

By default, no IP address pool is locked.

Format

lock

undo lock

Parameters

None

Views

IP address pool view

Default Level

2: Configuration level

Usage Guidelines

After the lock command is run, the specified IP address pool is locked and IP addresses in this address pool cannot be assigned to clients. When a DHCP server needs to be redeployed, you need to migrate address pools on the DHCP server to another DHCP server on the live network. To retain the addresses that have been assigned to clients from a global address pool, run the lock command to lock the global address pool. When new users get online after the address pool migration, they apply for IP addresses from a new address pool.

Example

# Lock the IP address pool global1.

<HUAWEI> system-view
[HUAWEI] ip pool global1
[HUAWEI-ip-pool-global1] lock
Related Topics

logging (IP address pool view)

Function

The logging command enables the logging function during IP address allocation of the DHCP server in the IP address pool view.

The undo logging command disables the logging function during IP address allocation of the DHCP server in the IP address pool view.

By default, the logging function during IP address allocation of the DHCP server is disabled.

Format

logging [ allocation-fail | allocation-success | release | renew-fail | renew-success | detect-conflict | recycle-conflict ] *

undo logging [ allocation-fail | allocation-success | release | renew-fail | renew-success | detect-conflict | recycle-conflict ] *

Parameters

Parameter Description Value
allocation-fail Displays logs when address allocation fails. -
allocation-success Displays logs when address allocation succeeds. -
release Displays logs when addresses are released. -
renew-fail Displays logs when address lease renewal fails. -
renew-success Displays logs when address lease renewal succeeds. -
detect-conflict Displays logs when address conflict occurs. -
recycle-conflict Displays logs when conflicting addresses are reclaimed. -

Views

IP address pool view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command is used on a DHCP server. When the DHCP server allocates IP addresses to clients, it records address allocation information to facilitate routine maintenance and fault location. After the logging function during IP address allocation of the DHCP server is configured using the logging command, the DHCP server records logs about address allocation, conflict, lease renewal, and release.

Run the display ip pool name ip-pool-name command to check the status of the logging function during IP address allocation of the DHCP server.

Prerequisites

The global address pool has been created using the ip pool (system view) command.

Precautions

If a large number of DHCP clients request for IP addresses after the logging function during IP address allocation of the DHCP server is configured, the server frequently records logs and therefore the device performance may be affected.

Example

# Enable the logging function during IP address allocation of the DHCP server in the IP address pool pool1.

<HUAWEI> system-view
[HUAWEI] ip pool pool1
[HUAWEI-ip-pool-pool1] logging

nbns-list

Function

The nbns-list command configures the NetBIOS server address for the DHCP client.

The undo nbns-list command deletes a configured NetBIOS server address.

By default, no NetBIOS server address is configured.

Format

nbns-list ip-address &<1-8>

undo nbns-list { ip-address | all }

Parameters

Parameter

Description

Value

ip-address

Specifies the IP address of a NetBIOS server.

The value is in dotted decimal notation. A maximum of eight NetBIOS server addresses can be configured. These IP addresses are separated by spaces.

all

Deletes all NetBIOS server addresses.

-

Views

IP address pool view, DHCP Option template view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP servers. Before hosts communicate with each other, a NetBIOS server needs to resolve the accessedNetBIOS hostname to an IP address. To enable hosts to communicate with each other, run the nbns-list command to configure NetBIOS server addresses. When assigning IP addresses to clients, a DHCP server also assigns the configured NetBIOS server addresses to clients. To configure NetBIOS server addresses for an interface address pool, run the dhcp server nbns-list command.

Precautions

In the IP address pool view and DHCP Option template view, a device can be configured with a maximum of eight NetBIOS server addresses respectively. The first assigned address functions as the primary address, and the other seven addresses function as secondary addresses.

Example

# In the IP address pool view, set the IP address of the NetBIOS server to 192.168.1.1.
<HUAWEI> system-view
[HUAWEI] ip pool global1
[HUAWEI-ip-pool-global1] nbns-list 192.168.1.1
# In the DHCP Option template view, set the IP address of the NetBIOS server to 10.1.1.1.
<HUAWEI> system-view
[HUAWEI] dhcp option template template1
[HUAWEI-dhcp-option-template-template1] nbns-list 10.1.1.1

netbios-type

Function

The netbios-type command configures the NetBIOS node type for the DHCP client.

The undo netbios-type command deletes a configured NetBIOS node type.

By default, no NetBIOS node type for the DHCP client is configured.

Format

netbios-type { b-node | h-node | m-node | p-node }

undo netbios-type

Parameters

Parameter

Description

Value

b-node

Indicates a node in broadcast mode. A b-node obtains the mapping between host names and IP addresses in broadcast mode.

-

h-node

Indicates a node in hybrid mode. An h-node is a b-type node enabled with the end-to-end communication mechanism.

-

m-node

Indicates a node in mixed mode. An m-node is a p-type node with some broadcast features.

-

p-node

Indicates a node in peer-to-peer mode. A p-node obtains the mapping between host names and IP addresses by communicating with a NetBIOS server.

-

Views

IP address pool view, DHCP Option template view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP servers. When a DHCP client uses NetBIOS for communication, its host name needs to be mapped to an IP address, and the NetBIOS node type needs to be specified for it using the netbios-type command. When a DHCP server assigns an IP address to clients, it also sends the specified NetBIOS node type to clients.

Prerequisites

To specify the NetBIOS node type for a client in the interface address pool, run the dhcp server netbios-type command.

Example

# In the IP address pool view, set the NetBIOS node type for the DHCP client to b-node.
<HUAWEI> system-view
[HUAWEI] ip pool global1
[HUAWEI-ip-pool-global1] netbios-type b-node
# In the DHCP Option template view, set the NetBIOS node type for the DHCP client to b-node.
<HUAWEI> system-view
[HUAWEI] dhcp option template template1
[HUAWEI-dhcp-option-template-template1] netbios-type b-node

network (IP address pool view)

Function

The network command sets a network segment address for a global address pool.

The undo network command restores the default network segment address.

By default, no network segment address is specified.

Format

network ip-address [ mask { mask | mask-length } ]

undo network

Parameters

Parameter

Description

Value

ip-address

Specifies a network segment address.

The value is in dotted decimal notation.

mask

Specifies the mask of the network segment address. If this parameter is not specified, the natural mask is used.

-

mask

Specifies the mask of the network segment address.

The value is in dotted decimal notation.

mask-length

Specifies the network mask length of the DHCP server.

The value is an integer that ranges from 0 to 32.

Views

IP address pool view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP servers. Before a DHCP server assigns IP addresses to clients from a global address pool, run the network command to set a network segment address for the global address pool so that the DHCP server can select and assign IP addresses on this network segment to clients. When a DHCP server assigns an IP address to the client from the interface address pool, the network segment of the interface IP address is that of the interface address pool.

Precautions

Each IP address pool can be configured with only one network segment. If the system needs multiple address segments, multiple IP address pools are required.

The size of an address pool can be controlled by setting the mask length. The mask length is in reverse proportion to the address pool size.

When configuring an address pool, ensure that IP addresses on the network address segment must be class A, B, or C IP addresses, and the mask cannot be set to 0, 1, 31, or 32.

The size of the IP address pool cannot be larger than 16K.

Example

# Set the network segment address of the IP address pool global1 to 192.168.1.0 and mask length to 24.

<HUAWEI> system-view
[HUAWEI] ip pool global1
[HUAWEI-ip-pool-global1] network 192.168.1.0 mask 24
Related Topics

next-server

Function

The next-server command configures the IP address of a server for the DHCP client after the client automatically obtains the IP address.

The undo next-server command deletes a configured IP address of a server for the DHCP client after the client automatically obtains the IP address.

By default, no IP address of a server is configured for the DHCP client after the client automatically obtains the IP address.

Format

next-server ip-address

undo next-server

Parameters

Parameter

Description

Value

ip-address

Specifies a server IP address.

The value is in dotted decimal notation.

Views

IP address pool view, DHCP Option template view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The next-server command is used on DHCP servers. When assigning a client an IP address, a DHCP server can also assign the client an IP address of the server that provides network services for the client. For example, after obtaining IP addresses, clients such as IP phones need parameters such as the startup configuration file to work normally. You can run the next-server command to specify the server address used after a client obtains an IP address. The client then requests the configuration parameters from the specified server after obtaining an IP address.

If users use addresses in the interface address pool, run the dhcp server next-server command to specify the DHCP server IP address. If users use addresses in the global address pool, run the next-server command to specify the DHCP server IP address.

Precautions

  • Only one IP address of a server that provides network services can be configured in each IP address pool view or DHCP Option template view. If the system needs multiple IP addresses of servers that provide network services, configure multiple IP address pools or DHCP Option templates.
  • If you run the next-server command multiple times, only the latest configuration takes effect.

Example

# In the IP address pool view, set the IP address of a server for the DHCP client after the client automatically obtains the IP address to 10.1.2.2.
<HUAWEI> system-view
[HUAWEI] ip pool global1
[HUAWEI-ip-pool-global1] next-server 10.1.2.2
# In the DHCP Option template view, set the IP address of a server for the DHCP client after the client automatically obtains the IP address to 10.1.2.2.
<HUAWEI> system-view
[HUAWEI] dhcp option template template1
[HUAWEI-dhcp-option-template-template1] next-server 10.1.2.2

option

Function

The option command configures the user-defined option that a DHCP server assigns to a DHCP client.

The undo option command deletes the user-defined option that a DHCP server assigns to a DHCP client.

By default, no user-defined option that a DHCP server assigns to a DHCP client is configured.

Format

option code [ sub-option sub-code ] { ascii ascii-string | hex hex-string | cipher cipher-string | ip-address ip-address &<1-8> }

undo option [ code [ sub-option sub-code ] ]

Parameters

Parameter

Description

Value

code

Specifies the code for a user-defined option.

The value is an integer that ranges from 1 to 254, except values 1, 3, 6, 15, 44, 46, 50, 51, 52, 53, 54, 55, 57, 58, 59, 61, 82, 121 and 184.
NOTE:

There are well-known options and customized options. For details about well-known options, see RFC 2132.

sub-option sub-code

Specifies the code of a user-defined sub-option.

The value is an integer that ranges from 1 to 254. For details about well-known options, see RFC 2132.

ascii ascii-string

Specifies the user-defined option code as an ASCII character string.

The value is a string of characters case-sensitive characters with spaces supported. If sub-option is not specified, the value is a string of 1 to 255 characters. If sub-option is specified, the value is a string of 1 to 253 characters.

hex hex-string

Specifies the user-defined option code as a hexadecimal string.

The value is a hexadecimal string with an even number of characters, for example, hh or hhhh. If sub-option is not specified, the value without spaces ranges from 1 to 254; if sub-option is specified, the value without spaces ranges from 1 to 252. The value can be a combination of digits (0-9) and letters (A-F and a-f).

cipher cipher-string

Specifies the user-defined option code as a ciphertext character string.

The value is a string, you can enter a character string in plain text or cipher text.

  • The character string in plain text is a string of 1 to 64 characters.
  • The character string in cipher text is a string of 32 to 104.

No matter whether the character string is entered in plain or cipher text, the character string is displayed in cipher text in the configuration file and in plain text in packets.

ip-address ip-address

Specifies the user-defined option code as an IP address.

The value is in dotted decimal notation.

Views

IP address pool view, DHCP Option template view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP servers. The option field in a DHCP packet carries control information and parameters. If a DHCP server is configured with options, when a DHCP client applies for an IP address, the client can obtain the configurations in the option field of the DHCP response packet from the DHCP server. To configure user-defined options for an interface address pool, run the dhcp server option command.

Precautions

  • To ensure accuracy, read the Request For Comments (RFC) before configuring options.

  • When the password is contained in option, the ascii or hex type is insecure. Set the option type to cipher. A secure password should contain at least two types of the following: lowercase letters, uppercase letters, number, and special characters. In addition, the password must consist of six or more than six characters.

  • Note the following if the option code [ sub-option sub-code ] { ascii ascii-string | hex hex-string | cipher cipher-string | ip-address ip-address &<1-8> } command is not executed for the first time:
    • If the new code is different from the existing code, both new and existing configurations take effect.
    • If the new code is the same as the existing code, the following situations may occur:
      • When a sub-code is specified in the existing command, the new configuration overrides the existing configuration if the new and existing sub-codes are the same, and both the new and existing configurations take effect if the new and existing sub-codes are different. If no sub-code is specified in the new command, the new configuration overrides the existing configuration.
      • When no sub-code is specified in the existing command, the new configuration overrides the existing configuration.
  • If the device functions as the DHCP server to assign IP addresses to APs, and the AC and APs are on different network segments, you need to configure the Option 43 field to specify the AC's IP address for the APs. Otherwise, the APs cannot discover the AC. Run the option 43 { hex hex-string | [ sub-option 1 hex hex-string | sub-option 2 ip-address ip-address &<1-8> | sub-option 3 ascii ascii-string ] } command to configure the device to specify AC IP addresses for APs in one of the following methods:
    1. Run the option 43 hex 031D3139322e3136382e3139342e35302c3139322e3136382e3139342e3534 command to configure the device to specify AC IP addresses 192.168.194.50 and 192.168.194.54 for APs. In this command, 03 is a fixed value, 1D indicates the length of an IP address including dots (.) is 29, 3139322e3136382e3139342e3530 indicates the ASCII value of 192.168.194.50, 2C indicates the ASCII value of the comma (,), and 3139322e3136382e3139342e3534 indicates the ASCII value of 192.168.194.54.
    2. Run the option 43 sub-option 1 hex C0A80001C0A80002 command to configure the device to specify AC IP addresses 192.168.0.1 and 192.168.0.2 for APs. In the command, C0A80001 indicates the hexadecimal format of 192.168.0.1, and C0A80002 indicates the hexadecimal format of 192.168.0.2.
    3. Run the option 43 sub-option 2 ip-address 192.168.0.1 192.168.0.2 command to configure the device to specify AC IP addresses 192.168.0.1 and 192.168.0.2 for APs.
    4. Run the option 43 sub-option 3 ascii 192.168.0.1,192.168.0.2 command to configure the device to specify AC IP addresses 192.168.0.1 and 192.168.0.2 for APs.
      NOTE:
      If you need to configure multiple IP addresses when the option is specified as an ASCII character string, use commas (,) to separate the IP addresses.
    If the AC and APs are in the same network segment, you do not need to configure the Option 43 field, and the APs can discover the AC in broadcast mode. After Option 43 is configured, the APs unicast Discover Request packets to the IP address carried in Option 43 to discover the AC. If the APs do not receive any Discovery Response packet after sending unicast Discovery Request packets 10 consecutive times, the APs then broadcast packets to discover the AC.

Example

# In the global address pool global1, configure Option64 to 0x11 (a hexadecimal number).
<HUAWEI> system-view
[HUAWEI] ip pool global1
[HUAWEI-ip-pool-global1] option 64 hex 11
# In the DHCP Option template template1, configure Option64 to 0x11 (a hexadecimal number).
<HUAWEI> system-view
[HUAWEI] dhcp option template template1
[HUAWEI-dhcp-option-template-template1] option 64 hex 11

option121

Function

The option121 command configures the classless static route for the DHCP client.

The undo option121 command deletes a configured classless static route.

By default, no classless static route is configured.

Format

option121 ip-address { ip-address mask-length gateway-address } &<1-8>

undo option121 [ ip-address ip-address mask-length gateway-address ]

Parameters

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.

Views

IP address pool view, DHCP Option template view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The option121 command applies to only the DHCP server. The option121 command configures Option 121 that defines a classless static route allocated to a client.

mask-length and gateway-address specify a classless static route. The option121 command configures a maximum of eight classless static routes.

Precautions

  • To configure multiple classless static routes, run the option121 command repeatedly.

  • The undo option121 command will delete all classless static routes. To delete one classless static route, run the undo option121 ip-address ip-address mask-length gateway-address command.

Example

# In the IP address pool view, configure classless static routes delivered by the DHCP server.
<HUAWEI> system-view
[HUAWEI] ip pool global1
[HUAWEI-ip-pool-global1] option121 ip-address 10.10.10.10 24 10.11.11.11
# In the DHCP Option template view, configure classless static routes delivered by the DHCP server.
<HUAWEI> system-view
[HUAWEI] dhcp option template template1
[HUAWEI-dhcp-option-template-template1] option121 ip-address 10.10.10.10 24 10.11.11.11

option184

Function

The option184 command configures the Option 184 field for the DHCP client.

The undo option184 command deletes a configuration in the Option 184 field.

By default, no content in the Option 184 field is configured.

Format

option184 { as-ip ip-address | fail-over ip-address dialer-string | ncp-ip ip-address | voice-vlan vlan-id }

undo option184 [ as-ip | fail-over | ncp-ip | voice-vlan ]

Parameters

Parameter

Description

Value
ncp-ip ip-address Specifies the IP address of the network call processor (NCP). The value is in dotted decimal notation.
as-ip ip-address Specifies the IP address of the backup NCP. The value is in dotted decimal notation.
fail-over ip-address Specifies the IP address in the failover route. The value is in dotted decimal notation.
dialer-string Specifies the dialer string. The value is a string of 1 to 64 characters.
voice-vlan vlan-id Specifies the ID of a voice VLAN. The value is an integer that ranges from 1 to 4094.

Views

IP address pool view, DHCP Option template view

Default Level

2: Configuration level

Usage Guidelines

The option184 command applies to only the DHCP server and configures Option 184 allocated by a DHCP server to a client in a global address pool.

Example

# In the IP address pool view, configure the Option 184 field.
<HUAWEI> system-view
[HUAWEI] ip pool global1
[HUAWEI-ip-pool-global1] option184 as-ip 192.168.1.10
# In the DHCP Option template view, configure the Option 184 field.
<HUAWEI> system-view
[HUAWEI] dhcp option template template1
[HUAWEI-dhcp-option-template-template1] option184 as-ip 10.10.10.10 

reset dhcp client statistics

Function

The reset dhcp client statistics command clears packet statistics about a DHCP client.

Format

reset dhcp client statistics [ interface interface-type interface-number ]

Parameters

Parameter

Description

Value

interface interface-type interface-number

Clear packet statistics about the DHCP client of the specified interface.
  • interface-type specifies the interface type.
  • interface-number specifies the interface number.

-

Views

User view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

The reset dhcp client statistics command is applicable to DHCP client. During DHCP troubleshooting, statistics about the packets sent and received within a specified period need to be checked. Therefore, before collecting packet statistics, run the reset dhcp client statistics command to clear the existing packet statistics. Then you can run the display dhcp client statistics command to check packet statistics about the DHCP client.

Precautions

The reset dhcp client statistics command can be run multiple times at any interval.

Example

# Clear packet statistics about the DHCP client.

<HUAWEI> reset dhcp client statistics

reset dhcp relay statistics

Function

The reset dhcp relay statistics command clears message statistics on a DHCP relay agent.

Format

reset dhcp relay statistics [ server-group group-name ]

Parameters

Parameter

Description

Value

server-group group-name

Specifies the name of a DHCP server group.

The value is a string of 1 to 32 characters without spaces. A combination of digits, letters, underscores (_), and dots (.) is allowed.

Views

User view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

This command applies to DHCP relay agents. Collecting statistics on the DHCP messages sent and received within a specified period helps you locate DHCP faults. Run the reset dhcp relay statistics [ server-group group-name ] command to clear original statistics on DHCP messages, and run the display dhcp relay statistics [ server-group group-name ] command to view packet statistics about the DHCP relay agent.
  • Run the reset dhcp relay statistics server-group group-name command to clear message statistics on DHCP relay agents connected to DHCP servers in a specified DHCP server group. The DHCP server group name needs to be specified.
  • Run the reset dhcp relay statistics command to clear message statistics on all DHCP relay agents besides DHCP relay agents connected to DHCP servers in the DHCP server group.

Precautions

The reset dhcp relay statistics command can be run multiple times at any interval.

Example

# Clear message statistics on the DHCP relay agent.

<HUAWEI> reset dhcp relay statistics

reset dhcp server statistics

Function

The reset dhcp server statistics command clears statistics on the DHCP server.

Format

reset dhcp server statistics

Parameters

None

Views

User view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

This command applies to DHCP servers. Collecting statistics on the DHCP messages sent and received within a specified period helps you locate DHCP faults. Run the reset dhcp server statistics command to clear original statistics on DHCP messages and then run the display dhcp server statistics to view message statistics on the DHCP server.

Precautions

The reset dhcp server statistics command can be run multiple times at any interval.

Example

# Clear message statistics on the DHCP server.

<HUAWEI> reset dhcp server statistics

reset dhcp statistics

Function

The reset dhcp statistics command clears packet statistics about a DHCP.

Format

reset dhcp statistics

Parameters

None

Views

User view

Default Level

3: Management level

Usage Guidelines

During DHCP troubleshooting, statistics about the packets sent and received within a specified period need to be checked. Therefore, before collecting packet statistics, run the reset dhcp statistics command to clear the existing packet statistics. Then you can run the display dhcp statistics command to view DHCP message statistics.

Example

# Clear packet statistics about the DHCP.

<HUAWEI> reset dhcp statistics

reset ip pool

Function

The reset ip pool command resets the IP address pool configured on the device.

Format

reset ip pool { interface interface-name | name ip-pool-name } { start-ip-address [ end-ip-address ] | all | conflict | expired | used }

Parameters

Parameter

Description

Value

interface interface-name

Specifies the name of the interface address pool to be reset, which is represented by the type and number of an interface.

The value is a string of 1 to 64 characters without spaces. A combination of digits, letters, underscores (_), and dots (.) is allowed.

name ip-pool-name

Specifies the name of the global address pool to be reset.

The value is a string of 1 to 64 characters without spaces. A combination of digits, letters, underscores (_), and dots (.) is allowed.

start-ip-address

Specifies the start IP address of the IP address pool to be reset.

The value is in dotted decimal notation.

end-ip-address

Specifies the end IP address of the IP address pool to be reset.

The value is in dotted decimal notation.

all

Indicates that all the IP addresses need to be reset.

-

conflict

Indicates that the conflicting IP addresses need to be reset.

-

expired

Indicates that the expired IP addresses need to be reset.

-

used

Indicates that the used IP addresses need to be reset.

-

Views

User view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

The reset ip pool command resets the IP addresses that cannot be released in an IP address pool. If an IP address conflict occurs because two clients use the same IP address, run the reset ip pool command to reset the specified IP address pool.

Precautions

If a user's IP address is within the IP address range specified when this command is run, the user cannot continue to use the IP address after this command is run, and needs to send an IP address application request again.

The address pool status cannot be restored after this command is run. Therefore, exercise caution when deciding to run this command.

User information cannot be restored after you clear it. Exercise caution when running the reset ip pool command. DHCP clients must release their old IP addresses before obtaining new IP addresses.

Follow-up Procedure

After the address pool is set to idle, the client can obtain an IP address from the global address pool.

Example

# Reset the conflicting IP addresses in the IP address pool mypool.

<HUAWEI> reset ip pool name mypool conflict
Related Topics

section (IP address pool view)

Function

The section command configures the IP address segment in an IP address pool.

The undo section command deletes the configured IP address segment in an IP address pool.

By default, the IP address segment in an IP address pool is not configured.

Format

section section-id start-address [ end-address ]

undo section section-id

Parameters

Parameter Description Value
section-id

Specifies the ID of the address segment in the IP address pool.

The value is an integer that ranges from 0 to 255.

start-address

Specifies the start IP address of the address segment.

The value is in dotted decimal notation.

end-address
Specifies the end IP address of the address segment.
NOTE:
The end IP address must be larger than the start IP address. If the end IP address is not entered, there is only one address in the address segment.

The value is in dotted decimal notation.

Views

IP address pool view

Default Level

2: Configuration level

Usage Guidelines

Prerequisites

The gateway address of the IP address pool has been configured.

Precautions

An IP address pool consists of one or more IP address segments. The IP addresses on each address segment cannot overlap.

Example

# Configure an IP address segment 10.1.1.10-10.1.1.15 with the ID 0 for the IP address pool abc.

<HUAWEI> system-view
[HUAWEI] ip pool abc
[HUAWEI-ip-pool-abc] section 0 10.1.1.10 10.1.1.15

sip-server (IP address pool view)

Function

The sip-server command configures the SIP server IP address assigned to a DHCP client in a global address pool.

The undo sip-server command deletes the configured SIP server IP address assigned to a DHCP client in a global address pool.

By default, the SIP server IP address assigned to a DHCP client in a global address pool is not configured.

Format

sip-server { ip-address ip-address &<1-2> | list domain-name &<1-2> }

undo sip-server

Parameters

Parameter Description Value
ip-address ip-address

Specifies an IP address for the SIP server.

The value is in dotted decimal notation.
list domain-name

Specifies the domain name of the SIP server.

The value is a string of 1 to 63 characters.

Views

IP address pool view, DHCP Option template view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to the DHCP server. To enable DHCP clients to normally access the Internet, the DHCP server needs to specify the SIP server IP address in the address pool when assigning IP addresses to the clients.

Precautions

  • A maximum of two SIP server addresses can be configured in each address pool. The first assigned address functions as the primary address, and the other address functions as a secondary address.
  • Before specifying the IP address or name for a SIP server, ensure that the SIP server exists.
  • If you run this command repeatedly, the latest configuration overrides the previous ones.

Example

# Specify 192.168.1.1 as the IP address of the SIP server when addresses in the global address pool global1 are assigned to clients.

<HUAWEI> system-view
[HUAWEI] ip pool global1 
[HUAWEI-ip-pool-global1] sip-server ip-address 192.168.1.1

sname

Function

The sname command configures the name of the server from which the DHCP client obtains the startup configuration file.

The undo sname command deletes the configured name of the server from which the DHCP client obtains the startup configuration file.

By default, no name is configured for the server from which the DHCP client obtains the startup configuration file.

Format

sname sname

undo sname

Parameters

Parameter

Description

Value

sname

Specifies the name of the server where the DHCP client obtains the startup configuration file.

The value is a string of 1 to 63 case-sensitive characters without spaces.

Views

IP address pool view, DHCP Option template view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

Besides assigning IP addresses, a DHCP server can also provide the required network configuration parameters, such as the startup configuration file name for the DHCP client. After the name of the server from which the DHCP client obtains the startup configuration file is configured using the sname command, the DHCP client obtains the startup configuration file from this server.

Precautions

Ensure that the route between the DHCP client and the file server from which the DHCP client obtains the startup configuration file is reachable.

Example

# In the IP address pool view, configure the name of the server from which the DHCP client obtains the startup configuration file as example.
<HUAWEI> system-view
[HUAWEI] ip pool p1
[HUAWEI-ip-pool-p1] sname example
# In the DHCP Option template view, configure the name of the server from which the DHCP client obtains the startup configuration file as Huawei.
<HUAWEI> system-view
[HUAWEI] dhcp option template template1
[HUAWEI-dhcp-option-template-template1] sname Huawei

snmp-agent trap enable feature-name dhcp

Function

The snmp-agent trap enable feature-name dhcp command enables the trap function for the DHCP module.

The undo snmp-agent trap enable feature-name dhcp command disables the trap function for the DHCP module.

By default, the trap function for the DHCP module is disabled.

Format

snmp-agent trap enable feature-name dhcp [ trap-name { hwdhcppktratealarm | hwdhcpsnpchaddralarm | hwndsnpusernumberalarmglobal | hwndsnpusernumberalarmglobalresume | hwndsnpusernumberalarmif | hwndsnpusernumberalarmifresume | hwnomatchsnpbindtbldhcppktalarm | hwsnpusernumberalarmglobal | hwsnpusernumberalarmglobalresume | hwsnpusernumberalarmif | hwsnpusernumberalarmifresume | hwsnpusernumberalarmvlan | hwsnpusernumberalarmvlanresume | hwuntrustedreplypktalarm } ]

undo snmp-agent trap enable feature-name dhcp [ trap-name { hwdhcppktratealarm | hwdhcpsnpchaddralarm | hwndsnpusernumberalarmglobal | hwndsnpusernumberalarmglobalresume | hwndsnpusernumberalarmif | hwndsnpusernumberalarmifresume | hwnomatchsnpbindtbldhcppktalarm | hwsnpusernumberalarmglobal | hwsnpusernumberalarmglobalresume | hwsnpusernumberalarmif | hwsnpusernumberalarmifresume | hwsnpusernumberalarmvlan | hwsnpusernumberalarmvlanresume | hwuntrustedreplypktalarm } ]

Parameters

Parameter

Description

Value

trap-name

Enables or disables the trap function for a specified event of the DHCP module.

-

hwdhcppktratealarm

Enables the device to send a Huawei proprietary trap when the number of discarded DHCP packets whose rate exceeds the limit exceeds the threshold.

-

hwdhcpsnpchaddralarm

Enables the device to send a Huawei proprietary trap when the number of discarded DHCP packets whose CHADDR field differs from the source MAC address exceeds the threshold.

-

hwndsnpusernumberalarmglobal

Enables the device to send a Huawei proprietary trap when the number of ND access users on the device exceeds the upper threshold.

-

hwndsnpusernumberalarmglobalresume

Enables the device to send a Huawei proprietary trap when the number of ND access users on the device falls below the lower threshold.

-

hwndsnpusernumberalarmif

Enables the device to send a Huawei proprietary trap when the number of ND access users on an interface exceeds the upper threshold.

-

hwndsnpusernumberalarmifresume

Enables the device to send a Huawei proprietary trap when the number of ND access users on an interface falls below the lower threshold.

-

hwnomatchsnpbindtbldhcppktalarm

Enables the device to send a Huawei proprietary trap when the number of DHCP Request packets that do not match DHCP snooping binding entries and are discarded on an interface exceeds the threshold.

-

hwsnpusernumberalarmglobal

Enables the device to send a Huawei proprietary trap when the number of DHCP access users on the device exceeds the upper threshold.

-

hwsnpusernumberalarmglobalresume

Enables the device to send a Huawei proprietary trap when the number of DHCP access users on the device falls below the lower threshold.

-

hwsnpusernumberalarmif

Enables the device to send a Huawei proprietary trap when the number of DHCP access users on an interface exceeds the upper threshold.

-

hwsnpusernumberalarmifresume

Enables the device to send a Huawei proprietary trap when the number of DHCP access users on an interface falls below the lower threshold.

-

hwsnpusernumberalarmvlan

Enables the device to send a Huawei proprietary trap when the number of DHCP access users in a VLAN exceeds the upper threshold.

-

hwsnpusernumberalarmvlanresume

Enables the device to send a Huawei proprietary trap when the number of DHCP access users in a VLAN falls below the lower threshold.

-

hwuntrustedreplypktalarm

Enables the device to send a Huawei proprietary trap when the number of DHCP Reply packets discarded on an untrusted interface exceeds the threshold.

-

Views

System view

Default Level

2: Configuration level

Usage Guidelines

After the trap function is enabled, the device generates traps during operation and sends the traps to the NMS through the SNMP module. If the trap function is disabled, the device does not generate traps and the SNMP module does not send traps to the NMS.

You can specify snmp-agent to enable the trap function for one or more events.

Example

# Enable the trap function for hwdhcppktratealarm of the DHCP module.

<HUAWEI> system-view
[HUAWEI] snmp-agent trap enable feature-name dhcp trap-name hwdhcppktratealarm

static-bind

Function

The static-bind command binds an IP address in a global address pool to a MAC address of a client.

The undo static-bind command unbinds the IP address in a global address pool from a MAC address.

By default, the IP address in a global address pool is not bound to any MAC address.

Format

static-bind ip-address ip-address mac-address mac-address [ option-template template-name | description description ]

undo static-bind [ ip-address ip-address | mac-address mac-address ]

Parameters

Parameter

Description

Value

ip-address ip-address

Specifies the IP address to be bound. The IP address must be a valid IP address in the global address pool.

The value is in dotted decimal notation.

mac-address mac-address

Specifies the user MAC address.

The value is in H-H-H format. An H is a hexadecimal number of 1 to 4 digits.

option-template template-name

Specifies the name of the DHCP Option template. To allocate network configuration parameters except IP addresses to static clients, specify the parameter. Before specifying the parameter, run the dhcp option template command to create a DHCP option template, and configure network parameters for static clients in the DHCP Option template view.

The name is a string of 1 to 31 case-sensitive characters without spaces.

description description

Specifies the user description.

The value is a string of 1 to 256 case-sensitive characters. It can contain spaces.

Views

IP address pool view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The static-bind command applies to DHCP servers. When planning a network, you need to allocate fixed IP addresses to some important hosts to ensure reliability. In this case, you can bind IP addresses in the address pool to the MAC addresses of these hosts. After the preceding configuration is complete, if the host of the MAC address to which the IP address is bound request an IP address from the DHCP server, the DHCP server finds the bound IP address based on the host's MAC address and allocates this IP address to the host, ensuring that the IP address obtained by the host is fixed.

You can run the static-bind command to bind an IP address in a global address pool to a MAC address.

You can run the dhcp server static-bind command to bind an IP address in an interface address pool to a MAC address.

Prerequisites

Network segment addresses that can be assigned from the global address pool have been configured using the network (IP address pool view) command.

Precautions

  • Ensure that the bound IP address is not configured as the IP address that cannot be allocated using the excluded-ip-address command and is not allocated by the DHCP server.
  • You can run the display ip pool command to view the used IP addresses in the current address pool and select an available IP address to be bound to the MAC address. To bind used IP addresses to MAC addresses, run the reset ip pool command to reclaim used IP addresses first.
  • The DHCP server preferentially allocates the IP address that has been statically bound to the client's MAC address.
  • After an IP address is bound to a MAC address, the IP address does not expire; the binding between the IP and MAC addresses cannot be deleted when the IP address is in use.

Example

# Configure a DHCP server to assign a fixed IP address 192.168.1.10 in the global address pool global1 to a host with the MAC address dcd2-fc96-e4c0.

<HUAWEI> system-view
[HUAWEI] ip pool global1
[HUAWEI-ip-pool-global1] network 192.168.1.10 mask 24
[HUAWEI-ip-pool-global1] static-bind ip-address 192.168.1.10 mac-address dcd2-fc96-e4c0

vpn-instance (DHCP server group view)

Function

The vpn-instance command binds a DHCP server group to a VPN instance.

The undo vpn-instance command unbinds the VPN instance from a DHCP server group.

By default, no DHCP server is bound to a VPN instance.

NOTE:

Only the S1720GW, S1720GW-E, S1720GWR, S1720GWR-E, S1720X, S1720X-E, S2720EI, S5720EI, S5720HI, S5720LI, S5720S-LI, S5720S-SI, S5720SI, S5730S-EI, S5730SI, S6720EI, S6720LI, S6720S-EI, S6720S-LI, S6720SI, and S6720S-SI support this command.

Format

vpn-instance vpn-instance-name

undo vpn-instance

Parameters

Parameter

Description

Value

vpn-instance-name

Specifies the name of a VPN instance.

The value must be an existing VPN instance name.

Views

DHCP server group view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP relay agents. To apply DHCP services in a VPN instance, you need to run the vpn-instance command to bind the created DHCP server group to the VPN instance.

Prerequisites

A VPN instance has been created using the ip vpn-instance command.

Precautions

The VPN instance bound to the DHCP server group on the DHCP relay agent must be the same as the VPN instance bound to the IP address pool on the DHCP server; otherwise, users in the IP address pool cannot go online.

Example

# Bind DHCP server group dhcp-srv1 to VPN instance huawei.

<HUAWEI> system-view
[HUAWEI] ip vpn-instance huawei
[HUAWEI-vpn-instance-huawei] ipv4-family
[HUAWEI-vpn-instance-huawei-af-ipv4] route-distinguisher 22:1
[HUAWEI-vpn-instance-huawei-af-ipv4] quit
[HUAWEI-vpn-instance-huawei] quit
[HUAWEI] dhcp server group dhcp-srv1
[HUAWEI-dhcp-server-group-dhcp-srv1] vpn-instance huawei
Related Topics

vpn-instance (global address pool view)

Function

The vpn-instance command binds an IP address pool to a VPN instance.

The undo vpn-instance command restores the default setting.

By default, an IP address pool is not bound to any VPN instance.

NOTE:

Only the S1720GW, S1720GW-E, S1720GWR, S1720GWR-E, S1720X, S1720X-E, S2720EI, S5720EI, S5720HI, S5720LI, S5720S-LI, S5720S-SI, S5720SI, S5730S-EI, S5730SI, S6720EI, S6720LI, S6720S-EI, S6720S-LI, S6720SI, and S6720S-SI support this command.

Format

vpn-instance vpn-instance-name

undo vpn-instance

Parameters

Parameter

Description

Value

vpn-instance-name

Specifies the name of a VPN instance.

The value must be an existing VPN instance name.

Views

Global address pool view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP servers. To apply DHCP services in a VPN instance, you need to run the vpn-instance command to bind the created IP address pool to the VPN instance.

Prerequisites

A VPN instance has been created using the ip vpn-instance command.

Precautions

  • The VPN instance bound to the IP address pool on the DHCP server must be the same as the VPN instance bound to the DHCP server group on the DHCP relay agent; otherwise, users in the IP address pool cannot go online using this DHCP server group.

  • If an IP address pool is bound to a VPN instance, IP addresses assigned from this address pool are VPN addresses.
  • To bind an interface address pool to a VPN instance, run the ip binding vpn-instance command in the interface view.

Example

# Bind the address pool global1 to the VPN instance huawei.

<HUAWEI> system-view
[HUAWEI] ip vpn-instance huawei
[HUAWEI-vpn-instance-huawei] ipv4-family
[HUAWEI-vpn-instance-huawei-af-ipv4] quit
[HUAWEI-vpn-instance-huawei] quit 
[HUAWEI] ip pool global1
[HUAWEI-ip-pool-global1] vpn-instance huawei
Translation
Download
Updated: 2019-04-18

Document ID: EDOC1000178165

Views: 41912

Downloads: 1101

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next