- Table of Contents
- Related Documents
-
Title | Size | Download |
---|---|---|
03-DHCP Commands | 138.07 KB |
Table of Contents
1 DHCP Server Configuration Commands
DHCP Server Configuration Commands
dhcp select server global-pool
dhcp server relay information enable
display dhcp server forbidden-ip
display dhcp server statistics
2 DHCP Client Configuration Commands
DHCP Client Configuration Commands
l Support of the H3C WA series WLAN access points (APs) for commands may vary by AP model. For more information, see Feature Matrix.
l The interface types and the number of interfaces vary by AP model.
l The models listed in this document are not applicable to all regions. Please consult your local sales office for the models applicable to your region.
l The DHCP server configuration is supported only on VLAN interfaces and loopback interfaces. The subaddress pool configuration is not supported on loopback interfaces.
l Support for DHCP server configuration commands depends on the AP model.
DHCP Server Configuration Commands
bims-server
Syntax
bims-server ip ip-address [ port port-number ] sharekey key
undo bims-server
View
DHCP address pool view
Default Level
2: System level
Parameters
ip ip-address: Specifies an IP address for the BIMS server.
port port-number: Specifies a port number for the BIMS server in the range 1 to 65534.
sharekey key: Specifies a shared key for the BIMS server, which is a string of 1 to 16 characters.
Description
Use the bims-server command to specify the IP address, port number, and shared key of the BIMS server in the DHCP address pool for the client.
Use the undo bims-server command to remove BIMS server information assigned from the DHCP address pool to the DHCP client.
By default, no BIMS server information is specified.
If you execute the bims-server command repeatedly, the latest configuration will overwrite the previous one.
Related commands: dhcp server ip-pool and display dhcp server tree.
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 aabbcc
bootfile-name
Syntax
bootfile-name bootfile-name
undo bootfile-name
View
DHCP address pool view
Default Level
2: System level
Parameters
bootfile-name: Boot file name, a string of 1 to 63 characters.
Description
Use the bootfile-name command to specify a bootfile name in the DHCP address pool for the client.
Use the undo bootfile-name command to remove the specified bootfile name assigned from the DHCP address pool to the DHCP client.
By default, no bootfile name is specified.
If you execute the bootfile-name command repeatedly, the latest configuration will overwrite the previous one.
Related commands: dhcp server ip-pool and display dhcp server tree.
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 enable
Syntax
dhcp enable
undo dhcp enable
View
System view
Default Level
2: System level
Parameters
None
Description
Use the dhcp enable command to enable DHCP.
Use the undo dhcp enable command to disable DHCP.
By default, DHCP is disabled.
You need to enable DHCP before performing DHCP server configurations.
Examples
# Enable DHCP.
<Sysname> system-view
[Sysname] dhcp enable
dhcp server apply ip-pool
Syntax
dhcp server apply ip-pool pool-name
undo dhcp server apply ip-pool [ pool-name ]
View
Interface view
Default Level
2: System level
Parameters
pool-name: DHCP address pool name, a case-insensitive string of 1 to 35 characters.
Description
Use the dhcp server apply ip-pool command to apply an extended address pool on an interface.
Use the undo dhcp server apply ip-pool command to remove the configuration.
By 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.
Note that:
l When a client's request arrives at an interface configured with the dhcp server apply ip-pool command, the server assigns the client the IP address statically bound to the client first. If no such IP address is available, the server assigns the client an IP address from the specified extended address pool.
l Only an extended address pool can be applied on an interface. The address pool to be referenced must already exist.
Related commands: dhcp server ip-pool.
Examples
# Apply extended DHCP address pool VLAN 1 on VLAN-interface 1.
<system> system-view
[Sysname] interface vlan-interface 1
[Sysname-Vlan-interface1] dhcp server apply ip-pool VLAN1
dhcp select server global-pool
Syntax
dhcp select server global-pool [ subaddress ]
undo dhcp select server global-pool [ subaddress ]
View
Interface view
Default Level
2: System level
Parameters
subaddress: Supports subaddress allocation. That is, the DHCP server and clients are on the same network segment, and the server allocates IP addresses from the address pool containing the network segment of the first subaddress if several subaddresses exist.
Description
Use the dhcp select server global-pool command to enable the DHCP server on specified interface(s). After the interface receives a DHCP request, the DHCP server will allocate an IP address from the address pool.
Use the undo dhcp select server global-pool command to remove the configuration. That is, upon receiving a DHCP request from a client, the interface will not assign an IP address to the client.
Use the undo dhcp select server global-pool subaddress command to cancel the support for subaddress allocation.
By default, the DHCP server is enabled on an interface.
Examples
# Enable the DHCP server on VLAN-interface 1.
<Sysname> system-view
[Sysname] interface vlan-interface 1
[Sysname-Vlan-interface1] dhcp select server global-pool
dhcp server detect
Syntax
dhcp server detect
undo dhcp server detect
View
System view
Default Level
2: System level
Parameters
None
Description
Use the dhcp server detect command to enable unauthorized DHCP server detection.
Use the undo dhcp server detect command to disable the function.
By default, the function is disabled.
With this function enabled, upon receiving a DHCP request, the DHCP server will record the IP addresses of DHCP servers which ever offered IP addresses to the DHCP client and the receiving interface. Each server detected is recorded only once. The administrator can get this information from logs to check out unauthorized DHCP servers.
Examples
# Enable unauthorized DHCP server detection.
<Sysname> system-view
[Sysname] dhcp server detect
dhcp server forbidden-ip
Syntax
dhcp server forbidden-ip low-ip-address [ high-ip-address ]
undo dhcp server forbidden-ip low-ip-address [ high-ip-address ]
View
System view
Default Level
2: System level
Parameters
low-ip-address: Start IP address of the IP address range to be excluded from dynamic allocation.
high-ip-address: End IP address of the IP address range to be excluded from dynamic allocation. The end IP address must have a higher sequence than the start one.
Description
Use the dhcp server forbidden-ip command to exclude IP addresses from dynamic allocation.
Use the undo dhcp server forbidden-ip command to remove the configuration.
By default, all IP addresses in a DHCP address pool are assignable except IP addresses of the DHCP server interfaces.
Note that:
l 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.
l 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 an address range in the undo dhcp server forbidden-ip command instead of specifying one IP address.
l Using the dhcp server forbidden-ip command repeatedly can exclude multiple IP address ranges from allocation.
Related commands: display dhcp server forbidden-ip, dhcp server ip-pool, network, and static-bind ip-address.
Examples
# Exclude the IP address range 10.110.1.1 to 10.110.1.63 from dynamic allocation.
<Sysname> system-view
[Sysname] dhcp server forbidden-ip 10.110.1.1 10.110.1.63
dhcp server ip-pool
Syntax
dhcp server ip-pool pool-name [ extended ]
undo dhcp server ip-pool pool-name
View
System view
Default Level
2: System level
Parameters
pool-name: Global address pool name, which is a unique pool identifier, a string of 1 to 35 characters.
extended: Specifies the address pool as an extended address pool. If this keyword is not specified, the address pool is a common address pool.
Description
Use the dhcp server ip-pool command to create a DHCP address pool and enter its view. If the pool was created, you will directly enter its view.
Use the undo dhcp server ip-pool command to remove the specified DHCP address pool.
By default, no DHCP address pool is created.
Related commands: dhcp enable and display dhcp server tree.
Examples
# Create the common address pool identified by 0.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0
[Sysname-dhcp-pool-0]
dhcp server ping packets
Syntax
dhcp server ping packets number
undo dhcp server ping packets
View
System view
Default Level
2: System level
Parameters
number: Number of ping packets, in the range of 0 to 10. 0 means no ping operation.
Description
Use the dhcp server ping packets command to specify the maximum number of ping packets on the DHCP server.
Use the undo dhcp server ping packets command to restore the default.
The number defaults to 1.
Examples
# Specify the maximum number of ping packets as 10.
<Sysname> system-view
[Sysname] dhcp server ping packets 10
dhcp server ping timeout
Syntax
dhcp server ping timeout milliseconds
undo dhcp server ping timeout
View
System view
Default Level
2: System level
Parameters
milliseconds: Response timeout value for ping packets in milliseconds, in the range of 0 to 10,000. 0 means no ping operation.
Description
Use the dhcp server ping timeout command to configure response timeout time of the ping packet on the DHCP server.
Use the undo dhcp server ping timeout command to restore the default.
The time defaults to 500 ms.
Examples
# Specify the response timeout time as 1000 ms.
<Sysname> system-view
[Sysname] dhcp server ping timeout 1000
dhcp server relay information enable
Syntax
dhcp server relay information enable
undo dhcp server relay information enable
View
System view
Default Level
2: System level
Parameters
None
Description
Use the dhcp server relay information enable command to enable the DHCP server to handle Option 82.
Use the undo dhcp server relay information enable command to configure the DHCP server to ignore Option 82.
By default, the DHCP server handles Option 82.
Examples
# Configure the DHCP server to ignore Option 82.
<Sysname> system-view
[Sysname] undo dhcp server relay information enable
display dhcp server conflict
Syntax
display dhcp server conflict { all | ip ip-address }
View
Any view
Default Level
1: Monitor level
Parameters
all: Displays information about all IP address conflicts.
ip-address: Displays conflict information for the IP address.
Description
Use the display dhcp server conflict command to display information about IP address conflicts.
Related commands: reset dhcp server conflict.
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-1 display dhcp server conflict command output description
Field |
Description |
Address |
Conflicted IP address |
Discover Time |
Time when the conflict was discovered |
display dhcp server expired
Syntax
display dhcp server expired { all | ip ip-address | pool [ pool-name ] }
View
Any view
Default Level
1: Monitor level
Parameters
all: Displays the lease expiration information of all DHCP address pools.
ip ip-address: Displays the lease expiration information of a specified IP address.
pool [ pool-name ]: Displays the lease expiration information of a 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.
Description
Use the display dhcp server expired command to display the lease expiration information of specified DHCP address pool(s) or an IP address.
DHCP will assign these expired IP addresses to DHCP clients after all addresses have been assigned.
Examples
# Display information about lease expirations in all DHCP address pools.
<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 1-2 display dhcp server expired command output description
Field |
Description |
IP address |
Expired IP addresses |
Client-identifier/Hardware address |
IDs or MACs of clients whose IP addresses were expired |
Lease expiration |
The lease expiration time |
Type |
Types of lease expirations. Currently, this field is set to Release. |
display dhcp server free-ip
Syntax
display dhcp server free-ip
View
Any view
Default Level
1: Monitor level
Parameters
None
Description
Use the display dhcp server free-ip command to display information about assignable IP addresses which have never been assigned.
Examples
# Display information about assignable IP addresses.
<Sysname> display dhcp server free-ip
IP Range from 10.0.0.0 to 10.0.0.255
display dhcp server forbidden-ip
Syntax
display dhcp server forbidden-ip
View
Any view
Default Level
1: Monitor level
Parameters
None
Description
Use the display dhcp server forbidden-ip command to display IP addresses excluded from dynamic allocation in DHCP address pool.
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 1-3 display dhcp server forbidden-ip command output description
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 extended DHCP address pool view. They cannot be assigned from the current extended address pool only. |
display dhcp server ip-in-use
Syntax
display dhcp server ip-in-use { all | ip ip-address | pool [ pool-name ] }
View
Any view
Default Level
1: Monitor level
Parameters
all: Displays the binding information of all DHCP address pools.
ip ip-address: Displays the binding information of a specified IP address.
pool [ pool-name ]: Displays the 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 binding information of all address pools is displayed.
Description
Use the display dhcp server ip-in-use command to display the binding information of DHCP address pool(s) or an IP address.
Related commands: reset dhcp server ip-in-use.
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 1-4 display dhcp server ip-in-use command output description
Field |
Description |
Pool utilization |
Utilization rate of a DHCP address pool l When the binding information of all DHCP address pools is displayed, this field displays the total utilization rate of all DHCP address pools. l When the binding information of a specific DHCP address pool is displayed, this field displays the utilization rate of the DHCP address pool. l 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 l Specific time (May 1 2009 14:02:49 in this example): Time when the lease expires. l NOT Used: The IP address of the static binding has not been assigned to the specific client. l Unlimited: Infinite lease expiration time. |
Type |
Binding types, including Manual, Auto:OFFERED and Auto:COMMITTED. l Manual: Static binding l Auto:OFFERED: The binding sent in the DHCP-OFFER message from the server to the client. l Auto:COMMITTED: The binding sent in the DHCP-ACK message from the server to the client. |
display dhcp server statistics
Syntax
display dhcp server statistics
View
Any view
Default Level
1: Monitor level
Parameters
None
Description
Use the display dhcp server statistics command to display the statistics of the DHCP server.
Related commands: reset dhcp server statistics.
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 1-5 display dhcp server statistics command output description
Field |
Description |
Global Pool |
Statistics of a DHCP address pool |
Pool Number |
The number of address pools |
Auto |
The number of dynamic bindings |
Manual |
The number of static bindings |
Expire |
The number of expired bindings |
BOOTP Request |
The number of DHCP requests sent from DHCP clients to the DHCP server, including: l DHCPDISCOVER l DHCPREQUEST l DHCPDECLINE l DHCPRELEASE l DHCPINFORM l BOOTPREQUEST |
BOOTP Reply |
The number of DHCP replies sent from the DHCP server to DHCP clients, including: l DHCPOFFER l DHCPACK l DHCPNAK l BOOTPREPLY |
Bad Messages |
The number of erroneous messages |
display dhcp server tree
Syntax
display dhcp server tree { all | pool [ pool-name ] }
View
Any view
Default 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 is a string of 1 to 35 characters. If no pool name is specified, information of all address pools will be displayed.
Description
Use the display dhcp server tree command to display information of DHCP address pool(s).
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
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: vlan12
network ip range 1.1.1.0 1.1.1.255
network mask 255.255.255.0
expired 0 0 2
Table 1-6 display dhcp server tree command output description
Field |
Description |
Global pool |
Information of a common address pool |
Pool name |
Address pool name |
network |
Network segment for address allocation |
static-bind ip-address 10.10.1.2 mask 255.0.0.0 static-bind mac-address 00e0-00fc-0001 |
The IP address and MAC address of the static binding |
Sibling node |
The sibling node of the current node, nodes of this kind in the output are: l Child node: The child node (subnet segment) address pool of the current node l Parent node: The parent node (nature network segment) address pool of the current node l 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 selection priority the sibling node has. l PrevSibling node: The previous sibling node of the current node |
option |
Self-defined DHCP options |
expired |
The lease duration, in the format of day, hour, and minute |
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
Syntax
dns-list ip-address&<1-8>
undo dns-list { ip-address | all }
View
DHCP address pool view
Default Level
2: System level
Parameters
ip-address&<1-8>: DNS server IP address. &<1-8> means you can specify up to eight DNS server addresses separated by spaces.
all: Specifies all DNS server addresses to be removed.
Description
Use the dns-list command to specify DNS server addresses in a DHCP address pool.
Use the undo dns-list command to remove DNS server addresses from a DHCP address pool.
By default, no DNS server address is specified.
If you repeatedly use the dns-list command, the latest configuration will overwrite the previous one.
Related commands: dhcp server ip-pool and display dhcp server tree.
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
domain-name
Syntax
domain-name domain-name
undo domain-name
View
DHCP address pool view
Default Level
2: System level
Parameters
domain-name: Domain name suffix for DHCP clients, a string of 1 to 50 characters.
Description
Use the domain-name command to specify a domain name suffix for the DHCP clients in the DHCP address pool.
Use the undo domain-name command to remove the domain name suffix assigned from the DHCP address pool to the DHCP client.
No domain name suffix is specified by default.
Related commands: dhcp server ip-pool and display dhcp server tree.
Examples
# Specify a domain name suffix of mydomain.com for the DHCP clients in DHCP address pool 0.
<Sysname> system-view
[Sysname] dhcp server ip-pool 0
[Sysname-dhcp-pool-0] domain-name mydomain.com
expired
Syntax
expired { day day [ hour hour [ minute minute ] ] | unlimited }
undo expired
View
DHCP address pool view
Default Level
2: System level
Parameters
day day: Specifies the number of days, in the range of 0 to 365.
hour hour: Specified 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.
unlimited: Specifies the infinite duration, which is actually 136 years.
Description
Use the expired command to specify the lease duration in a DHCP address pool.
Use the undo expired command to restore the default lease duration in a DHCP address pool.
By default, the lease duration of a static address pool is unlimited, and the lease duration of a dynamic address pool is one day.
Note that if the lease duration you specified is beyond the year 2106, the system regards the lease as expired.
Related commands: dhcp server ip-pool and display dhcp server tree.
Examples
# Specify the lease duration as one day, two hours and three minutes 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
forbidden-ip
Syntax
forbidden-ip ip-address&<1-8>
undo forbidden-ip { ip-address&<1-8> | all }
View
DHCP address pool view
Default Level
2: System level
Parameters
ip-address&<1-8>: IP addresses to be excluded from dynamic allocation. &<1-8> indicates that you can specify up to eight IP addresses, separated with spaces.
all: Excludes all IP addresses from dynamic allocation.
Description
Use the forbidden-ip command to exclude IP addresses from dynamic allocation in an extended address pool.
Use the undo forbidden-ip command to free specified or all excluded IP addresses.
By default, all IP addresses in an extended address pool are assignable except the IP addresses of the DHCP server interfaces.
Note that:
l Only the extended address pool supports this command.
l IP addresses specified with the forbidden-ip command in extended DHCP address pool view are excluded from dynamic address allocation in the current extended address pool only. They are assignable in other address pools.
l Repeatedly using the dhcp server forbidden-ip command can exclude multiple IP address ranges from dynamic allocation.
Related commands: dhcp server ip-pool and display dhcp server tree.
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
gateway-list
Syntax
gateway-list ip-address&<1-8>
undo gateway-list { ip-address | all }
View
DHCP address pool view
Default 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.
Description
Use the gateway-list command to specify gateway address(es) in a DHCP address pool.
Use the undo gateway-list command to remove specified gateway address(es) specified for the DHCP client from a DHCP address pool.
By default, no gateway address is specified.
If you use the gateway-list command repeatedly, the latest configuration will overwrite the previous one.
Related commands: dhcp server ip-pool and display dhcp server forbidden-ip.
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
nbns-list
Syntax
nbns-list ip-address&<1-8>
undo nbns-list { ip-address | all }
View
DHCP address pool view
Default Level
2: System level
Parameters
ip-address&<1-8>: WINS server IP address. &<1-8> means you can specify up to eight WINS server addresses separated by spaces.
all: Specifies all WINS server addresses to be removed.
Description
Use the nbns-list command to specify WINS server address(es) in a DHCP address pool.
Use the undo nbns-list command to remove WINS server address(es) assigned from a DHCP address pool to the DHCP client.
By default, no WINS server address is specified.
If you use the nbns-list command repeatedly, the latest configuration will overwrite the previous one.
Related commands: dhcp server ip-pool, netbios-type, and display dhcp server tree.
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
netbios-type
Syntax
netbios-type { b-node | h-node | m-node | p-node }
undo netbios-type
View
DHCP address pool view
Default Level
2: System level
Parameters
b-node: Broadcast node. A b-node client sends the destination name in a broadcast message. The destination returns the name-to-IP mapping to the client after receiving the message.
p-node: Peer-to-peer node. A p-node client sends the destination name in a unicast message to the WINS server, and the WINS server returns the mapping to the client.
m-node: Mixed node, a combination of a b-node first and p-node second. An m-node client broadcasts the destination name, if there is no response, and then unicasts the destination name to the WINS server to get the mapping.
h-node: Hybrid node, a combination of a p-node first and b-node second. An h-node is a p-node with the peer-to-peer communication mechanism. An h-node client unicasts the destination name to the WINS server, if there is no response, and then broadcasts it to get the mapping from the destination.
Description
Use the netbios-type command to specify the client NetBIOS node type in a DHCP address pool.
Use the undo netbios-type command to remove the client NetBIOS node type assigned from a DHCP address pool to the DHCP client.
By default, no NetBIOS node type is specified.
Related commands: dhcp server ip-pool, nbns-list, and display dhcp server tree.
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
network
Syntax
network network-address [ mask-length | mask mask ]
undo network
View
DHCP address pool view
Default Level
2: System level
Parameters
network-address: IP address range for dynamic allocation. If no mask length and mask is specified, the natural mask will be used.
mask-length: Mask length, in the range of 1 to 30.
mask mask: Specifies the IP address network mask, in dotted decimal format.
Description
Use the network command to specify the IP address range for dynamic allocation in a DHCP address pool.
Use the undo network command to remove the specified address range.
No IP address range is specified by default.
Note that you can specify only one network segment for each DHCP global address pool. If you use the network command repeatedly, the latest configuration will overwrite the previous one.
Related commands: dhcp server ip-pool and display dhcp server tree.
Examples
# Specify 192.168.8.0/24 as the address range 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
network ip range
Syntax
network ip range min-address max-address
undo network ip range
View
DHCP address pool view
Default Level
2: System level
Parameters
min-address: Lowest IP address for dynamic allocation.
max-address: Highest IP address for dynamic allocation.
Description
Use the network ip range command to specify the IP address range for dynamic allocation in an extended address pool.
Use the undo network ip range command to remove the specified address range.
No IP address range is specified by default.
Note that:
l Only the extended address pool supports this command.
l You can specify only one IP address range for each DHCP address pool. If you use the network ip range command repeatedly, the latest configuration will overwrite the previous one.
Related commands: dhcp server ip-pool and display dhcp server tree.
Examples
# Specify 192.168.8.1 through 192.168.8.150 as the address range for dynamic 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
network mask
Syntax
network mask mask
undo network mask
View
DHCP address pool view
Default Level
2: System level
Parameters
mask: Network mask, in dotted decimal notation.
Description
Use the network mask command to specify the IP address mask for dynamic allocation in an extended address pool.
Use the undo network mask command to remove the specified IP address mask.
No IP address mask is specified by default.
Note that:
l Only the extended address pool supports this command.
l 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.
Related commands: dhcp server ip-pool, network ip range, and display dhcp server tree.
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
option
Syntax
option code { ascii ascii-string | hex hex-string&<1-16> | ip-address ip-address&<1-8> }
undo option code
View
DHCP address pool view
Default Level
2: System level
Parameters
code: Self-defined option number, in the range of 2 to 254, excluding 12, 50 to 55, 57 to 61, and 82.
ascii ascii-string: Specifies an ASCII string with 1 to 63 characters.
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 IP addresses. &<1-8> indicates that you can specify up to eight IP addresses, separated by spaces.
Description
Use the option command to configure a self-defined DHCP option in a DHCP address pool.
Use the undo option command to remove a self-defined DHCP option from a DHCP address pool.
The option command is not configured by default.
If you use the option command repeatedly, the latest configuration will overwrite the previous one.
Related commands: dhcp server ip-pool and display dhcp server tree.
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
reset dhcp server conflict
Syntax
reset dhcp server conflict { all | ip ip-address }
View
User view
Default Level
2: System level
Parameters
all: Clears the statistics of all IP address conflicts.
ip ip-address: Clears the conflict statistics of a specified IP address.
Description
Use the reset dhcp server conflict command to clear statistics of IP address conflict(s).
Related commands: display dhcp server conflict.
Examples
# Clears the statistics of all IP address conflicts.
<Sysname> reset dhcp server conflict all
reset dhcp server ip-in-use
Syntax
reset dhcp server ip-in-use { all | ip ip-address | pool [ pool-name ] }
View
User view
Default 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.
Description
Use the reset dhcp server ip-in-use command to clear dynamic IP address binding information.
Related commands: display dhcp server ip-in-use.
Examples
# Clear the binding information of IP address 10.110.1.1.
<Sysname> reset dhcp server ip-in-use ip 10.110.1.1
reset dhcp server statistics
Syntax
reset dhcp server statistics
View
User view
Default Level
2: System level
Parameters
None
Description
Use the reset dhcp server statistics command to clear the statistics of the DHCP server.
Related commands: display dhcp server statistics.
Examples
# Clear the statistics of the DHCP server.
<Sysname> reset dhcp server statistics
static-bind client-identifier
Syntax
static-bind client-identifier client-identifier
undo static-bind client-identifier
View
DHCP address pool view
Default 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, while aabb-c-dddd and aabb-cc-dddd are both invalid.
Description
Use the static-bind client-identifier command to specify the client ID of a static binding in a DHCP address pool.
Use the undo static-bind client-identifier command to remove the client ID of a static binding from a DHCP address pool.
By default, no client ID is specified.
Note that:
l Use the static-bind client-identifier command together with the static-bind ip-address command to accomplish a static binding configuration.
l 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.
l If you use the static-bind client-identifier or static-bind mac-address command repeatedly, the latest configuration will overwrite the previous one.
Related commands: dhcp server ip-pool, static-bind ip-address, static-bind mac-address, display dhcp server tree, and display dhcp client verbose.
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
static-bind ip-address
Syntax
static-bind ip-address ip-address [ mask-length | mask mask ]
undo static-bind ip-address
View
DHCP address pool view
Default Level
2: System level
Parameters
ip-address: IP address of a static binding. If no mask and mask length is specified, the natural mask is used.
mask-length: Mask length of the IP address, that is, the number of ones in the mask.
mask mask: Specifies the IP address mask, in dotted decimal format.
Description
Use the static-bind ip-address command to specify an IP address in a DHCP address pool for a static binding.
Use the undo static-bind ip-address command to remove the statically bound IP address.
By default, no IP address is statically bound in a DHCP address pool.
Note that:
l 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.
l If you use the static-bind ip-address command repeatedly, the latest configuration will overwrite the previous one.
l 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.
Related commands: dhcp server ip-pool, static-bind client-identifier, static-bind mac-address, and display dhcp server tree.
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
static-bind mac-address
Syntax
static-bind mac-address mac-address
undo static-bind mac-address
View
DHCP address pool view
Default Level
2: System level
Parameters
mac-address: The MAC address of a static binding, in the format of H-H-H.
Description
Use the static-bind mac-address command to statically bind a MAC address to an IP address in a DHCP address pool.
Use the undo static-bind mac-address command to remove the statically bound MAC address.
By default, no MAC address is statically bound.
Note that:
l Use the static-bind mac-address command together with the static-bind ip-address command to complete a static binding configuration.
l If you use the static-bind mac-address or static-bind client-identifier command repeatedly, the latest configuration will overwrite the previous one.
Relate command: dhcp server ip-pool, static-bind client-identifier, static-bind ip-address, display dhcp server tree.
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
tftp-server domain-name
Syntax
tftp-server domain-name domain-name
undo tftp-server domain-name
View
DHCP address pool view
Default Level
2: System level
Parameters
domain-name: TFTP server name, a string of 1 to 63 characters.
Description
Use the tftp-server domain-name command to specify a TFTP server name in a DHCP address pool.
Use the undo tftp-server domain-name command to remove the TFTP server name from a DHCP address pool.
By default, no TFTP server name is specified.
Using the tftp-server domain-name command repeatedly will overwrite the previous configuration.
Related commands: dhcp server ip-pool and display dhcp server tree.
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
tftp-server ip-address
Syntax
tftp-server ip-address ip-address
undo tftp-server ip-address
View
DHCP address pool view
Default Level
2: System level
Parameters
ip-address: TFTP server IP address.
Description
Use the tftp-server ip-address command to specify the TFTP server IP address in a DHCP address pool.
Use the undo tftp-server ip-address command to remove the TFTP server IP address from a DHCP address pool.
By default, no TFTP server address is specified.
Using the tftp-server ip-address command repeatedly will overwrite the previous configuration.
Related commands: dhcp server ip-pool and display dhcp server tree.
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
voice-config
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 ]
View
DHCP address pool view
Default Level
2: System level
Parameters
as-ip ip-address: Specifies IP address for 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 “*”.
ncp-ip ip-address: Specifies IP address for the primary network calling processor.
voice-vlan vlan-id: Specifies the voice VLAN ID, in the range of 2 to 4094.
l disable: Disables the specified voice VLAN ID, meaning DHCP clients will not take this ID as their voice VLAN.
l enable: Enables the specified voice VLAN ID, meaning DHCP clients will take this ID as their voice VLAN.
Description
Use the voice-config command to configure specified Option 184 contents in a DHCP address pool.
Use the undo voice-config command to remove specified Option 184 contents from a DHCP address pool.
By default, no Option 184 content is configured.
Note that specifying the IP address of a network calling processor first is necessary to make other configured parameters take effect.
Related commands: dhcp server ip-pool and display dhcp server tree.
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*
l The DHCP client configuration is supported only on the Layer 3 Ethernet interface (or subinterface) and VLAN interface.
l When multiple VLAN interfaces having the same MAC address use DHCP for IP address acquisition via a relay agent, the DHCP server cannot be the Windows 2000 Server or Windows 2003 Server.
DHCP Client Configuration Commands
display dhcp client
Syntax
display dhcp client [ verbose ] [ interface interface-type interface-number ]
View
Any view
Default Level
1: Monitor level
Parameters
verbose: Specifies verbose DHCP client information to be displayed.
interface interface-type interface-number: Specifies an interface of which to display DHCP client information.
Description
Use the display dhcp client command to display DHCP client information. If no interface interface-type interface-number is specified, DHCP client information of all interfaces will be displayed.
Examples
# Display DHCP client information of 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 2-1 display dhcp client command output description
Field |
Description |
Vlan-interface1 DHCP client information |
Information of the interface acting as the DHCP client |
Current machine state |
DHCP client current machine state, which can be: l HALT: Indicates that the client stops applying for an IP address. l INIT: Indicates the initialization state. l SELECTING: Indicates that the client has sent out a DHCP-DISCOVER message in search of a DHCP server and is waiting for the response from DHCP servers. l REQUESTING: Indicates that the client has sent out a DHCP-REQUEST message requesting for an IP address and is waiting for the response from DHCP servers. l BOUND: Indicates that the client has received the DHCP-ACK message from a DHCP server and obtained an IP address successfully. l RENEWING: Indicates that the T1 timer expires. l REBOUNDING: Indicates that the T2 timer expires. |
Allocated IP |
The IP address allocated by the DHCP server |
Allocated lease |
The allocated lease time |
T1 |
The 1/2 lease time (in seconds) of the DHCP client IP address |
T2 |
The 7/8 lease time (in seconds) of the DHCP client IP address |
Lease from….to…. |
The 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 |
The 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 |
The DNS server address assigned to the client |
Domain name |
The 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 |
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
Syntax
ip address dhcp-alloc [ client-identifier mac interface-type interface-number ]
undo ip address dhcp-alloc
View
Interface view
Default Level
2: System level
Parameters
client-identifier mac interface-type interface-number: Specifies the MAC address of an interface using which as the client ID to obtain an IP address.
Description
Use the ip address dhcp-alloc command to configure an interface to use DHCP for IP address acquisition.
Use the undo ip address dhcp-alloc command to cancel an interface from using DHCP.
By default, an interface does not use DHCP for IP address acquisition.
Note that:
l 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.
l The DHCP client sends a DHCP-RELEASE message for releasing the IP address obtained via DHCP, if the interface of the client is down, the message cannot be sent.
l For a sub interface that obtained an IP address via DHCP, using the shutdown command on its primary interface does not make the DHCP client 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