- Table of Contents
-
- 04-Layer 3 Command Reference
- 00-Preface
- 01-Basic IP Routing Commands
- 02-Static Routing Commands
- 03-IPv6 Static Routing Commands
- 04-IP Addressing Commands
- 05-IPv6 Basics Commands
- 06-DHCP Commands
- 07-DHCPv6 Commands
- 08-DNS Commands
- 09-IPv6 DNS Commands
- 10-IP Performance Optimization Commands
- 11-ARP Commands
- 12-IP Forwarding Basics Commands
- 13-NAT Commands
- Related Documents
-
Title | Size | Download |
---|---|---|
06-DHCP Commands | 225.85 KB |
DHCP server configuration commands·
dhcp select server global-pool
dhcp server client-detect enable
dhcp server relay information enable
display dhcp server forbidden-ip
display dhcp server statistics
DHCP client configuration commands·
bims-server
Use bims-server to specify the IP address, port number, and shared key of the BIMS server in a DHCP address pool.
Use undo bims-server to remove the specified BIMS server information.
Syntax
bims-server ip ip-address [ port port-number ] sharekey [ cipher | simple ] key
undo bims-server
Default
No BIMS server information is specified.
Views
DHCP address pool view
Default command level
2: System level
Parameters
ip ip-address: Specifies the IP address of the BIMS server.
port port-number: Specifies the port number of the BIMS server in the range of 1 to 65534.
cipher: Sets a ciphertext key.
simple: Sets a plaintext key.
key: Specifies the key string. This argument is case sensitive. If simple is specified, it must be a string of 1 to 16 characters. If cipher is specified, it must be a ciphertext string of 1 to 53 characters. If neither cipher nor simple is specified, you set a plaintext key string.
Usage guidelines
If you execute this command repeatedly, only the last configuration takes effect.
All passwords, configured in either plaintext or ciphertext, are saved in ciphertext.
Examples
# Specify the IP address 1.1.1.1, port number 80, shared key aabbcc of the BIMS server in DHCP address pool 0 for the client.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0
[Sysname-dhcp-pool-0] bims-server ip 1.1.1.1 port 80 sharekey simple aabbcc
· dhcp server ip-pool
· display dhcp server tree
bootfile-name
Use bootfile-name to specify a bootfile name in a DHCP address pool.
Use undo bootfile-name to remove the specified bootfile name.
Syntax
bootfile-name bootfile-name
undo bootfile-name
Default
No bootfile name is specified.
Views
DHCP address pool view
Default command level
2: System level
Parameters
bootfile-name: Boot file name, a string of 1 to 63 characters.
Usage guidelines
If you execute the bootfile-name command repeatedly, only the last configuration takes effect.
Examples
# Specify the bootfile name aaa.cfg in DHCP address pool 0.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0
[Sysname-dhcp-pool-0] bootfile-name aaa.cfg
· dhcp server ip-pool
· display dhcp server tree
dhcp enable (for DHCP server)
Use dhcp enable to enable DHCP.
Use undo dhcp enable to disable DHCP.
Syntax
dhcp enable
undo dhcp enable
Default
DHCP is disabled.
Views
System view
Default command level
2: System level
Usage guidelines
Enable DHCP before performing DHCP server or relay agent configurations.
Examples
# Enable DHCP.
<Sysname> system-view
[Sysname] dhcp enable
dhcp server apply ip-pool
Use dhcp server apply ip-pool to apply an address pool on an interface.
Use undo dhcp server apply ip-pool to remove the configuration.
Syntax
dhcp server apply ip-pool pool-name
undo dhcp server apply ip-pool [ pool-name ]
Default
No extended address pool is applied on an interface, and the server assigns an IP address from a common address pool to a client when the client's request arrives at the interface.
Views
Interface view
Default command level
2: System level
Parameters
pool-name: Specifies the name of a DHCP address pool, a case-insensitive string of 1 to 35 characters.
Usage guidelines
If you execute the dhcp server apply ip-pool command on an interface, when a client's request arrives at the interface, the server attempts to assign the client the statically bound IP address first, and then an IP address from this extended address pool.
Only an extended address pool can be applied on an interface. The address pool to be referenced must already exist.
Examples
# Apply extended DHCP address pool 0 on VLAN-interface 1.
<Sysname> system-view
[Sysname] interface vlan-interface 1
[Sysname-Vlan-interface1] dhcp server apply ip-pool 0
Related commands
dhcp server ip-pool
dhcp select server global-pool
Use dhcp select server global-pool to enable the DHCP server on an interface. After the interface receives a DHCP request from a client, the DHCP server allocates an IP address from the address pool.
Use undo dhcp select server global-pool to remove the configuration. Upon receiving a DHCP request from a client, the interface neither assigns an IP address to the client, nor serves as a DHCP relay agent to forward the request.
Syntax
dhcp select server global-pool [ subaddress ]
undo dhcp select server global-pool [ subaddress ]
Default
The DHCP server is enabled on an interface when DHCP is enabled.
Views
Interface view
Default command level
2: System level
Parameters
subaddress: Supports secondary address allocation. When the DHCP server and client are on the same network segment, the server preferably assigns an IP address from an address pool that resides on the same subnet as the primary IP address of the server interface (connecting to the client).
· If the address pool contains no assignable IP address, the server assigns an IP address from an address pool that resides on the same subnet as the secondary IP addresses of the server interface.
· If the interface has multiple secondary IP addresses, each address pool is tried in turn for address allocation.
Usage guidelines
Use the undo dhcp select server global-pool subaddress command to disable the support for secondary address allocation.
If the subaddress keyword is not specified, the DHCP server can only assign an IP address from the address pool that resides on the same subnet as the primary IP address of the server interface.
Examples
· On a router
# Enable the DHCP server on Ethernet 1/1 to assign IP addresses from the address pool that resides on the same subnet as the primary IP address of the server interface (connecting to the client) for the client.
<Sysname> system-view
[Sysname] interface ethernet 1/1
[Sysname-Ethernet1/1] dhcp select server global-pool
· On a switch
# Enable the DHCP server on VLAN-interface 1 to assign IP addresses from the address pool that resides on the same subnet as the primary IP address of the server interface (connecting to the client) for the client.
<Sysname> system-view
[Sysname] interface vlan-interface 1
[Sysname-Vlan-interface1] dhcp select server global-pool
dhcp server client-detect enable
Use dhcp server client-detect enable to enable client offline detection on the DHCP server.
Use undo dhcp server client-detect enable to disable the function.
Syntax
dhcp server client-detect enable
undo dhcp server client-detect enable
Default
The function is disabled.
Views
Interface view
Default command level
2: System level
Usage guidelines
With this feature enabled, the DHCP server considers that a DHCP client goes offline when the ARP entry for the client ages out. In addition, it removes the client entry and releases the IP address of the client.
Examples
# Enable client offline detection on the DHCP server.
<Sysname> system-view
[Sysname] interface vlan-interface 1
[Sysname-Vlan-interface1] dhcp server client-detect enable
dhcp server detect
Use dhcp server detect to enable unauthorized DHCP server detection.
Use undo dhcp server detect to disable the function.
Syntax
dhcp server detect
undo dhcp server detect
Default
The function is disabled.
Views
System view
Default command level
2: System level
Usage guidelines
With this function enabled, upon receiving a DHCP request, the DHCP server records the IP addresses of DHCP servers that offered IP addresses to the DHCP client and the receiving interface. Each detected server is recorded only once. The administrator can use this information to check for unauthorized DHCP servers.
Examples
# Enable unauthorized DHCP server detection.
<Sysname> system-view
[Sysname] dhcp server detect
dhcp server forbidden-ip
Use dhcp server forbidden-ip to exclude specific IP addresses from dynamic allocation.
Use undo dhcp server forbidden-ip to remove the configuration.
Syntax
dhcp server forbidden-ip low-ip-address [ high-ip-address ]
undo dhcp server forbidden-ip low-ip-address [ high-ip-address ]
Default
All IP addresses in a DHCP address pool are assignable except IP addresses of the DHCP server interfaces.
Views
System view
Default command level
2: System level
Parameters
low-ip-address: Specifies the start IP address.
high-ip-address: Specifies the end IP address, which must have a higher sequence than the start one.
Usage guidelines
When you use the dhcp server forbidden-ip command to exclude an IP address that is bound to a user from dynamic assignment, the address can be still assigned to the user.
When you use the undo dhcp server forbidden-ip command to remove the configuration, the specified address/address range must be consistent with the one specified with the dhcp server forbidden-ip command. If you have configured to exclude an address range from dynamic assignment, you need to specify the same address range in the undo dhcp server forbidden-ip command instead of specifying one IP address.
Using the dhcp server forbidden-ip command repeatedly can exclude multiple IP address ranges from allocation.
Examples
# Exclude the IP addresses 10.110.1.1 through 10.110.1.63 from dynamic allocation.
<Sysname> system-view
[Sysname] dhcp server forbidden-ip 10.110.1.1 10.110.1.63
· display dhcp server forbidden-ip
· dhcp server ip-pool
· network
· static-bind ip-address
dhcp server ip-pool
Use dhcp server ip-pool to create a DHCP address pool and enter its view. If the pool has been created, you directly enter its view.
Use undo dhcp server ip-pool to remove the specified DHCP address pool.
Syntax
dhcp server ip-pool pool-name [ extended ]
undo dhcp server ip-pool pool-name
Default
No DHCP address pool is created.
Views
System view
Default command level
2: System level
Parameters
pool-name: Specifies the name for the global address pool, a string of 1 to 35 characters used to uniquely identify this pool.
extended: Specifies the address pool as an extended address pool. If this keyword is not specified, the address pool is a common address pool.
Examples
# Create the common address pool identified by 0.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0
[Sysname-dhcp-pool-0]
· dhcp enable
· display dhcp server tree
dhcp server ping packets
Use dhcp server ping packets to specify the maximum number of ping packets.
Use undo dhcp server ping packets to restore the default.
Syntax
dhcp server ping packets number
undo dhcp server ping packets
Default
The maximum number of ping packets is 1.
Views
System view
Default command level
2: System level
Parameters
number: Specifies the maximum number of ping packets, in the range of 0 to 10. The value of 0 means that the DHCP server does not perform address conflict detection.
Usage guidelines
To avoid IP address conflicts, the DHCP server checks whether an IP address is in use before assigning it to a DHCP client.
The DHCP server pings the IP address. If the server gets a response within the specified period, the server believes that the IP address is in use, selects and pings another IP address. If not, the server pings the IP address again until the maximum number of ping packets are sent. If still no response is received, the server assigns the IP address to the requesting client.
Examples
# Specify the maximum number of ping packets as 10.
<Sysname> system-view
[Sysname] dhcp server ping packets 10
dhcp server ping timeout
Use dhcp server ping timeout to configure the ping response timeout time on the DHCP server.
Use undo dhcp server ping timeout to restore the default.
Syntax
dhcp server ping timeout milliseconds
undo dhcp server ping timeout
Default
The ping response timeout time is 500 ms.
Views
System view
Default command level
2: System level
Parameters
milliseconds: Specifies the timeout time, in the range of 0 to 10000 milliseconds. The value of 0 means that no ping operation is performed for address conflict detection.
Usage guidelines
To avoid IP address conflicts, the DHCP server checks whether an IP address is in use before assigning it to a DHCP client.
The DHCP server pings the IP address. If the server gets a response within the specified interval, it believes that the IP address is in use, and selects and pings another IP address. If not, the server pings the IP address again until the maximum number of ping packets are sent. If still no response is received, the server assigns the IP address to the requesting client.
Examples
# Specify the response timeout time as 1000 ms.
<Sysname> system-view
[Sysname] dhcp server ping timeout 1000
dhcp server relay information enable
Use dhcp server relay information enable to enable the DHCP server to handle Option 82.
Use undo dhcp server relay information enable to configure the DHCP server to ignore Option 82.
Syntax
dhcp server relay information enable
undo dhcp server relay information enable
Default
The DHCP server handles Option 82.
Views
System view
Default command level
2: System level
Examples
# Configure the DHCP server to ignore Option 82.
<Sysname> system-view
[Sysname] undo dhcp server relay information enable
dhcp server threshold
Use dhcp server threshold to enable the DHCP server to send trap messages to the network management server when the specified threshold is reached.
Use undo dhcp server threshold to restore the default.
Syntax
dhcp server threshold { allocated-ip threshold-value | average-ip-use threshold-value | max-ip-use threshold-value | success-rate threshold-value }
undo dhcp server threshold { allocated-ip | average-ip-use | max-ip-use | success-rate }
Default
The DHCP server does not send trap messages to the network management server.
Views
System view
Default command level
2: System level
Parameters
allocated-ip threshold-value: Enables the DHCP server to send trap messages to the network management server when the ratio of successfully allocated IP addresses to received DHCP requests within five minutes reaches the threshold specified by the threshold-value argument. The threshold is a percentage value ranging from 1 to 100.
average-ip-use threshold-value: Enables the DHCP server to send trap messages to the network management server when the average IP address utilization of an address pool within five minutes reaches the threshold specified by the threshold-value argument. The threshold is a percentage value ranging from 1 to 100.
max-ip-use threshold-value: Enables the DHCP server to send trap messages to the network management server when the maximum IP address utilization of an address pool within five minutes reaches the threshold specified by the threshold-value argument. The threshold is a percentage value ranging from 1 to 100.
success-rate threshold-value: Enables the DHCP server to send trap messages to the network management server when the ratio of successfully allocated IP addresses in an address pool within five minutes reaches the threshold specified by the threshold-value argument. The threshold is a permillage value ranging from 500 to 1000.
Examples
# Enable the DHCP server to send trap messages to the network management server when the ratio of successfully allocated IP addresses to received DHCP requests within five minutes reaches 50%.
<Sysname> system-view
[Sysname] dhcp server threshold allocated-ip 50
# Enable the DHCP server to send trap messages to the network management server when the average IP address utilization of an address pool within five minutes reaches 80%.
<Sysname> system-view
[Sysname] dhcp server threshold average-ip-use 80
# Enable the DHCP server to send trap messages to the network management server when the maximum IP address utilization of an address pool within five minutes reaches 80%.
<Sysname> system-view
[Sysname] dhcp server threshold max-ip-use 80
# Enable the DHCP server to send trap messages to the network management server when the ratio of successfully allocated IP addresses in an address pool within five minutes reaches 900‰.
<Sysname> system-view
[Sysname] dhcp server threshold success-rate 900
display dhcp server conflict
Use display dhcp server conflict to display information about IP address conflicts.
Syntax
display dhcp server conflict { all | ip ip-address } [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command level
1: Monitor level
Parameters
all: Displays information about all IP address conflicts.
ip-address: Displays conflict information for the specified IP address. If no IP address is specified, this command displays information about all IP address conflicts.
|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Examples
# Display information about all IP address conflicts.
<Sysname> display dhcp server conflict all
Address Discover time
4.4.4.1 Apr 25 2007 16:57:20
4.4.4.2 Apr 25 2007 17:00:10
--- total 2 entry ---
Table 1 Command output
Field |
Description |
Address |
Conflicted IP address. |
Discover Time |
Time when the conflict was discovered. |
reset dhcp server conflict
display dhcp server expired
Use display dhcp server expired to display the lease expiration information.
Syntax
display dhcp server expired { all | ip ip-address | pool [ pool-name ] } [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command level
1: Monitor level
Parameters
all: Displays the lease expiration information of all DHCP address pools.
ip ip-address: Displays the lease expiration information for the specified IP address.
pool [ pool-name ]: Displays the lease expiration information for the specified address pool. The pool name is a string of 1 to 35 characters. If the pool name is not specified, the lease expiration information of all address pools is displayed.
|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Usage guidelines
DHCP assigns these expired IP addresses to DHCP clients when all available addresses have been assigned.
Examples
# Display all lease expiration information.
<Sysname> display dhcp server expired all
IP address Client-identifier/ Lease expiration Type
Hardware address
4.4.4.6 3030-3066-2e65-3230- Apr 25 2007 17:10:47 Release
302e-3130-3234-2d45-
7468-6572-6e65-7430-
2f31
--- total 1 entry ---
Table 2 Command output
Field |
Description |
IP address |
Expired IP address. |
Client-identifier/Hardware address |
Client ID or MAC address. |
Lease expiration |
Time when the lease expired. |
Type |
Types of lease expirations. This field is set to Release. |
display dhcp server free-ip
Use display dhcp server free-ip to display information about assignable IP addresses.
Syntax
display dhcp server free-ip [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command level
1: Monitor level
Parameters
|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Examples
# Display information about assignable IP addresses.
<Sysname> display dhcp server free-ip
IP Range from 10.0.0.1 to 10.0.0.254
display dhcp server forbidden-ip
Use display dhcp server forbidden-ip to display IP addresses excluded from dynamic allocation in DHCP address pool.
Syntax
display dhcp server forbidden-ip [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command level
1: Monitor level
Parameters
|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Examples
# Display IP addresses excluded from dynamic allocation in the DHCP address pool.
<Sysname> display dhcp server forbidden-ip
Global:
IP Range from 1.1.0.2 to 1.1.0.3
IP Range from 1.1.1.2 to 1.1.1.3
Pool name: 2
1.1.1.5 1.1.1.6
Table 3 Command output
Field |
Description |
Global |
Globally excluded IP addresses specified with the dhcp server forbidden-ip command in system view. No address pool can assign these IP addresses. |
Pool name |
Excluded IP addresses specified with the forbidden-ip command in DHCP address pool view. They cannot be assigned from the current extended address pool. |
display dhcp server ip-in-use
Use display dhcp server ip-in-use to display the binding information of DHCP address pools or an IP address.
Syntax
display dhcp server ip-in-use { all | ip ip-address | pool [ pool-name ] } [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command level
1: Monitor level
Parameters
all: Displays the binding information for all DHCP address pools.
ip ip-address: Displays the binding information for the specified IP address.
pool [ pool-name ]: Displays the binding information for the specified IP address pool. The pool name is a string of 1 to 35 characters. If no pool name is specified, the binding information of all address pools is displayed.
|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Usage guidelines
In the command output, the lease duration of a used static binding is displayed as Unlimited instead of the actual lease duration. To view the actual lease duration, use the display this command in DHCP address pool view.
Examples
# Display the binding information of all DHCP address pools.
<Sysname> display dhcp server ip-in-use all
Pool utilization: 0.39%
IP address Client-identifier/ Lease expiration Type
Hardware address
10.1.1.1 4444-4444-4444 NOT Used Manual
10.1.1.2 3030-3030-2e30-3030- May 1 2009 14:02:49 Auto:COMMITTED
662e-3030-3033-2d45-
7468-6572-6e65-7430-
2f31
--- total 2 entry ---
Table 4 Command output
Field |
Description |
Pool utilization |
Utilization rate of IP addresses in a DHCP address pool, which is the ratio of assigned IP addresses to assignable IP addresses in the DHCP address pool. · When the binding information of all DHCP address pools is displayed, this field displays the total utilization rate of IP addresses in all DHCP address pools. · When the binding information of a specific DHCP address pool is displayed, this field displays the utilization rate of IP addresses in the DHCP address pool. · When the binding information of a specific IP address is displayed, this field is not displayed. |
IP address |
Bound IP address. |
Client-identifier/Hardware address |
Client's ID or MAC of the binding. |
Lease expiration |
Lease expiration time, which can be: · Specific time (May 1 2009 14:02:49 in this example)—Time when the lease expires. · NOT Used—The IP address of the static binding has not been assigned to the specific client. · Unlimited—Infinite lease expiration time. |
Type |
Binding types, including: · Manual—Static binding. · Auto:OFFERED—The binding sent in the DHCP-OFFER message from the server to the client. · Auto:COMMITTED—The binding sent in the DHCP-ACK message from the server to the client. |
reset dhcp server ip-in-use
display dhcp server statistics
Use display dhcp server statistics to display the statistics of the DHCP server.
Syntax
display dhcp server statistics [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command level
1: Monitor level
Parameters
|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Examples
# Display the statistics on the DHCP server.
<Sysname> display dhcp server statistics
Global Pool:
Pool Number: 1
Binding:
Auto: 1
Manual: 0
Expire: 0
BOOTP Request: 10
DHCPDISCOVER: 5
DHCPREQUEST: 3
DHCPDECLINE: 0
DHCPRELEASE: 2
DHCPINFORM: 0
BOOTPREQUEST: 0
BOOTP Reply: 6
DHCPOFFER: 3
DHCPACK: 3
DHCPNAK: 0
BOOTPREPLY: 0
Bad Messages: 0
Table 5 Command output
Field |
Description |
Global Pool |
Statistics of a DHCP address pool. |
Pool Number |
Number of address pools. |
Auto |
Number of dynamic bindings. |
Manual |
Number of static bindings. |
Expire |
Number of expired bindings. |
BOOTP Request |
DHCP packets received from clients, including: · DHCPDISCOVER. · DHCPREQUEST. · DHCPDECLINE. · DHCPRELEASE. · DHCPINFORM. · BOOTPREQUEST. |
BOOTP Reply |
DHCP packets sent to clients, including: · DHCPOFFER. · DHCPACK. · DHCPNAK. · BOOTPREPLY. |
Bad Messages |
Number of bad messages. |
reset dhcp server statistics
display dhcp server tree
Use display dhcp server tree to display information of DHCP address pools.
Syntax
display dhcp server tree { all | pool [ pool-name ] } [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command level
1: Monitor level
Parameters
all: Displays information of all DHCP address pools.
pool [ pool-name ]: Displays information of a specified address pool. The pool name argument is a string of 1 to 35 characters. If no pool name is specified, information of all address pools is displayed.
|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Examples
# Display information of all DHCP address pools.
<Sysname> display dhcp server tree all
Global pool:
Pool name: 0
network 20.1.1.0 mask 255.255.255.0
Sibling node:1
option 2 ip-address 1.1.1.1
expired 1 0 0 0
Pool name: 1
static-bind ip-address 10.10.1.2 mask 255.0.0.0
static-bind mac-address 00e0-00fc-0001
PrevSibling node:0
expired unlimited
Extended pool:
Pool name: 2
network ip range 1.1.1.0 1.1.1.255
network mask 255.255.255.0
expired 0 0 2 0
Table 6 Command output
Field |
Description |
Global pool |
Information of a common address pool. |
Pool name |
Address pool name. |
network |
Subnet for address allocation. |
static-bind ip-address 10.10.1.2 mask 255.0.0.0 static-bind mac-address 00e0-00fc-0001 |
IP address and MAC address of the static binding. |
Sibling node |
Sibling node of the current node. Nodes of this kind in the output information can be: · Child node—The child node (subnet segment) address pool of the current node. · Parent node—The parent node (nature network segment) address pool of the current node. · Sibling node—The latter sibling node of the current node (another subnet of the same nature network). The earlier the sibling node is configured, the higher order the sibling node has. · PrevSibling node—The previous sibling node of the current node. |
option |
Self-defined DHCP options. |
expired |
Lease duration, in the format of day, hour, minute, and second. |
Extended pool |
Information of an extended address pool. |
network ip range |
Range of assignable IP addresses in the extended address pool. |
network mask |
Mask of IP addresses assigned from the extended address pool. |
dns-list
Use dns-list to specify DNS server addresses in a DHCP address pool.
Use undo dns-list to remove DNS server addresses from a DHCP address pool.
Syntax
dns-list ip-address&<1-8>
undo dns-list { ip-address | all }
Default
No DNS server address is specified.
Views
DHCP address pool view
Default command level
2: System level
Parameters
ip-address&<1-8>: Specifies DNS servers. &<1-8> means you can specify up to eight DNS server addresses separated by spaces.
all: Specifies all DNS server addresses to be removed.
Usage guidelines
If you execute the dns-list command repeatedly, only the last configuration takes effect.
Examples
# Specify the DNS server address 10.1.1.254 for the DHCP client in DHCP address pool 0.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0
[Sysname-dhcp-pool-0] dns-list 10.1.1.254
· dhcp server ip-pool
· display dhcp server tree
domain-name
Use domain-name to specify a domain name in a DHCP address pool.
Use undo domain-name to remove the specified domain name.
Syntax
domain-name domain-name
undo domain-name
Default
No domain name suffix is specified.
Views
DHCP address pool view
Default command level
2: System level
Parameters
domain-name: Specifies the domain name, a string of 1 to 50 characters.
Examples
# Specify the domain name mydomain.com in address pool 0.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0
[Sysname-dhcp-pool-0] domain-name mydomain.com
· dhcp server ip-pool
· display dhcp server tree
expired
Use expired to specify the lease duration in a DHCP address pool.
Use undo expired to restore the default lease duration for a DHCP address pool.
Syntax
expired { day day [ hour hour [ minute minute [ second second ] ] ] | unlimited }
undo expired
Default
The lease duration of a static address pool is unlimited, and the lease duration of a dynamic address pool is one day.
Views
DHCP address pool view
Default command level
2: System level
Parameters
day day: Specifies the number of days in the range of 0 to 365.
hour hour: Specifies the number of hours in the range of 0 to 23.
minute minute: Specifies the number of minutes in the range of 0 to 59.
second second: Specifies the number of seconds in the range of 0 to 59.
unlimited: Specifies the unlimited lease duration, which is actually 136 years.
Usage guidelines
The specified lease duration cannot be less than 5 seconds.
The specified lease duration takes effect for the static binding, but the lease duration displayed by the display dhcp server ip-in-use all command is still Unlimited.
Examples
# Specify the lease duration as one day, two hours, three minutes, and four seconds in DHCP address pool 0.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0
[Sysname-dhcp-pool-0] expired day 1 hour 2 minute 3 second 4
Related commands
· dhcp server ip-pool
· display dhcp server tree
forbidden-ip
Use forbidden-ip to exclude IP addresses from dynamic allocation in an extended address pool.
Use undo forbidden-ip to cancel specified or all excluded IP addresses.
Syntax
forbidden-ip ip-address&<1-8>
undo forbidden-ip { ip-address&<1-8> | all }
Default
All IP addresses in an extended address pool are assignable except the IP addresses of the DHCP server interfaces.
Views
DHCP extended address pool view
Default command level
2: System level
Parameters
ip-address&<1-8>: Specifies excluded IP addresses. &<1-8> indicates that you can specify up to eight IP addresses, separated by spaces.
all: Excludes all IP addresses from dynamic allocation.
Usage guidelines
Only the extended address pools support this command.
IP addresses specified with the forbidden-ip command in DHCP address pool view are excluded from dynamic address allocation in the current extended address pool only. They are assignable in other address pools.
Using the forbidden-ip command repeatedly, you can exclude multiple IP address ranges from dynamic allocation.
Examples
# Exclude IP addresses 192.168.1.3 and 192.168.1.10 from dynamic allocation for extended address pool 0.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0 extended
[Sysname-dhcp-pool-0] forbidden-ip 192.168.1.3 192.168.1.10
Related commands
· dhcp server ip-pool
· display dhcp server forbidden-ip
gateway-list
Use gateway-list to specify gateway addresses in a DHCP address pool.
Use undo gateway-list to remove specified gateway addresses specified for the DHCP client from a DHCP address pool.
Syntax
gateway-list ip-address&<1-8>
undo gateway-list { ip-address | all }
Default
No gateway address is specified.
Views
DHCP address pool view
Default command level
2: System level
Parameters
ip-address&<1-8>: Gateway IP address. &<1-8> means you can specify up to eight gateway addresses separated by spaces.
all: Specifies all gateway IP addresses to be removed.
Usage guidelines
If you use the gateway-list command repeatedly, only the last configuration takes effect.
Examples
# Specify the gateway address 10.110.1.99 in DHCP address pool 0.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0
[Sysname-dhcp-pool-0] gateway-list 10.110.1.99
· dhcp server ip-pool
· display dhcp server tree
nbns-list
Use nbns-list to specify WINS server addresses in a DHCP address pool.
Use undo nbns-list to remove the specified WINS server addresses.
Syntax
nbns-list ip-address&<1-8>
undo nbns-list { ip-address | all }
Default
No WINS server address is specified.
Views
DHCP address pool view
Default command level
2: System level
Parameters
ip-address&<1-8>: Specifies WINS server IP addresses. &<1-8> means you can specify up to eight WINS server addresses separated by spaces.
all: Specifies all WINS server addresses to be removed.
Usage guidelines
If you use the nbns-list command repeatedly, only the last configuration takes effect.
Examples
# Specify WINS server address 10.12.1.99 in DHCP address pool 0.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0
[Sysname-dhcp-pool-0] nbns-list 10.12.1.99
· dhcp server ip-pool
· netbios-type
· display dhcp server tree
netbios-type
Use netbios-type to specify the NetBIOS node type in a DHCP address pool.
Use undo netbios-type to remove the specified NetBIOS node type.
Syntax
netbios-type { b-node | h-node | m-node | p-node }
undo netbios-type
Default
No NetBIOS node type is specified.
Views
DHCP address pool view
Default command level
2: System level
Parameters
b-node: Specifies the broadcast node. A b-node client sends the destination name in a broadcast message to get the name-to-IP mapping from a server.
h-node: Specifies the hybrid node. An h-node client unicasts the destination name to a WINS server, and if receiving no response, then broadcasts it to get the mapping from a server.
m-node: Specifies the mixed node. An m-node client broadcasts the destination name, and if receiving no response, then unicasts the destination name to the WINS server to get the mapping.
p-node: Specifies the peer-to-peer node. A p-node client sends the destination name in a unicast message to get the mapping from the WINS server.
Examples
# Specify the NetBIOS node type as b-node in DHCP address pool 0.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0
[Sysname-dhcp-pool-0] netbios-type b-node
· dhcp server ip-pool
· nbns-list
· display dhcp server tree
network
Use network to specify the subnet for dynamic allocation in a DHCP address pool.
Use undo network to remove the specified subnet.
Syntax
network network-address [ mask-length | mask mask ]
undo network
Default
No subnet is specified.
Views
DHCP address pool view
Default command level
2: System level
Parameters
network-address: Subnet for dynamic allocation. If no mask length and mask is specified, the natural mask is used.
mask-length: Mask length in the range of 1 to 30.
mask mask: Specifies the IP address network mask in dotted decimal format.
Usage guidelines
You can specify only one subnet for each common address pool. If you use the network command repeatedly, only the last configuration takes effect.
Examples
# Specify 192.168.8.0/24 as the subnet for dynamic allocation in DHCP address pool 0.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0
[Sysname-dhcp-pool-0] network 192.168.8.0 mask 255.255.255.0
· dhcp server ip-pool
· display dhcp server tree
network ip range
Use network ip range to specify the IP address range for dynamic allocation in an address pool.
Use undo network ip range to remove the specified address range.
Syntax
network ip range min-address max-address
undo network ip range
Default
No IP address range is specified.
Views
DHCP address pool view
Default command level
2: System level
Parameters
min-address: Lowest IP address for dynamic allocation.
max-address: Highest IP address for dynamic allocation.
Usage guidelines
In a common address pool, you can use the network ip range command to further specify an IP address range on the subnet for address allocation. The specified IP address range must belong to the subnet; otherwise the common address pool cannot assign IP addresses.
You can specify only one IP address range for each address pool. If you use the network ip range command repeatedly, the latest configuration takes effect.
Examples
# Specify addresses 10.1.1.1 through 10.1.1.150 on subnet 10.1.1.0/24 for dynamic address allocation in common address pool 1.
<Sysname> system-view
[Sysname] dhcp server ip-pool 1
[Sysname-dhcp-pool-1] network 10.1.1.0 24
[Sysname-dhcp-pool-1] network ip range 10.1.1.1 10.1.1.150
# Specify addresses 192.168.8.1 through 192.168.8.150 for dynamic address allocation in extended address pool 0.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0 extended
[Sysname-dhcp-pool-0] network ip range 192.168.8.1 192.168.8.150
Related commands
· dhcp server ip-pool
· network
· display dhcp server tree
network mask
Use network mask to specify the IP address mask for dynamic allocation in an extended address pool.
Use undo network mask to remove the specified IP address mask.
Syntax
network mask mask
undo network mask
Default
No IP address mask is specified.
Views
DHCP extended address pool view
Default command level
2: System level
Parameters
mask: Network mask in dotted decimal notation.
Usage guidelines
Only the extended address pools support this command.
If you specify an IP address range for an extended address pool without an IP address mask, the extended address pool is not valid, and therefore the system cannot assign IP addresses from the extended address pool.
Examples
# Specify 255.255.255.0 as the IP address mask for dynamic allocation in extended address pool 0.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0 extended
[Sysname-dhcp-pool-0] network mask 255.255.255.0
Related commands
· dhcp server ip-pool
· display dhcp server tree
· network ip range
next-server
Use next-server to specify the IP address of a server in a DHCP address pool.
Use undo next-server to remove the server's IP address from the DHCP address pool.
Syntax
next-server ip-address
undo next-server
Default
No server's IP address is specified in an address pool.
Views
DHCP address pool view
Default command level
2: System level
Parameters
ip-address: Specifies the IP address of a server.
Usage guidelines
If you repeatedly execute this command, only the last configuration takes effect.
Examples
# Specify a server's IP address 1.1.1.1 in DHCP address pool 0.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0
[Sysname-dhcp-pool-0] next-server 1.1.1.1
Related commands
· dhcp server ip-pool
· display dhcp server tree
option
Use option to configure a self-defined DHCP option in a DHCP address pool.
Use undo option to remove a self-defined DHCP option from a DHCP address pool.
Syntax
option code { ascii ascii-string | hex hex-string&<1-16> | ip-address ip-address&<1-8> }
undo option code
Default
The option command is not configured.
Views
DHCP address pool view
Default command level
2: System level
Parameters
code: Specifies the number of the self-defined option, in the range of 2 to 254, excluding 12, 50 through 55, 57 through 61, and 82.
ascii ascii-string: Specifies an ASCII string with 1 to 255 characters as the option content.
hex hex-string&<1-16>: Specifies hex digit strings. &<1-16> indicates that you can specify up to 16 hex digit strings, separated by spaces. Each string contains 2, 4, 6 or 8 hex digits.
ip-address ip-address&<1-8>: Specifies the IP addresses as the option content. &<1-8> indicates that you can specify up to eight IP addresses separated by spaces.
Usage guidelines
If you use the option command repeatedly, only the last configuration takes effect.
Examples
# Configure the hex digits 0x11 and 0x22 for the self-defined DHCP Option 100 in DHCP address pool 0.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0
[Sysname-dhcp-pool-0] option 100 hex 11 22
· dhcp server ip-pool
· display dhcp server tree
reset dhcp server conflict
Use reset dhcp server conflict to clear IP address conflict information.
Syntax
reset dhcp server conflict { all | ip ip-address }
Views
User view
Default command level
2: System level
Parameters
all: Clears the conflict statistics of all IP addresses.
ip ip-address: Clears the conflict statistics of a specified IP address.
Examples
# Clears the statistics of all IP address conflicts.
<Sysname> reset dhcp server conflict all
display dhcp server conflict
reset dhcp server ip-in-use
Use reset dhcp server ip-in-use to clear dynamic IP address binding information.
Syntax
reset dhcp server ip-in-use { all | ip ip-address | pool [ pool-name ] }
Views
User view
Default command level
2: System level
Parameters
all: Clears the IP address dynamic binding information of all DHCP address pools.
ip ip-address: Clears the dynamic binding information of a specified IP address.
pool [ pool-name ]: Clears the dynamic binding information of a specified address pool. The pool name is a string of 1 to 35 characters. If no pool name is specified, the dynamic binding information of all address pools is cleared.
Examples
# Clear the binding information of IP address 10.110.1.1.
<Sysname> reset dhcp server ip-in-use ip 10.110.1.1
display dhcp server ip-in-use
reset dhcp server statistics
Use reset dhcp server statistics to clear the statistics of the DHCP server.
Syntax
reset dhcp server statistics
Views
User view
Default command level
1: Monitor level
Examples
# Clear the statistics of the DHCP server.
<Sysname> reset dhcp server statistics
display dhcp server statistics
static-bind client-identifier
Use static-bind client-identifier to specify the client ID of a static binding in a DHCP address pool.
Use undo static-bind client-identifier to remove the client ID of a static binding from a DHCP address pool.
Syntax
static-bind client-identifier client-identifier
undo static-bind client-identifier
Default
No client ID is specified.
Views
DHCP address pool view
Default command level
2: System level
Parameters
client-identifier: The client ID of a static binding, a string with 4 to 160 characters in the format of H-H-H…, each H indicates 4 hex digits except the last H indicates 2 or 4 hex digits. For example, aabb-cccc-dd is a valid ID, but aabb-c-dddd and aabb-cc-dddd are both invalid.
Usage guidelines
Use the static-bind client-identifier command together with the static-bind ip-address command to accomplish a static binding configuration.
The ID of the static binding of a client must be identical to the ID displayed by using the display dhcp client verbose command on the client. Otherwise, the client cannot obtain an IP address.
If you use the static-bind client-identifier or static-bind mac-address command repeatedly, only the last configuration takes effect.
Examples
# Bind the client ID aaaa-bbbb to the IP address 10.1.1.1 with the mask 255.255.255.0 in DHCP address pool 0.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0
[Sysname-dhcp-pool-0] static-bind ip-address 10.1.1.1 mask 255.255.255.0
[Sysname-dhcp-pool-0] static-bind client-identifier aaaa-bbbb
· dhcp server ip-pool
· static-bind ip-address
· static-bind mac-address
· display dhcp server tree
· display dhcp client verbose
static-bind ip-address
Use static-bind ip-address to specify an IP address in a DHCP address pool for a static binding.
Use undo static-bind ip-address to remove the statically bound IP address.
Syntax
static-bind ip-address ip-address [ mask-length | mask mask ]
undo static-bind ip-address
Default
No IP address is statically bound in a DHCP address pool.
Views
DHCP address pool view
Default command level
2: System level
Parameters
ip-address: Specifies the IP address of a static binding. If no mask and mask length is specified, the natural mask is used.
mask-length: Specifies the mask length of the IP address, in the range of 1 to 30.
mask mask: Specifies the IP address mask, in dotted decimal format.
Usage guidelines
Use the static-bind ip-address command together with the static-bind mac-address or static-bind client-identifier command to accomplish a static binding configuration.
The IP address of the static binding cannot be an interface address of the DHCP server. Otherwise, an IP address conflict may occur, and the bound client cannot obtain an IP address correctly.
If you use the static-bind ip-address command repeatedly, only the last configuration takes effect.
Examples
# Bind the client MAC address 0000-e03f-0305 to the IP address 10.1.1.1 with the mask 255.255.255.0 in DHCP address pool 0.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0
[Sysname-dhcp-pool-0] static-bind ip-address 10.1.1.1 mask 255.255.255.0
[Sysname-dhcp-pool-0] static-bind mac-address 0000-e03f-0305
· dhcp server ip-pool
· static-bind client-identifier
· static-bind mac-address
· display dhcp server tree
static-bind mac-address
Use static-bind mac-address to statically bind a MAC address to an IP address in a DHCP address pool.
Use undo static-bind mac-address to remove the statically bound MAC address.
Syntax
static-bind mac-address mac-address
undo static-bind mac-address
Default
No MAC address is statically bound.
Views
DHCP address pool view
Default command level
2: System level
Parameters
mac-address: The MAC address of a static binding, in the format of H-H-H.
Usage guidelines
Use the static-bind mac-address command together with the static-bind ip-address command to complete a static binding configuration.
If you use the static-bind mac-address or static-bind client-identifier command repeatedly, only the last configuration takes effect.
Examples
# Bind the client MAC address 0000-e03f-0305 to the IP address 10.1.1.1 with the mask 255.255.255.0 in DHCP address pool 0.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0
[Sysname-dhcp-pool-0] static-bind ip-address 10.1.1.1 mask 255.255.255.0
[Sysname-dhcp-pool-0] static-bind mac-address 0000-e03f-0305
· dhcp server ip-pool
· static-bind client-identifier
· static-bind ip-address
· display dhcp server tree.
tftp-server domain-name
Use tftp-server domain-name to specify a TFTP server name in a DHCP address pool.
Use undo tftp-server domain-name to remove the TFTP server name from a DHCP address pool.
Syntax
tftp-server domain-name domain-name
undo tftp-server domain-name
Default
No TFTP server name is specified.
Views
DHCP address pool view
Default command level
2: System level
Parameters
domain-name: TFTP server name, a string of 1 to 63 characters.
Usage guidelines
If you execute the tftp-server domain-name command repeatedly, only the last configuration takes effect.
Examples
# Specify the TFTP server name as aaa in DHCP address pool 0.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0
[Sysname-dhcp-pool-0] tftp-server domain-name aaa
· dhcp server ip-pool
· display dhcp server tree
tftp-server ip-address
Use tftp-server ip-address to specify the TFTP server IP address in a DHCP address pool.
Use undo tftp-server ip-address to remove the TFTP server IP address from a DHCP address pool.
Syntax
tftp-server ip-address ip-address
undo tftp-server ip-address
Default
No TFTP server address is specified.
Views
DHCP address pool view
Default command level
2: System level
Parameters
ip-address: TFTP server IP address.
Usage guidelines
If you execute the tftp-server ip-address command repeatedly, only the last configuration takes effect.
Examples
# Specify the TFTP server address 10.1.1.1 in DHCP address pool 0.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0
[Sysname-dhcp-pool-0] tftp-server ip-address 10.1.1.1
· dhcp server ip-pool
· display dhcp server tree
vendor-class-identifier
Use vendor-class-identifier to specify an IP address range for the DHCP clients of a specified vendor.
Use undo vendor-class-identifier to restore the default.
Syntax
vendor-class-identifier hex-string&<1-255> ip range min-address max-address
undo vendor-class-identifier hex-string&<1-255>
Default
No IP address range is specified for the DHCP clients of any vendor.
Views
DHCP extended address pool view
Default command level
2: System level
Parameters
hex-string&<1-255>: A character string, used to match against Option 60 (vendor class identifier option). The hex-string argument is a hexadecimal number ranging from 0 to FF. &<1-255> indicates that you can type up to 255 hexadecimal numbers, which are separated by spaces.
ip range min-address max-address: Specifies the IP address range for dynamic allocation. The min-address argument is the lowest IP address and the max-address argument is the highest IP address for dynamic allocation.
Usage guidelines
After this feature is configured in an extended DHCP address pool, the DHCP server, when using the extended DHCP address pool to assign an IP address to a DHCP client, checks whether Option 60 in the DHCP request is the same as the character string configured with the vendor-class-identifier command. If yes, the DHCP server selects an IP address from the address range specified with this command. If not, the DHCP server selects one from the address range specified with the network ip range command.
Note the following:
· Only extended address pools support this command.
· The IP address range specified with this command must be included in that specified with the network ip range command.
Examples
# Specify IP address rang 10.1.1.1 to 10.1.1.5 for the DHCP clients of vender a0 b0 0c.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0 extended
[Sysname-dhcp-pool-0] vendor-class-identifier a0 b0 0c ip range 10.1.1.1 10.1.1.5
Related commands
· network ip range
· network mask
voice-config
Use voice-config to configure specified Option 184 contents in a DHCP address pool.
Use undo voice-config to remove specified Option 184 contents from a DHCP address pool.
Syntax
voice-config { as-ip ip-address | fail-over ip-address dialer-string | ncp-ip ip-address | voice-vlan vlan-id { disable | enable } }
undo voice-config [ as-ip | fail-over | ncp-ip | voice-vlan ]
Default
No Option 184 content is configured.
Views
DHCP address pool view
Default command level
2: System level
Parameters
as-ip ip-address: Specifies the IP address for the backup network calling processor. When the primary network calling processor is unavailable, the DHCP client uses the backup network calling processor.
fail-over ip-address dialer-string: Specifies the failover IP address and dialer string. The dialer-string is a string of 1 to 39 characters, which can be 0 to 9, and asterisk (*).
ncp-ip ip-address: Specifies the IP address for the primary network calling processor.
voice-vlan vlan-id: Specifies the voice VLAN ID, in the range of 2 to 4094.
· disable: Disables the specified voice VLAN ID, meaning DHCP clients do not take this ID as their voice VLAN.
· enable: Enables the specified voice VLAN ID, meaning DHCP clients take this ID as their voice VLAN.
Usage guidelines
Specify the IP address of a network calling processor first to make other configured parameters take effect.
Examples
# Configure Option 184 in DHCP address pool 0: the primary network calling processor 10.1.1.1, backup network calling processor 10.2.2.2, voice VLAN ID 3 that is enabled, the failover IP address 10.3.3.3 and dialer string 99*.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0
[Sysname-dhcp-pool-0] voice-config ncp-ip 10.1.1.1
[Sysname-dhcp-pool-0] voice-config as-ip 10.2.2.2
[Sysname-dhcp-pool-0] voice-config voice-vlan 3 enable
[Sysname-dhcp-pool-0] voice-config fail-over 10.3.3.3 99*
Related commands
· dhcp server ip-pool
· display dhcp server tree
The DHCP client configuration is supported only on Layer 3 Ethernet interfaces (or subinterfaces), VLAN interfaces, and Layer 3 aggregate interfaces.
When multiple VLAN interfaces having the same MAC address use DHCP for IP address acquisition through a relay agent, the DHCP server cannot be the Windows 2000 Server or Windows 2003 Server.
You cannot configure an interface of an aggregation group as a DHCP client.
display dhcp client
Use display dhcp client to display DHCP client information. If no interface interface-type interface-number is specified, DHCP client information of all interfaces is displayed.
Syntax
display dhcp client [ verbose ] [ interface interface-type interface-number ] [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command level
1: Monitor level
Parameters
verbose: Displays verbose DHCP client information.
interface interface-type interface-number: Specifies an interface by its type and number.
|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Examples
# Display DHCP client information for all interfaces.
<Sysname> display dhcp client
Vlan-interface1 DHCP client information:
Current machine state: BOUND
Allocated IP: 40.1.1.20 255.255.255.0
Allocated lease: 259200 seconds, T1: 129600 seconds, T2: 226800 seconds
DHCP server: 40.1.1.2
# Display verbose DHCP client information.
<Sysname> display dhcp client verbose
Vlan-interface1 DHCP client information:
Current machine state: BOUND
Allocated IP: 40.1.1.20 255.255.255.0
Allocated lease: 259200 seconds, T1: 129600 seconds, T2: 226800 seconds
Lease from 2005.08.13 15:37:59 to 2005.08.16 15:37:59
DHCP server: 40.1.1.2
Transaction ID: 0x1c09322d
Default router: 40.1.1.2
Classless static route:
Destination: 1.1.0.1, Mask: 255.0.0.0, NextHop: 192.168.40.16
Destination: 10.198.122.63, Mask: 255.255.255.255, NextHop: 192.168.40.16
DNS server: 44.1.1.11
DNS server: 44.1.1.12
Domain name: ddd.com
Boot server: 200.200.200.200 1.1.1.1
Client ID: 3030-3066-2e65-3234-
392e-3830-3438-2d56-
6c61-6e2d-696e-7465-
7266-6163-6531
T1 will timeout in 1 day 11 hours 58 minutes 52 seconds.
Table 7 Command output
Field |
Description |
Vlan-interface1 DHCP client information |
Information of the interface acting as the DHCP client. |
Current machine state |
Current state of the DHCP client: · HALT—The client stops applying for an IP address. · INIT—The initialization state. · SELECTING—The client has sent out a DHCP-DISCOVER message in search for a DHCP server and is waiting for the response from DHCP servers. · REQUESTING—The client has sent out a DHCP-REQUEST message requesting for an IP address and is waiting for the response from DHCP servers. · BOUND—The client has received the DHCP-ACK message from a DHCP server and obtained an IP address successfully. · RENEWING—The T1 timer expires. · REBOUNDING—The T2 timer expires. |
Allocated IP |
IP address allocated by the DHCP server. |
Allocated lease |
Allocated lease time. |
T1 |
1/2 lease time (in seconds) of the DHCP client IP address. |
T2 |
7/8 lease time (in seconds) of the DHCP client IP address. |
Lease from….to…. |
Start and end time of the lease. |
DHCP server |
DHCP server IP address that assigned the IP address. |
Transaction ID |
Transaction ID, a random number chosen by the client to identify an IP address allocation. |
Default router |
Gateway address assigned to the client. |
Classless static route |
Classless static routes assigned to the client. |
Static route |
Classful static routes assigned to the client. |
DNS server |
DNS server address assigned to the client. |
Domain name |
Domain name suffix assigned to the client. |
Boot server |
PXE server addresses (up to 16 addresses) specified for the DHCP client, which are obtained through Option 43. |
Client ID |
DHCP client ID. |
T1 will timeout in 1 day 11 hours 58 minutes 52 seconds. |
How long the T1 (1/2 lease time) timer will timeout. |
ip address dhcp-alloc
Use ip address dhcp-alloc to configure an interface to use DHCP for IP address acquisition.
Use undo ip address dhcp-alloc to cancel an interface from using DHCP.
Syntax
ip address dhcp-alloc [ client-identifier mac interface-type interface-number ]
undo ip address dhcp-alloc
Default
An interface does not use DHCP for IP address acquisition.
Views
Interface view
Default command level
2: System level
Parameters
client-identifier mac interface-type interface-number: Enables an interface to use its MAC address as the client ID to obtain an IP address.
Usage guidelines
If no parameter is specified, the client uses a character string comprised of the current interface name and MAC address as its ID for address acquisition.
The DHCP client sends a DHCP-RELEASE message for releasing the IP address obtained through DHCP.
For a subinterface that obtained an IP address through DHCP, using the shutdown command on its primary interface does not make the subinterface send a DHCP-RELEASE message for releasing the sub interface's IP address.
Examples
# Configure VLAN-interface 1 to use DHCP for IP address acquisition.
<Sysname> system-view
[Sysname] interface vlan-interface 1
[Sysname-Vlan-interface1] ip address dhcp-alloc