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

AR500, AR510, and AR530 V200R007 Commands Reference

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

NOTE:

Wireless interfaces cannot function as DHCP clients or BOOTP clients.

When ACL resources are exhausted, related DHCP commands do not take effect.

bootfile

Function

The bootfile command configures the name of the startup configuration file for a DHCP client in the global address pool view or DHCP Option template view.

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 in the global address pool view and DHCP Option template view.

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

Global 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 global 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

dhcp alarm dhcp-rate enable

Function

Using the dhcp alarm dhcp-rate enable command, you can enable the DHCP message checking alarm.

Using the undo dhcp alarm dhcp-rate enable command, you can disable the DHCP message checking alarm.

By default, the DHCP message checking alarm is disabled.

Format

dhcp alarm dhcp-rate enable

undo dhcp alarm dhcp-rate enable

Parameters

None

Views

System view, interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

After DHCP message checking is enabled, configure the DHCP message checking alarm on an interface. An alarm is generated if the number of discarded DHCP messages on the interface reaches the alarm threshold.

The interfaces supporting this command include Layer 2 GE interfaces, Layer 2 Ethernet interface, Layer 2 Eth-Trunk interfaces, Layer 2 port group, Layer 3 GE interfaces, and Layer 3 Ethernet interface.

Prerequisites

The following configurations have been performed in sequence:

  1. DHCP has been enabled globally by using the dhcp enable command.
  2. DHCP message checking has been enabled by using the dhcp check dhcp-rate enable command.

Follow-up Procedure

Run the dhcp alarm dhcp-rate threshold command to set the alarm threshold.

Example

# Enable the DHCP message checking alarm on Ethernet0/0/1.

<Huawei> system-view
[Huawei] dhcp enable
[Huawei] interface ethernet 0/0/1
[Huawei-Ethernet0/0/1] dhcp check dhcp-rate enable
[Huawei-Ethernet0/0/1] dhcp alarm dhcp-rate enable

dhcp alarm dhcp-rate threshold

Function

The dhcp alarm dhcp-rate threshold command sets the alarm threshold for DHCP message checking on an interface.

The undo dhcp alarm dhcp-rate threshold command restores the default alarm threshold.

By default, the alarm threshold for DHCP message checking in the system view is 100, and no alarm threshold for DHCP message checking is configured in the interface view.

Format

dhcp alarm dhcp-rate threshold threshold

undo dhcp alarm dhcp-rate threshold

Parameters

Parameter

Description

Value

threshold

Specifies the alarm threshold for DHCP message checking on an interface.

The value is an integer ranging from 1 to 1000.

Views

System view, interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

After the DHCP message checking alarm is enabled on an interface, set the alarm threshold for DHCP message checking on an interface. An alarm is generated when the number of discarded DHCP messages reaches the alarm threshold on an interface.

Prerequisites

Before running the dhcp alarm dhcp-rate threshold command, you must run the dhcp alarm dhcp-rate enable command to enable the DHCP message checking alarm.

Precautions

If you set the alarm threshold for DHCP message checking in both the system view and interface view, the alarm threshold configured in the interface view takes effect.

If you run the dhcp alarm dhcp-rate threshold threshold command only in the system view, the alarm threshold for DHCP message checking in the interface view is the same as that configured in the system view.

The interfaces supporting this command include Layer 2 GE interfaces, Layer 2 Ethernet interface, Layer 2 Eth-Trunk interfaces, Layer 2 port group, Layer 3 GE interfaces, and Layer 3 Ethernet interface.

Example

# Set the alarm threshold for DHCP message checking to 150 on interface Ethernet0/0/1.

<Huawei> system-view
[Huawei] dhcp enable
[Huawei] interface ethernet 0/0/1
[Huawei-Ethernet0/0/1] dhcp alarm dhcp-rate threshold 150

dhcp check dhcp-rate enable

Function

The dhcp check dhcp-rate enable command enables DHCP packet rate checking.

The undo dhcp check dhcp-rate enable command disables DHCP packet rate checking.

By default, DHCP packet rate checking is disabled.

Format

In the system view:

dhcp check dhcp-rate enable [ vlan { vlan-id1 [ to vlan-id2 ] } &<1-10> ]

undo dhcp check dhcp-rate enable [ vlan { vlan-id1 [ to vlan-id2 ] } &<1-10> ]

In the interface view or VLAN view:

dhcp check dhcp-rate enable

undo dhcp check dhcp-rate enable

Parameters

Parameter

Description

Value

vlan { vlan-id1 [ to vlan-id2 ] }

Enables DHCP packet rate checking in specified VLANs.

  • vlan-id1 specifies the ID of the first VLAN.
  • vlan-id2 specifies the ID of the last VLAN. vlan-id2 and vlan-id1 determine a VLAN ID range.
  • vlan-id1 is an integer that ranges from 1 to 4094.
  • vlan-id2 is an integer that ranges from 1 to 4094. vlan-id2 must be larger than vlan-id1.

Views

System view, VLAN view, Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

If attackers send DHCP packets continuously, the protocol stack of the industrial switch router is affected.

To prevent attackers from sending a large number of DHCP packets, enable DHCP message checking on the industrial switch router. The industrial switch router checks the rate of sending DHCP packets including DHCP request and DHCP response packets. Only a certain number of DHCP packets can be sent to the DHCP protocol stack in a certain period of time and excess messages are discarded.

The interfaces supporting this command include Layer 2 GE interfaces, Layer 2 Ethernet interface, Layer 2 Eth-Trunk interfaces, Layer 2 port group, Layer 3 GE interfaces, and Layer 3 Ethernet interface.

Prerequisites

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

Follow-up Procedure

Run the dhcp check dhcp-rate command to set the rate of sending DHCP packets.

Example

# Enable DHCP packet rate checking in the system view.

<Huawei> system-view
[Huawei] dhcp enable
[Huawei] dhcp check dhcp-rate enable

# Enable DHCP packet rate checking in VLAN 100.

<Huawei> system-view
[Huawei] dhcp enable
[Huawei] vlan 100
[Huawei-vlan100] dhcp check dhcp-rate enable

dhcp check dhcp-rate

Function

The dhcp check dhcp-rate command sets the checking rate of DHCP messages sent to the DHCP protocol stack.

The undo dhcp check dhcp-rate command restores the default checking rate of DHCP messages sent to the DHCP protocol stack.

By default, the checking rate of DHCP messages sent to the DHCP protocol stack in the system view is 100 pps, and no checking rate of DHCP messages sent to the DHCP protocol stack is configured in the interface and VLAN view.

Format

In the system view:

dhcp check dhcp-rate rate [ vlan { vlan-id1 [ to vlan-id2 ] } &<1-10> ]

undo dhcp check dhcp-rate

In the interface view or VLAN view:

dhcp check dhcp-rate rate

undo dhcp check dhcp-rate

Parameters

Parameter

Description

Value

rate

Specifies the checking rate of DHCP messages sent to the DHCP protocol stack.

The value ranges from 1 to 100, in pps.

vlan { vlan-id1 [ to vlan-id2 ] }

Specifies the checking rate of DHCP messages sent from the specified VLAN to the DHCP protocol stack.

  • vlan-id1: specifies the ID of the first VLAN.
  • vlan-id2: specifies the ID of the last VLAN. vlan-id2 and vlan-id1 determine a VLAN ID range.
  • vlan-id1 is an integer that ranges from 1 to 4094.
  • vlan-id2 is an integer that ranges from 1 to 4094. vlan-id2 must be larger than vlan-id1.

Views

System view, VLAN view, interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

After DHCP message checking is enabled, set the checking rate of DHCP messages sent to the DHCP protocol stack. In a period of time, only a certain number of DHCP messages can be sent to the DHCP protocol stack. The DHCP messages that exceed the rate are discarded.

Prerequisites

DHCP message checking has been enabled by using the dhcp check dhcp-rate enable command.

Precautions

You can set the checking rate of DHCP messages sent to the DHCP protocol stack in the system view, interface view, or VLAN view. The checking rates configured in the interface view, VLAN view, and system view take effect in descending order of priority.

If you run the dhcp check dhcp-rate rate command only in the system view, the checking rate of DHCP messages sent to the DHCP protocol stack in the VLAN view and interface view is the same as that configured in the system view.

The interfaces supporting this command include Layer 2 GE interfaces, Layer 2 Ethernet interface, Layer 2 Eth-Trunk interfaces, Layer 2 port group, Layer 3 GE interfaces, and Layer 3 Ethernet interface.

Example

# Set the checking rate of DHCP messages to 50 pps.

<Huawei> system-view
[Huawei] dhcp enable
[Huawei] dhcp check dhcp-rate 50

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.

NOTE:

When the device functions as the DHCP client, the lease cannot be shorter than 8 seconds. Otherwise, some packets are discarded. Therefore, the lease configured on the peer end DHCP server cannot be shorter than 8 seconds.

Example

# Set the expected lease to 7200s on GE0/0/1.

<Huawei> system-view
[Huawei] interface gigabitethernet 0/0/1
[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 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] dhcp client gateway-detect period 3600 retransmit 3 timeout 500

dhcp client default-route preference

Function

The dhcp client default-route preference command sets the priority of routing entries that a DHCP server delivers to a DHCP client.

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

By default, the priority of routing entries 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 priority of the routing protocol.

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

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

This command is used on DHCP clients. After receiving a Request packet form a DHCP client, the DHCP server allocates an IP address and other network configuration parameters to the DHCP client. In addition, the DHCP server delivers routing entries to the DHCP client to dynamically update the routing table of the DHCP client.

The dhcp client default-route preference command sets the priority of routing entries that a DHCP server delivers to a DHCP client.

Example

# Set the priority of routing entries that a DHCP server delivers to a DHCP client to 30.

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

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 GE0/0/1.

<Huawei> system-view
[Huawei] interface gigabitethernet 0/0/1
[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.

The configuration data of the Option60 field is stored in flash:/dhcp-client.options. Therefore, the Flash memory must have at least 80-byte available space.

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 GE0/0/1.

<Huawei> system-view
[Huawei] interface gigabitethernet 0/0/1
[Huawei-GigabitEthernet0/0/1] dhcp client client-id huawei_client

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 GE0/0/1.

<Huawei> system-view
[Huawei] interface gigabitethernet 0/0/1
[Huawei-GigabitEthernet0/0/1] dhcp client hostname huawei gateway

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.

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 is deleted. After DHCP is enabled again using the dhcp enable command, all DHCP-related configurations of the device are restored to the default configurations.

Follow-up Procedure

Configure DHCP relay, DHCP Client, and DHCP server functions.

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 name is a string of 1 to 31 case-sensitive characters without spaces.

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 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 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 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 ]

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 an existing VPN name.

Views

Interface view, system view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The dhcp relay release command applies to DHCP relay agents. In some situations, such as to log out a user, the DHCP relay agent sends a Request message to a specified DHCP server for releasing the IP address assigned to a DHCP client. After the DHCP server receives the Request message, it releases the specified IP address lease. 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.

Example

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

<Huawei> system-view
[Huawei] dhcp relay release 192.168.2.25 0050-ba34-2000 10.110.91.174

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 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 8 DHCP server addresses.

Example

# Configure DHCP relay on GE1/0/0 and add two DHCP server addresses.

<Huawei> system-view
[Huawei] dhcp enable
[Huawei] interface gigabitethernet 0/0/1
[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 enable 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.
  • Addresses of DHCP servers in a DHCP server group cannot be on the same network segment with addresses of interfaces enabled with DHCP relay.
  • 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.
  • The dhcp relay server-select command can only be used on Layer 3 interfaces, including Layer 3 GE interfaces, Layer 3 Ethernet interfaces, and Layer 3 Eth-Trunk interfaces.

Example

# 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] 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 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 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.

  • Before running the dhcp select global command, you need to run the ip address command to configure the interface IP address.

The dhcp select global command can only be used on Layer 3 interfaces, including Layer 3 GE interfaces, Layer 3 Ethernet interfaces, and Layer 3 Eth-Trunk interfaces.

Example

# 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] 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, an interface is disabled from using the interface address pool.

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 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] 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.

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.
  • After DHCP relay is enabled, run the dhcp relay server-select or dhcp relay server-ip commands on the interface to configure an IP address for the DHCP server, so that DHCP messages can be forwarded.
  • Before using the dhcp select relay command on a G.SHDSL or VDSL interface, ensure that the interface works in PTM mode.

Example

# 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] dhcp select relay

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 7.

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 eight DHCP servers. You can delete a DHCP server by specifying ip-address-index.
  • If a VPN instance is bound to an interface of the industrial switch router, 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 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 responds 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, the 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.

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 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 GE0/0/1.

<Huawei> system-view
[Huawei] dhcp enable
[Huawei] interface gigabitethernet 0/0/1
[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

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 300 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 command display dhcp server database to check the storage device for saving DHCP data. After the dhcp server database 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.

Example

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

<Huawei> system-view
[Huawei] dhcp server database enable
[Huawei] dhcp server database write-delay 36000

# 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>

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

Parameters

Parameter

Description

Value

ip-address &<1-8>

Specifies the IP address of a DNS server.

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

all

Deletes all the IP addresses of a DNS server.

-

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 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] 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

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 assigned to a DHCP client.

The value is a string of 1 to 63 characters without spaces. A combination of digits, letters, underscores (_), and dots (.) is allowed.

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

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

Example

# 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] 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 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 GE0/0/1.

<Huawei> system-view
[Huawei] dhcp enable
[Huawei] interface gigabitethernet 0/0/1
[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 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

This command applies to DHCP servers. In an address pool, some IP addresses need to be reserved for other services, and some are statically assigned to certain hosts (such as the WWW server), which cannot be automatically assigned to clients. You can run the dhcp server excluded-ip-address command to specify the IP address or range of the IP addresses that cannot be automatically assigned to clients from the address pool. The excluded-ip-address command specifies the IP addresses or range of the IP addresses that cannot be automatically assigned to clients from a 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.
  • 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 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] 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 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 64 DHCP server groups in the system, and a maximum of 8 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
 Info:It's successful to create a DHCP server group.

dhcp server import all

Function

The dhcp server import all command enables the device to automatically obtain the DNS server IP address, DNS domain name suffix, and NetBIOS server IP address from an interface address pool.

The undo dhcp server import all command disables the device from automatically obtaining the DNS server IP address, DNS domain name suffix, and NetBIOS server IP address from an interface address pool.

By default, the device is disabled from automatically obtaining the DNS server IP address, DNS domain name suffix, and NetBIOS server IP address from an interface address pool.

Format

dhcp server import all

undo dhcp server import all

Parameters

None

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command is used on the DHCP server. Run the dhcp server import all command on the DHCP server to automatically allocate the DNS server IP address, DNS domain name suffix, and NetBIOS server IP address from the carrier to the DHCP client.

Prerequisites

An interface address pool has been created.

Precautions

The dhcp server import all command can only be used on Layer 3 interfaces, including Layer 3 GE interfaces, Layer 3 Ethernet interfaces, and Layer 3 Eth-Trunk interfaces.

Example

# Enable the device to automatically obtain configurations of the DNS server and NetBIOS server from an interface address pool.

<Huawei> system-view
[Huawei] dhcp enable
[Huawei] interface gigabitethernet 0/0/1
[Huawei-GigabitEthernet0/0/1] dhcp select interface
[Huawei-GigabitEthernet0/0/1] dhcp server import all

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 or half 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.
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.

Example

# 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] 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

undo dhcp server logging

Parameters

None

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 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] ip address 10.1.1.2 24
[Huawei-GigabitEthernet0/0/1] dhcp select interface
[Huawei-GigabitEthernet0/0/1] dhcp server logging
Related Topics

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 GE0/0/1 are assigned to clients.

<Huawei> system-view
[Huawei] dhcp enable
[Huawei] interface gigabitethernet 0/0/1
[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 GE0/0/1 to p-node.

<Huawei> system-view 
[Huawei] dhcp enable
[Huawei] interface gigabitethernet 0/0/1
[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.

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 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, 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
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, 121 and 184.

There are well-known options and customized options. For details about well-known options, see RFC 2132.

NOTE:

The format of Option82, Option121 and Option184 are different from the other codes of a customized option.

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 1 to 255. If sub-option is specified, the even number is in the range of 1 to 253. 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 48 to 108 characters.

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

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 DNS service, 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 GE0/0/1.

<Huawei> system-view
[Huawei] dhcp enable
[Huawei] interface gigabitethernet 0/0/1
[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

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

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.

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 10 and the maximum response time to 100 ms.

<Huawei> system-view
[Huawei] dhcp enable
[Huawei] dhcp server ping packet 10
[Huawei] dhcp server ping timeout 100
Related Topics

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 GE0/0/1.

<Huawei> system-view
[Huawei] dhcp enable
[Huawei] interface gigabitethernet 0/0/1
[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

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.

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. If some special clients such as the web server need to be statically assigned a fixed IP address, run the dhcp server static-bind command to bind a fixed IP address to a client MAC addresses. When the DHCP server receives a request for an IP address from the specified DHCP client, the DHCP server assigns a fixed IP address that is bound to the DHCP client MAC address.

To bind IP addresses in a global address pool to MAC addresses, run the static-bind 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

  • Ensure that the bound IP address is not allocated by the DHCP server and is not configured as the IP address that cannot be allocated using the dhcp server excluded-ip-address command.
  • 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 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] 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 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 7-20 and Table 7-21 list the mapping between the DHCP packet rate and CPU/memory usage after dynamic rate limiting on DHCP packets is enabled.
Table 7-20  DHCP packet rate and CPU usage

CPU Usage (%)

DHCP Packet Rate (packets/second)

(70–85)

100

[85–100)

50

100

10

Table 7-21  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 client information.

Format

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

Parameters

Parameter

Description

Value

interface interface-type interface-number

Displays DHCP client 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 client, the display dhcp client statistics command displays DHCP client information.

Example

# Display DHCP client information.

<Huawei> display dhcp client
DHCP client lease information on interface GigabitEthernet0/0/1 :               
 Current machine state         : Bound                                          
 Internet address assigned via : DHCP                                           
 Physical address              : 0819-a6cd-a896                                 
 IP address                    : 192.168.1.254                                     
 Subnet mask                   : 255.255.255.0                                  
 Gateway ip address            : 192.168.1.2                                       
 DHCP server                   : 192.168.1.2                                       
 Lease obtained at             : 2013-06-26 07:40:22                            
 Lease expires at              : 2013-06-27 07:40:22                            
 Lease renews at               : 2013-06-26 19:40:22                            
 Lease rebinds at              : 2013-06-27 04:40:22   
Table 7-22  Description of the display dhcp client command output

Item

Description

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.

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/1 : 
Input: total 934 packets
  Bootp reply             :          0
  Offer                   :          1
  Ack                     :        933
  Nak                     :          0
Output: total 934 packets
  Bootp request           :          0
  Discover                :          1
  Request                 :        933
    Request of init-reboot  :          0
    Request of selecting  :          1
    Request of renewing   :        932
    Request of rebinding :          0
  Decline                 :          0
  Release                 :          0   
Table 7-23  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

None

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                                                   
  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 7-24  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.

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 an 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 information about a DHCP server on an interface.

Format

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

Parameters

Parameter

Description

Value

all

Displays information about the DHCP server groups configured on all interfaces.

-

interface interface-type interface-number

Displays information about the DHCP server 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

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

Example

# Display information about DHCP server groups configured 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

# Display information about the DHCP server group configured on VLANIF100.

<Huawei> display dhcp relay interface vlanif 100
 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 7-25  Description of the display dhcp relay all command output

Item

Description

Server group name

The group name of the DHCP Server.

Gateway address in use

IP address of the DHCP gateway in use.

Server IP address [x]

IP address of the DHCP server. The value x indicates the sequence in which a DHCP server was configured.

Table 7-26  Description of the display dhcp relay interface vlanif 100 command output

Item

Description

Server IP address [x]

IP address of the DHCP server. The value x indicates the sequence in which a DHCP server was configured.

Gateway address in use

IP address of the DHCP gateway in use.

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.

Follow-up Procedure

After detecting incorrect message statistics on a DHCP relay agent, run the reset dhcp relay statistics 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 7-27  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: enable
 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 7-28  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.

Related Topics

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 [ group-name ] 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 group1.

<Huawei> display dhcp server group group1
  Group-name          : group1
    Gateway           : 10.10.10.1
    VPN instance      : --   
Table 7-29  Description of the display dhcp server group command output

Item

Description

Group-name

Name of a DHCP server group.

To configure the name of a DHCP server group, run the dhcp server group command.

Gateway

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

To configure the gateway address of the DHCP server, run the gateway (DHCP server group view) command.

VPN instance

VPN instance to which the DHCP server group belongs.

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 7-30  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 7-31  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 information about the IP address pool configured on the device.

Format

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

display ip pool vpn-instance vpn-instance-name

Parameters

Parameter

Description

Value

interface interface-pool-name

Displays information about a specified interface address pool. The interface IP address pool name is represented by the type and number of an interface.

The value must be an existing interface address pool on the device.

name ip-pool-name

Displays information about a specified global address pool.

The value must be an existing global address pool on the device.

start-ip-address

Displays information about IP addresses with a specified start IP address in an address pool.

The value is in dotted decimal notation.

end-ip-address

Displays information about IP addresses with a specified end IP address in an address pool.

The value is in dotted decimal notation.

all

Displays information about all IP addresses in an address pool.

-

conflict

Displays information about conflicting IP addresses in an address pool.

-

expired

Displays information about expired and idle IP addresses in an address pool.

-

used

Displays information about used IP addresses in an address pool.

-

vpn-instance vpn-instance-name

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

The value must be an existing VPN instance on the device.

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

The display ip pool command displays information about the IP address pool configured on the device. If the address pool name is specified, you can view information about the address pool and the status and lease of IP addresses in the pool.

Example

# Display information about the IP address pool pool1.

<Huawei> display ip pool name pool1
  Pool-name      : pool1
  Pool-No        : 2
  Lease          : 3 Days 0 Hours 0 Minutes
  Domain-name    : -
  DNS-server0    : 192.168.10.5
  DNS-server1    : 192.168.10.6
  NBNS-server0   : 192.168.10.7
  Netbios-type   : -
  Position       : Local           Status           : Unlocked
  Gateway-0      : 10.10.10.10
  Network        : 10.1.1.0
  Mask           : 255.255.255.0
  VPN instance   : --
  Logging        : Enable


 -----------------------------------------------------------------------------
         Start           End     Total  Used  Idle(Expired)  Conflict  Disable
 -----------------------------------------------------------------------------
      10.10.10.1    10.10.10.254   254     0        254(0)         0        0
 ----------------------------------------------------------------------------- 
Table 7-32  Description of the display ip pool command output

Item

Description

Pool-name

Name of an IP address pool.

The value is set using the ip pool (system view) command.

Pool-No

Index of an IP address pool.

Lease

Lease of an IP address pool.

The value is set using the lease command.

Domain-name

Domain name.

The value is set using the domain-name command.

DNS-server0

DNS server address. Each IP address pool can be configured with a maximum of eight DNS server addresses. Values 0 and 1 indicate the first and second DNS server addresses respectively.

The value is set using the dns-list command.

NBNS-server0

Address of the NetBIOS server. Each IP address can be configured with a maximum of eight NetBIOS server addresses. The value 0 indicates the first NetBIOS server address.

The value is set using the nbns-list command.

Netbios-type

NetBIOS node type.

The value is set using the netbios-type command.

Position

Location of the IP address pool.

Status

Status of an address pool.

The value is set using the lock (Global address pool view) command.

Gateway-0

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

The value is set using the gateway-list command.

Network

Network segment of the IP address pool.

Mask

Subnet mask of the IP address pool.

The value is set using the network (Global address pool view) command.

VPN instance

Specifies the name of a VPN instance.

The value is set using the vpn-instance (Global address pool view) command.

Logging

Status of the logging function during IP address allocation of the DHCP server. The value can be:
  • Enable: indicate that the logging function during IP address allocation of the DHCP server is enabled.
  • Disable: indicates that the logging function during IP allocation of the DHCP server is disabled.

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

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 IP address pool.

The total number of IP addresses equals to the numbers of used, Idle(Expired), conflict, and disabled IP addresses.

Used

Number of used IP addresses in the IP address pool.

Idle(Expired)

Number of idle IP addresses in the address pool.

Conflict

Number of conflicting IP addresses in the address pool.

Disable

Number of disabled IP addresses in the IP address pool.

Related Topics

display ip pool import all

Function

The display ip pool import all commands displays DNS and NetBIOS configurations that a DHCP server automatically assigns to a DHCP client.

Format

display ip pool import all

Parameters

None

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

Run the import all command on the DHCP server to enable the DHCP server to automatically assign configurations of DNS server and NetBIOS server to DHCP clients. The display ip pool import all command displays configurations of DNS server and NetBIOS server that the DHCP server automatically assigns to DHCP clients.

Example

# Display DNS and NetBIOS configurations that the DHCP server automatically assigns to the DHCP client.

<Huawei> display ip pool import all
 -----------------------------------------------------------------------------  
 Parameter      Update time          Protocol  Value                             
 -----------------------------------------------------------------------------  
 domain-name     -                     -         -                                 
 dns-server      -                     -         -                                 
 nbns-server     -                     -         -                                 
 -----------------------------------------------------------------------------  
Table 7-33  Description of display ip pool import all command output

Item

Description

Parameter

Dynamically assigned information type:
  • domain-name: domain name information
  • dns-server: DNS server information
  • nbns-server: NetBIOS server information

To set the dynamically assigned information type, run the import all command.

Update time

Update time of dynamically assigned information.

Protocol

Protocol type of dynamically assigned information.

Value

Contents of dynamically assigned information.

dns-list

Function

The dns-list command configures the DNS server address for the DHCP client in the global address pool view or DHCP Option template view.

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

By default, no DNS server address is configured in the global address pool view and DHCP Option template view.

Format

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.

all

Deletes all DNS server addresses.

-

Views

Global 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 global 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 global 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 in the global address pool view or DHCP Option template view.

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

By default, no domain name suffix is configured in the global address pool view and DHCP Option template view.

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. Only when quotation marks are used around the string, spaces are allowed in the string.

Views

Global 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 command.

Example

# In the global address pool view, configure the domain name suffix assigned to the DHCP client as huawei.com.
<Huawei> system-view
[Huawei] ip pool pool1
[Huawei-ip-pool-pool1] domain-name huawei.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

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

Global 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

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

Global address pool view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command applies to DHCP servers. In an address pool, some IP addresses need to be reserved for other services, and some are statically assigned to certain hosts (such as the DNS server and WWW server), which cannot be automatically assigned to clients.
  • The excluded-ip-address command specifies the IP addresses or range of the IP addresses that cannot be automatically assigned to clients from a global address pool.
  • The dhcp server excluded-ip-address command specifies the IP addresses or range of the IP addresses that cannot be automatically assigned to clients from an interface address pool.

Prerequisites

Network segment addresses that can be assigned from the global address pool have been configured using the network (Global 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 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

gateway (DHCP server group view)

Function

The gateway command specifies an egress gateway address for a DHCP relay agent 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 industrial switch router 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 on the relay agent 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 in the global address pool view or DHCP Option template view.

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

By default, no egress gateway address is configured in the global address pool view and DHCP Option template view.

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

Global 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 global address pool view and DHCP Option template view, a device can be configured with a maximum of eight egress gateway addresses respectively. These gateway addresses cannot be subnet broadcast addresses.

Example

# In the global 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

import all

Function

The import all command enables the device to dynamically obtain the DNS server IP address, DNS domain name suffix, and NetBIOS server IP address from the global address pool.

The undo import all command disables the device from dynamically obtaining the DNS server IP address, DNS domain name suffix, and NetBIOS server IP address from the global address pool.

By default, the local is disabled from dynamically obtaining the DNS server IP address, DNS domain name suffix, and NetBIOS server IP address from the global address pool.

Format

import all

undo import all

Parameters

None

Views

Global address pool view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command is used on the DHCP server. Run the import all command on the DHCP server to automatically allocate the DNS server IP address, DNS domain name suffix, and NetBIOS server IP address from the carrier to the DHCP client.

Prerequisites

A global address pool has been created.

Precautions

The device functions as a DHCP client to obtain the DNS server IP address, DNS domain name suffix, and NetBIOS server IP address from the carrier, and then functions as the DHCP server to allocate obtained information to DHCP clients using this command. The device cannot allocate information obtained from the carrier using other methods to clients.

Example

# Enable the device to dynamically obtain configurations of DNS server and NetBIOS server from global address pool global.

<Huawei> system-view
[Huawei] ip pool global
[Huawei-ip-pool-global] import all

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, the DHCP server polling function is disabled on the 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 is enabled globally using the dhcp enable command.

Example

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

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

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 from an interface.

By default, the DHCP client function is disabled on the interface.

Format

ip address dhcp-alloc

undo ip address dhcp-alloc

Parameters

None

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

To enable an interface of the device 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 DCHP 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

Example

# Enable the DHCP client function on GigabitEthernet1/0/0 to obtain an IP address.

<Huawei> system-view
[Huawei] interface gigabitethernet 1/0/0
[Huawei-GigabitEthernet1/0/0] ip address dhcp-alloc

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

undo ip address bootp-alloc

Parameters

None

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 device 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 GE0/0/1 to obtain an IP address.

<Huawei> system-view
[Huawei] interface gigabitethernet 0/0/1
[Huawei-GigabitEthernet0/0/1] ip address bootp-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. A combination of digits, letters, underscores (_), and dots (.) is allowed.

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 an IP address pool and set parameters for the 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

If IP addresses in a global address pool are being used, the global address pool cannot be deleted.

Follow-up Procedure

Run the network (Global 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
 Info:It's successful to create an IP address pool.
[Huawei-ip-pool-global1] 

# Create a global address pool named ABC.

<Huawei> system-view
[Huawei] ip pool ABC
 Info:It's successful to create an IP address pool.
[Huawei-ip-pool-ABC] quit
[Huawei] ip pool abc
[Huawei-ip-pool-ABC] 

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 GE0/0/1 as the outbound interface for forwarding packets and 30 as the routing protocol priority.

<Huawei> system-view
[Huawei] ip route 1.1.1.1 24 gigabitethernet 0/0/1 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

Global 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 or half 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.

Prerequisites

A global IP address pool has been created using the ip pool (system view) command and the DHCP server function is enabled using the dhcp enable 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.

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

lock (Global 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 [ track nqa admin-name test-name ]

undo lock

Parameters

Parameter Description Value
track nqa admin-name test-name
Specifies the NQA test instance to be associated with the IP address pool.
  • admin-name: specifies the name of the administrator for the NQA test instance.
  • test-name: specifies the name of the NQA test instance.

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

Views

Global address pool view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command is used on a DHCP server. 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.

After track nqa admin-name test-name is specified, the device can function as the backup DHCP server, and its IP address pool is associated with NQA test instances to check the DHCP server status (including the link and DHCP server function). This improves network reliability. When the DHCP server is working properly, the IP address pool is locked, and users obtain IP addresses through the DHCP server. When NQA detects that the DHCP server is faulty, the IP address pool is unlocked and assigns IP addresses to newly online users. When NQA detects that the DHCP server fault is rectified, the IP address pool is locked again, and newly online users obtain IP addresses through the DHCP server.

An IP address pool can be associated with NQA test instances of the DHCP and ICMP types. According to the test mechanism, NQA test instances of the DHCP type are used to test whether the DHCP server function is normal; those of the ICMP type are used to test whether routes to the DHCP server are reachable. You can select one NQA test instance type based on the site requirements.

Prerequisites

Before specifying the NQA test instance to be associated with the IP address pool using track nqa admin-name test-name, perform the following operations and start the NQA test instance.
  • Configuring and starting an NQA test instance of the DHCP type
    1. Run the system-view command to enter the system view.

    2. Run the nqa test-instance admin-name test-name command to create an NQA test instance and enter the test instance view.

    3. Run the test-type dhcp command to configure the test type to DHCP.

    4. Run the source-interface interface-type interface-number command to specify the source interface for sending DHCP packets.

    5. Run the frequency interval command to set the automatic test interval for the NQA test instance.

    6. Run the start command to start the NQA test instance.

      An NQA test instance can be started immediately, at a specified time, or after a specified delay.

      • Run the start now [ end { at [ yyyy/mm/dd ] hh:mm:ss | delay { seconds second | hh:mm:ss } | lifetime { seconds second | hh:mm:ss } } ] command to start the test instance immediately.

      • Run the start at [ yyyy/mm/dd ] hh:mm:ss [ end { at [ yyyy/mm/dd ] hh:mm:ss | delay { seconds second | hh:mm:ss } | lifetime { seconds second | hh:mm:ss } } ] command to start the test instance at a specified time.

      • Run the start delay { seconds second | hh:mm:ss } [ end { at [ yyyy/mm/dd ] hh:mm:ss | delay { seconds second | hh:mm:ss } | lifetime { seconds second | hh:mm:ss } } ] command to start the test instance after a specified delay.

  • Configuring and starting an NQA test instance of the ICMP type
    1. Run the system-view command to enter the system view.

    2. Run the nqa test-instance admin-name test-name command to create an NQA test instance and enter the test instance view.

    3. Run the test-type icmp command to configure the test type to ICMP.

    4. Run the destination-address ipv4 ipv4-address command to configure the destination IP address.

    5. Run the frequency interval command to set the automatic test interval for the NQA test instance.

    6. Run the start command to start the NQA test instance.

      An NQA test instance can be started immediately, at a specified time, or after a specified delay.

      • Run the start now [ end { at [ yyyy/mm/dd ] hh:mm:ss | delay { seconds second | hh:mm:ss } | lifetime { seconds second | hh:mm:ss } } ] command to start the test instance immediately.

      • Run the start at [ yyyy/mm/dd ] hh:mm:ss [ end { at [ yyyy/mm/dd ] hh:mm:ss | delay { seconds second | hh:mm:ss } | lifetime { seconds second | hh:mm:ss } } ] command to start the test instance at a specified time.

      • Run the start delay { seconds second | hh:mm:ss } [ end { at [ yyyy/mm/dd ] hh:mm:ss | delay { seconds second | hh:mm:ss } | lifetime { seconds second | hh:mm:ss } } ] command to start the test instance after a specified delay.

Precautions

An IP address pool can be associated to only one NQA test instance. If you run the lock [ track nqa admin-name test-name ] command multiple times, the last configuration takes effect.

When the NQA test instance type is not DHCP and ICMP, the association between the IP address pool and NQA do not take effect. In this case, the IP address pool is locked.

Example

# Lock the IP address pool global1.

<Huawei> system-view
[Huawei] ip pool global1
[Huawei-ip-pool-global1] lock
# Configure an NQA test instance of the DHCP type and check whether the IP address pool global1 is locked according to the NQA detection result.
<Huawei> system-view
[Huawei] nqa test-instance admin test
[Huawei-nqa-admin-test] test-type dhcp
[Huawei-nqa-admin-test] source-interface gigabitethernet 0/0/1
[Huawei-nqa-admin-test] start now
[Huawei-nqa-admin-test] quit
[Huawei] ip pool global1
[Huawei-ip-pool-global1] lock track nqa admin test
Related Topics

logging

Function

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

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

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

Format

logging

undo logging

Parameters

None

Views

Global 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-pool1] logging
Related Topics

network (Global 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

Global 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.

If IP addresses in an IP address pool are being used, the IP address pool cannot be deleted.

The size of the IP address pool cannot be larger than 64K.

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

nbns-list

Function

The nbns-list command configures the NetBIOS server address for the DHCP client in the global address pool view or DHCP Option template view.

The undo nbns-list command deletes a configured NetBIOS server address.

By default, no NetBIOS server address is configured in the global address pool view and DHCP Option template view.

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

Global 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 global 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 global address pool view, set the IP address of the NetBIOS server to 10.1.1.1.

<Huawei> system-view
[Huawei] ip pool global1
[Huawei-ip-pool-global1] nbns-list 10.1.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 in the global address pool view or DHCP Option template view.

The undo netbios-type command deletes a configured NetBIOS node type.

By default, no NetBIOS node type for the DHCP client is configured in the global address pool view and DHCP Option template view.

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

Global 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.

Precautions

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

Example

# In the global 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

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 in the Global address pool view or DHCP Option template view.

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 in the global address pool view and DHCP Option template view.

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

Global 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 global 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 global 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.

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 48 to 108 characters.

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

Global address pool 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.

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

option121

Function

The option121 command configures the classless static route for the DHCP client in the global address pool view or DHCP Option template view.

The undo option121 command deletes a configured classless static route.

By default, no classless static route is configured in the global address pool view and DHCP Option template view.

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

Global 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 global 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 in the global address pool view or DHCP Option template view.

The undo option184 command deletes a configuration in the Option 184 field.

By default, no content in the Option 184 field is configured in the global address pool view and DHCP Option template view.

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

Global 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 global address pool view, configure the Option 184 field.

<Huawei> system-view
[Huawei] ip pool global1
[Huawei-ip-pool-global1] option184 as-ip 10.10.10.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. If no DHCP server group name is specified, message statistics on all the DHCP servers are cleared.

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 command to clear original statistics on DHCP messages, and run the display dhcp relay statistics command to view packet statistics about the DHCP relay agent.
  • If you only need to clear statistics on a specified DHCP server group, specify the name of a specified DHCP server group.
  • If no DHCP server group name is specified, message statistics on all the DHCP servers are cleared.

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 } { low-ip-address [ high-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.

low-ip-address

Specifies the start IP address of the IP address pool to be reset.

The value is in dotted decimal notation.

high-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

After the reset ip pool command is run, a user may be disconnected if its IP address is within the address range specified in this command.

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

reset ip pool import

Function

The reset ip pool import command clears the DNS and NetBIOS configurations dynamically obtained by an address pool.

Format

reset ip pool import { all | dns | domain-name | nbns }

Parameters

Parameter

Description

Value

all

Indicates that all the configurations dynamically obtained by the address pool need to be reset.

-

dns

Indicates that the DNS configurations dynamically obtained by the address pool need to be reset.

-

domain-name

Indicates that the domain-name configurations dynamically obtained by the address pool need to be reset.

-

nbns

Indicates that the NBNS configurations dynamically obtained by the address pool need to be reset.

-

Views

User view

Default Level

3: Management level

Usage Guidelines

This command applies to DHCP servers. When the DNS and NetBIOS configurations dynamically obtained by an address pool are incorrect, run the reset ip pool import all command to clear the obtained configurations before recollecting the DNS and NetBIOS configurations.

Example

# Clear the DNS and NetBIOS configurations dynamically obtained by an address pool.

<Huawei> reset ip pool import all
Warning: The network configuration parameters imported from center server will
be clean up. Continue? [Y/N]y

sname

Function

The sname command configures the name of the server from which the DHCP client obtains the startup configuration file in the global address pool view or DHCP option template view.

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 in the global address pool view or DHCP option template view.

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

Global 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 global address pool view, configure the name of the server from which the DHCP client obtains the startup configuration file as Huawei.

<Huawei> system-view
[Huawei] ip pool p1
[Huawei-ip-pool-p1] sname Huawei
# 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

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, an 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 ]

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 valid 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.

Views

Global 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. If some special clients such as the web server need to be statically assigned a fixed IP address, run the static-bind command to bind a fixed IP address to the MAC address of the client. When the DHCP server receives a Request message for applying for an IP address from a special client, the server assigns the fixed IP address bound to the MAC address of the client to this client. To bind IP addresses in an interface address pool to MAC addresses, run the dhcp server static-bind command.

Prerequisites

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

Precautions

  • Ensure that the bound IP address is not allocated by the DHCP server and is not configured as the IP address that cannot be allocated using the excluded-ip-address command.
  • 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.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 10.10.10.0 mask 24
[Huawei-ip-pool-global1] static-bind ip-address 10.10.10.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.

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 on the device.

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.

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 on the device.

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] route-distinguisher 22:1
[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-05-29

Document ID: EDOC1000097293

Views: 90177

Downloads: 124

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next