23-DHCP Command

Download

Table of Contents

Chapter 1 DHCP Server Configuration Commands. 1-1

1.1 DHCP Server Configuration Commands. 1-1

1.1.1 dhcp enable. 1-1

1.1.2 dhcp select global 1-1

1.1.3 dhcp select interface. 1-2

1.1.4 dhcp server detect 1-3

1.1.5 dhcp server dns-list 1-4

1.1.6 dhcp server domain-name. 1-5

1.1.7 dhcp server expired. 1-6

1.1.8 dhcp server forbidden-ip. 1-7

1.1.9 dhcp server ip-pool 1-8

1.1.10 dhcp server nbns-list 1-9

1.1.11 dhcp server netbios-type. 1-10

1.1.12 dhcp server option. 1-11

1.1.13 dhcp server ping. 1-12

1.1.14 dhcp server static-bind. 1-13

1.1.15 display dhcp server conflict 1-14

1.1.16 display dhcp server expired. 1-15

1.1.17 display dhcp server free-ip. 1-16

1.1.18 display dhcp server ip-in-use. 1-17

1.1.19 display dhcp server statistics. 1-18

1.1.20 display dhcp server tree. 1-19

1.1.21 dns-list 1-21

1.1.22 domain-name. 1-22

1.1.23 expired. 1-23

1.1.24 gateway-list 1-24

1.1.25 nbns-list 1-25

1.1.26 netbios-type. 1-25

1.1.27 network. 1-26

1.1.28 option. 1-27

1.1.29 reset dhcp server conflict 1-28

1.1.30 reset dhcp server ip-in-use. 1-29

1.1.31 reset dhcp server statistics. 1-29

1.1.32 static-bind ip-address. 1-30

1.1.33 static-bind mac-address. 1-31

Chapter 2 DHCP Relay Configuration Commands. 2-1

2.1 DHCP Relay Configuration Commands. 2-1

2.1.1 address-check. 2-1

2.1.2 address-check dhcp-relay. 2-1

2.1.3 address-check no-matched. 2-2

2.1.4 dhcp relay information enable. 2-3

2.1.5 dhcp relay information strategy. 2-4

2.1.6 dhcp-security static. 2-4

2.1.7 dhcp-server 2-5

2.1.8 dhcp-server ip. 2-6

2.1.9 display dhcp-security. 2-7

2.1.10 display dhcp-server 2-7

2.1.11 display dhcp-server interface. 2-9

2.1.12 reset dhcp-server 2-10

Chapter 3 DHCP Snooping Configuration Commands. 3-1

3.1 DHCP Snooping Configuration Commands. 3-1

3.1.1 dhcp-snooping. 3-1

3.1.2 dhcp-snooping trust 3-1

3.1.3 dhcp-snooping information enable. 3-2

3.1.4 display dhcp-snooping. 3-3

3.1.5 display dhcp-snooping trust 3-4

3.1.6 display dhcp-snooping vlan. 3-4

3.1.7 reset dhcp-snooping. 3-5

 


Chapter 1  DHCP Server Configuration Commands

1.1  DHCP Server Configuration Commands

1.1.1  dhcp enable

Syntax

dhcp enable

undo dhcp enable

View

System view

Parameter

None

Description

Use the dhcp enable command to enable DHCP.

Use the undo dhcp enable command to disable DHCP.

By default, DHCP is enabled.

You must first enable DHCP before performing other DHCP-related configurations. This configuration is necessary for both DHCP servers and DHCP relays.

Example

# Enable DHCP.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] dhcp enable

1.1.2  dhcp select global

Syntax

VLAN interface view:

dhcp select global

undo dhcp select

System view:

dhcp select global { interface interface-type interface-number [ to interface-type interface-number ] | all }

undo dhcp select { interface interface-type interface-number [ to interface-type interface-number ] | all }

View

System view/VLAN interface view

Parameter

interface interface-type interface-number [ to interface-type interface-number ]: Specifies the interface(s) to operate in global address pool mode. The interface-type and interface-number arguments are the type and number of an interface. The to keyword separates the start and the end of an interface range.

all: Specifies all ports to operate in global address pool mode.

Description

Use the dhcp select global command to configure the specified interface(s) or all interfaces to operate in global DHCP address pool mode. Upon receiving a DHCP packet from a DHCP client through an interface operating in global DHCP address pool mode, the DHCP server chooses an IP address from a global DHCP address pool of the local DHCP server and assigns the address to the DHCP client.

Use the undo dhcp select command to restore the default DHCP packet processing mode.

By default, an interface operates in local DHCP server global address pool mode.

Example

# Configure all interfaces to operate in global DHCP address pool mode, so that when a DHCP packet is received from a DHCP client through any interface, the DHCP server assigns an IP address in local global DHCP address pools to the DHCP client.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] dhcp select global all

1.1.3  dhcp select interface

Syntax

VLAN interface view:

dhcp select interface

undo dhcp select

System view:

dhcp select interface { interface interface-type interface-number [ to interface-type interface-number ] | all }

undo dhcp select { interface interface-type interface-number [ to interface-type interface-number ] | all }

View

System view/VLAN interface view

Parameter

interface interface-type interface-number [ to interface-type interface-number ]: Specifies the interface(s) to operate in interface address pool mode.

all: Specifies all interfaces to operate in interface address pool mode.

Description

Use the dhcp select interface command to configure the specified interface(s) to operate in DHCP interface address pool mode. Upon receiving a DHCP packet from a DHCP client through an interface operating in interface address pool mode, the DHCP server chooses an IP address from the interface address pool of the local DHCP server and assigns the address to the DHCP client.

Use the undo dhcp select command to restore the default DHCP packet processing mode.

By default, an interface operates in local DHCP server global address pool mode.

Example

# Configure all interfaces to operate in interface address pool mode, so that when a DHCP packet is received from a DHCP client through any interface, the DHCP server assigns an IP address in the local interface address pool to the DHCP client.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] dhcp select interface all

1.1.4  dhcp server detect

Syntax

dhcp server detect

undo dhcp server detect

View

System view

Parameter

None

Description

Use the dhcp server detect command to enable the unauthorized DHCP server detecting function.

Use the undo dhcp server detect command to disable the unauthorized DHCP server detecting function.

By default, the unauthorized DHCP server detecting function is disabled.

With the unauthorized DHCP server detecting function enabled, a DHCP server tracks the information (such as the IP addresses and interfaces) of DHCP servers to enable the administrator to detect unauthorized DHCP servers in time and take proper measures.

Example

# Enable the unauthorized DHCP server detecting function.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] dhcp server detect

1.1.5  dhcp server dns-list

Syntax

VLAN interface view:

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

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

System view:

dhcp server dns-list ip-address&<1-8> { interface interface-type interface-number [ to interface-type interface-number ] | all }

undo dhcp server dns-list { ip-address | all } { interface interface-type interface-number [ to interface-type interface-number ] | all }

View

System view/VLAN interface view

Parameter

ip-address&<1-8>: IP address of a DNS server. &<1-8> means you can provide up to eight DNS server IP addresses. When inputting more than one DNS server IP address, separate two neighboring IP addresses with a space.

interface interface-type interface-number [ to interface-type interface-number ]: Specifies the interface(s), through which you can specify the corresponding interface address pools.

all: (In comparison with the ip-address argument) Specifies all DNS server IP addresses.

all: (In comparison with the interface keyword) Specifies all interface address pools.

Description

Use the dhcp server dns-list command to configure DNS server IP address(es) for the DHCP address pool(s) of specified interface(s).

Use the undo dhcp server dns-list command to remove the DNS server IP address(es) configured for the DHCP address pool(s) of the specified interface(s).

By default, no DNS server IP address is configured for a DHCP interface address pool.

If you execute the dhcp server dns-list command repeatedly, the new configuration overwrites the previous one.

Related command: dns-list.

Example

# Configure the DNS server IP address 1.1.1.254 for the DHCP address pool of the VLAN interface 1.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] interface Vlan-interface 1

[H3C-Vlan-interface1] dhcp server dns-list 1.1.1.254

1.1.6  dhcp server domain-name

Syntax

VLAN interface view:

dhcp server domain-name domain-name

undo dhcp server domain-name

System view:

dhcp server domain-name domain-name { interface interface-type interface-number [ to interface-type interface-number ] | all }

undo dhcp server domain-name { interface interface-type interface-number [ to interface-type interface-number ] | all }

View

System view/VLAN interface view

Parameter

domain-name: Domain name of the DHCP clients whose IP addresses are from the specified interface address pool(s). This argument is a string of 3 to 50 characters.

interface interface-type interface-number [ to interface-type interface-number ]: Specifies the interface(s), through which you can specify the corresponding interface address pool(s).

all: Specifies all interface address pools.

Description

Use the dhcp server domain-name command to configure a domain name for the DHCP clients whose IP addresses are from the specified interface address pool(s).

Use the undo dhcp server domain-name command to remove the configured domain name.

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

Related command: domain-name.

Example

# Set aabbcc.com as the domain name of the DHCP client whose IP address is obtained from the DHCP address pool of the current VLAN interface 1.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] interface Vlan-interface 1

[H3C-Vlan-interface1] dhcp server domain-name aabbcc.com

1.1.7  dhcp server expired

Syntax

VLAN interface view:

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

undo dhcp server expired

System view:

dhcp server expired { day day [ hour hour [ minute minute ] ] | unlimited } { interface interface-type interface-number [ to interface-type interface-number ] | all }

undo dhcp server expired { interface interface-type interface-number [ to interface-type interface-number ] | all }

View

System view/VLAN interface view

Parameter

day day: Specifies the number of days. The day argument ranges from 0 to 365.

hour hour: Specifies the number of hours. The hour argument ranges from 0 to 23.

minute minute: Specifies the number of minutes. The minute argument ranges from 0 to 59.

unlimited: Specifies that the lease time is unlimited. (But actually, the system limits the maximum lease time to about 25 years.)

interface interface-type interface-number [ to interface-type interface-number ]: Specifies the interface(s), through which you can specify the corresponding interface address pool(s).

all: Specifies all interface address pools.

Description

Use the dhcp server expired command to configure the lease time of the IP addresses in the specified interface address pool(s).

Use the undo dhcp server expired command to restore the default lease time.

The default lease time is one day.

Related command: expired.

Example

# Set the lease time of the IP addresses in all interface address pools to be 1 day, 2 hours and 3 minutes.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] dhcp server expired day 1 hour 2 minute 3 all

1.1.8  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

Parameter

low-ip-address: IP address that is not available for being assigned to DHCP clients automatically (An IP address of this kind is known as a forbidden IP address). This argument also marks the lower end of the range of the forbidden IP addresses.

high-ip-address: IP address that is not available for being assigned to DHCP clients. This argument also marks the higher end of the range of the forbidden IP addresses. Note that this argument cannot be less than the low-ip-address argument. If you do not provide this argument, only the IP address specified by the low-ip-address argument is forbidden.

Description

Use the dhcp server forbidden-ip command to forbid the specified IP addresses in a DHCP address pool to be automatically assigned.

Use the undo dhcp server forbidden-ip command to cancel this configuration.

By default, all IP addresses in an address pool are allowed to be automatically assigned.

Note that the specified address range cannot contain statically-bound addresses when you use the undo dhcp server forbidden-ip command.

Related command: dhcp server ip-pool, network, static-bind ip-address and dhcp server static-bind.

Example

# Forbid the IP addresses in the range 10.110.1.1 to 10.110.1.63 to be automatically assigned.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] dhcp server forbidden-ip 10.110.1.1 10.110.1.63

1.1.9  dhcp server ip-pool

Syntax

dhcp server ip-pool pool-name

undo dhcp server ip-pool pool-name

View

System view

Parameter

pool-name: Name of a DHCP address pool, which uniquely identifies the address pool. This argument is a string of 1 to 35 characters.

Description

Use the dhcp server ip-pool command to create a global DHCP address pool and enter DHCP address pool view. If the address pool identified by the pool-name argument already exists, this command leads you to DHCP address pool view.

Use the undo dhcp server ip-pool command to remove a specified DHCP address pool.

By default, no global DHCP address pool is created.

Related command: dhcp enable.

Example

# Create DHCP address pool 0.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] dhcp server ip-pool 0

[H3C-dhcp-pool-0]

1.1.10  dhcp server nbns-list

Syntax

VLAN interface view:

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

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

System view:

dhcp server nbns-list ip-address&<1-8> { interface interface-type interface-number [ to interface-type interface-number ] | all }

undo dhcp server nbns-list { ip-address | all } { interface interface-type interface-number [ to interface-type interface-number ] | all }

View

System view/VLAN interface view

Parameter

ip-address&<1-8>: IP address of a NetBIOS server. &<1-8> means you can provide up to eight NetBIOS server IP addresses. When inputting more than one NetBIOS server IP address, separate two neighboring IP addresses with a space.

interface interface-type interface-number [ to interface-type interface-number ]: Specifies the interface(s), through which you can specify the corresponding interface address pool(s).

all: (In comparison with the ip-address argument) Specifies all NetBIOS server IP addresses.

all: (In comparison with the interface keyword) Specifies all interface address pools.

Description

Use the dhcp server nbns-list command to configure NetBIOS server IP address(es) for the specified DHCP interface address pool(s).

Use the undo dhcp server nbns-list command to remove the NetBIOS server IP address(es) configured for the specified DHCP interface address pool(s).

By default, no NetBIOS server IP address is configured for a DHCP interface address pool.

If you execute the dhcp server nbns-list command repeatedly, the new configuration overwrites the previous one.

Related command: nbns-list and dhcp server netbios-type.

Example

# Configure the NetBIOS server IP address 10.12.1.99 for all the DHCP interface address pools.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] dhcp server nbns-list 10.12.1.99 all

1.1.11  dhcp server netbios-type

Syntax

VLAN interface view:

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

undo dhcp server netbios-type

System view:

dhcp server netbios-type { b-node | h-node | m-node | p-node } { interface interface-type interface-number [ to interface-type interface-number ] | all }

undo dhcp server netbios-type { interface interface-type interface-number [ to interface-type interface-number ] | all }

View

System view/VLAN interface view

Parameter

b-node: Specifies the broadcast type. Nodes of this type acquire host name-to-IP address mapping by broadcasting.

p-node: Specifies the peer-to-peer type. Nodes of this type acquire host name-to-IP address mapping by communicating with the NetBIOS server.

m-node: Specifies the m-typed mixed type. Nodes of this type are p-nodes with some broadcasting features. (The character m here stands for mixed.)

h-node: Specifies the hybrid type. Nodes of this type are b-nodes with peer-to-peer communicating features.

interface interface-type interface-number [ to interface-type interface-number ]: Specifies the interface(s), through which you can specify the corresponding interface address pools.

all: Specifies all interface address pools.

Description

Use the dhcp server netbios-type command to configure the NetBIOS node type of the DHCP clients whose IP addresses are from the specified interface address pool(s).

Use the undo dhcp server netbios-type command to restore the default NetBIOS node type.

By default, no NetBIOS node type is specified and the default NetBIOS node type is h-node.

Related command: netbios-type and dhcp server nbns-list.

Example

# Specify p-node as the NetBIOS node type of the DHCP clients whose IP addresses are from the DHCP address pool of VLAN interface 1.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] interface vlan-interface 1

[H3C-Vlan-interface1] dhcp server netbios-type p-node

1.1.12  dhcp server option

Syntax

VLAN interface view:

dhcp server option code { ascii ascii-string | hex hex-string&<1-10> | ip-address ip-address&<1-8> }

undo dhcp server option code

System view:

dhcp server option code { ascii ascii-string | hex hex-string&<1-10> | ip-address ip-address&<1-8> } { interface interface-type interface-number [ to interface-type interface-number ] | all }

undo dhcp server option code { interface interface-type interface-number [ to interface-type interface-number ] | all }

View

System view/VLAN interface view

Parameter

code: Customized option number, ranging from 2 to 254. Note that this argument cannot be 3, 6, 15, 44, 46, 50 through 55, 57 through 59.

ascii ascii-string: Specifies a string that is of 1 to 63 characters. Note that each character of the string must be an ASCII character.

hex hex-string&<1-10>: Specifies strings, a hexadecimal number of 1 to 8 digits. &<1-10> means you can provide up to 10 such strings. When inputting more than one string, separate two neighboring strings with a space.

ip-address ip-address&<1-8>: Specifies IP addresses. &<1-8> means you can provide up to eight IP addresses. When inputting more than one IP address, separate two neighboring IP addresses with a space.

interface interface-type interface-number [ to interface-type interface-number ]: Specifies the interface(s), through which you can specify the corresponding interface address pools.

all: Specifies all interface address pools.

Description

Use the dhcp server option command to customize DHCP options for the specified DHCP interface address pool(s).

Use the undo dhcp server option command to remove the customized DHCP options.

If you execute the dhcp server option command repeatedly, the new configuration overwrites the previous one.

Related command: option.

Example

# Configure option 100 to be 0x11 and 0x22 for all DHCP interface address pools.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] dhcp server option 100 hex 11 22 all

1.1.13  dhcp server ping

Syntax

dhcp server ping { packets number | timeout milliseconds }

undo dhcp server ping { packets | timeout }

View

System view

Parameter

packets number: Specifies the number of the packets to be sent in a ping test. The number argument ranges from 0 to 10 and defaults to 2. Value 0 means no packet will be sent.

timeout milliseconds: Specifies the timeout time (in milliseconds) of each packet. The milliseconds argument ranges from 0 to 10,000 and defaults to 500.

Description

Use the dhcp server ping command to set the maximum number of the ICMP packets a DHCP server sends in a ping test and the maximum response timeout time of each ICMP packet.

Use the undo dhcp server ping command to restore the default settings.

Example

# Set the maximum number of the packets the DHCP server sends in a ping test to 10, and the timeout time of each packet to 300 milliseconds.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] dhcp server ping packets 10

[H3C] dhcp server ping timeout 300

1.1.14  dhcp server static-bind

Syntax

dhcp server static-bind ip-address ip-address mac-address mac-address

undo dhcp server static-bind { ip-address ip-address | mac-address mac-address }

View

VLAN interface view

Parameter

ip-address: IP address to be statically bound. Note that the specified IP address must belong to the same network segment as that of the VLAN interface.

mac-address: MAC address to which the IP address is statically bound.

Description

Use the dhcp server static-bind command to statically bind an IP address of the current address pool to a MAC address.

Use the undo dhcp server static-bind command to cancel an IP-MAC address binding.

By default, no IP address in an address pool is statically bound.

It should be noted that:

l           An IP address can be statically bound to only one MAC address. A MAC address can be bound with only one IP address statically.

l           The IP address to be statically bound cannot be an interface IP address of the device; otherwise the static binding does not take effect. The device of the bound MAC address can also obtain another IP address.

Example

# Statically bind the IP address 10.1.1.1 to the MAC address 0000-e03f-0305. (Assume that the interface address pool of VLAN interface 1 already exists and the IP address belongs to the address pool.)

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] interface vlan-interface 1

[H3C-Vlan-interface1] dhcp server static-bind ip-address 10.1.1.1 mac-address 0000-e03f-0305

1.1.15  display dhcp server conflict

Syntax

display dhcp server conflict { all | ip ip-address }

View

Any view

Parameter

all: Specifies all IP addresses.

ip-address: Specifies an IP address.

Description

Use the display dhcp server conflict command to display the statistics of IP address conflicts on the DHCP server.

Related command: reset dhcp server conflict.

Example

# Display the statistics of IP address conflicts.

<H3C> display dhcp server conflict all

Address             Discover Time

10.110.1.2         Jan 11 2003 11:57:07 PM

Table 1-1 Description on the fields of the display dhcp server conflict command

Field

Description

Address

Conflicting IP address

Discover Time

Time when the conflict is detected

 

1.1.16  display dhcp server expired

Syntax

display dhcp server expired { ip ip-address | pool [ pool-name ] | interface [ interface-type interface-number ] | all }

View

Any view

Parameter

ip ip-address: Specifies an IP address.

pool [ pool-name ]: Specifies a global address pool. The pool-name argument, a string of 1 to 35 characters, is the name of an address pool. If you do not provide this argument, this command applies to all global address pools.

interface [ interface-type interface-number ]: Specifies a VLAN interface. If you do not specify a VLAN interface, this command applies to all VLAN interfaces.

all: Specifies all DHCP address pools.

Description

Use the display dhcp server expired command to display the lease expiration information about an IP address, or the lease expiration information about all IP addresses in one or all DHCP address pools. When all the IP addresses in an address pool are assigned, the DHCP server assigns the IP addresses that are expired to DHCP clients.

Example

# Display the lease expiration information about the IP addresses in all DHCP address pools.

<H3C> display dhcp server expired all

Global pool:

IP address    Hardware address    Lease expiration          Type

 

Interface pool:

 IP address    Hardware address    Lease expiration          Type

 

--- total 0 entry ---                                     

Table 1-2 Description on the fields of the display dhcp server expired command

Field

Description

Global pool

The information about the expired IP addresses of global address pools

Interface pool

The information about the expired IP addresses of interface address pools

IP address

Bound IP addresses

Hardware address

MAC addresses to which IP addresses are bound

Lease expiration

The time when a lease time expires

Type

Address binding type

 

1.1.17  display dhcp server free-ip

Syntax

display dhcp server free-ip

View

Any view

Parameter

None

Description

Use the display dhcp server free-ip command to display the free (that is, unassigned) IP addresses.

Example

# Display the free IP addresses.

<H3C> display dhcp server free-ip

IP Range from 1.0.0.0              to  2.2.2.1

IP Range from 2.2.2.3              to  2.255.255.255

IP Range from 4.0.0.0              to  4.255.255.255

IP Range from 5.5.5.0              to  5.5.5.0

IP Range from 5.5.5.2              to  5.5.5.255

1.1.18  display dhcp server ip-in-use

Syntax

display dhcp server ip-in-use { ip ip-address | pool [ pool-name ] | interface [ interface-type interface-number ] | all }

View

Any view

Parameter

ip ip-address: Specifies an IP address.

pool [ pool-name ]: Specifies a global address pool. The pool-name argument, a string of 1 to 35 characters, is the name of an address pool. If you do not provide this argument, this command applies to all global address pools.

interface [ interface-type interface-number ]: Specifies a VLAN interface. If you do not specify a VLAN interface, this command applies to all VLAN interfaces.

all: Specifies all address pools.

Description

Use the display dhcp server ip-in-use command to display the address binding information of an IP address, the specified DHCP address pool(s) or all DHCP address pools.

Related command: reset dhcp server ip-in-use.

Example

# Display the address binding information of all DHCP address pools.

<H3C> display dhcp server ip-in-use all

Global pool:

IP address    Hardware address   Lease expiration          Type   

2.2.2.2        4444-4444-4444     NOT Used                    Manual

 

Interface pool:

 IP address    Hardware address   Lease expiration          Type   

5.5.5.1        0050-ba28-930a      NOT Used                    Manual

 

--- total 2 entry ---

Table 1-3 Description on the fields of the display dhcp server ip-in-use command

Field

Description

Global pool

Address binding information of global DHCP address pools

Interface pool

Address binding information of interface DHCP address pools

IP address

Bound IP address

Hardware address

MAC address to which the IP address is bound

Lease expiration

Time when the lease expires

Type

Address binding type

 

1.1.19  display dhcp server statistics

Syntax

display dhcp server statistics

View

Any view

Parameter

None

Description

Use the display dhcp server statistics command to display the statistics on a DHCP server.

Related command: reset dhcp server statistics.

Example

# Display the statistics on a DHCP server.

<H3C> display dhcp server statistics

    Global Pool:

     Pool Number:            5

     Binding

      Auto:              0

      Manual:                1

      Expire:                0

    Interface Pool:

     Pool Number:            1

     Binding

      Auto:              1

      Manual:                0

      Expire:                0

    Boot Request:            6

     Dhcp Discover:      1

     Dhcp Request:           4

     Dhcp Decline:           0

     Dhcp Release:           1

     Dhcp Inform:            0

    Boot Reply:          4

     Dhcp Offer:         1

     Dhcp Ack:               3

     Dhcp Nak:               0

    Bad Messages:            0

Table 1-4 Description on the fields of the display dhcp server statistics command

Field

Description

Global Pool

Statistics about global address pools

Interface Pool

Statistics about interface address pools

Pool Number

Number of address pools

Auto

Number of the automatically bound IP addresses

Manual

Number of the manually bound IP addresses

Expire

Number of the expired IP addresses

Boot Request:              6

 Dhcp Discover:            1

 Dhcp Request:             4

 Dhcp Decline:              0

 Dhcp Release:             1

 Dhcp Inform:                0

Statistics about the DHCP packets received from DHCP clients

Boot Reply:                  4

 Dhcp Offer:                  1

 Dhcp Ack:                   3

 Dhcp Nak:                   0

Statistics about the DHCP packets sent to DHCP clients

Bad Messages

Number of the error DHCP packets

 

1.1.20  display dhcp server tree

Syntax

display dhcp server tree { pool [ pool-name ] | interface [ interface-type interface-number ] | all }

View

Any view

Parameter

pool [ pool-name ]: Specifies a global address pool. The pool-name argument, a string of 1 to 35 characters, is the name of an address pool. If you do not provide this argument, this command applies to all global address pools.

interface [ interface-type interface-number ]: Specifies a VLAN interface. If you do not specify a VLAN interface, this command applies to all VLAN interfaces.

all: Specifies all address pools.

Description

Use the display dhcp server tree command to display information about address pool tree.

Example

# Display the information about address pool tree.

<H3C> display dhcp server tree all

Global pool:

Pool name: 5

network 10.10.1.0 mask 255.255.255.0

Child node:6

Sibling node:7

  option 10 ip-address 255.0.0.0

  expired 1 0 0 

 

Pool name: 6

  static-bind ip-address 10.10.1.2 mask 255.0.0.0

  static-bind mac-address 000f-e2fc-0001

Parent node:5

  option 10 ip-address 255.255.0.0

  expired 1 0 0

 

Pool name: 7

network 10.10.1.64 mask 255.255.255.192

PrevSibling node:5

  option 10 ip-address 255.0.0.0

  gateway-list 2.2.2.2

  dns-list 1.1.1.1 

  domain-name 444444

  nbns-list 3.3.3.3

  expired 1 0 0

Table 1-5 Description on the fields of the display dhcp server tree command

Field

Description

Global pool

Information about global address pools

Interface pool

Information about interface address pools

Pool name

Address pool name

network

Assignable IP address range

static-bind ip-address 10.10.1.2 mask 255.0.0.0

static-bind mac-address 000f-e2fc-0001

Statically bound IP and MAC addresses

Child node:6

The address pool 6 is the child node of this node.

This field can display the information about the following types of node:

Child node: Displays the information about an address pool that is a child of the current address pool.

Parent node: Displays the information about the address pool that is the parent of the current address pool.

Sibling node: Displays the information about the next sibling address pool of the current address pool. (The order of sibling address pools are determined by the time when they are configured.)

PrevSibling node: Displays the information about the previous sibling address pool of the current address pool.

option

Customized DHCP options

expired

The address lease time (in terms of number of days, hours, and minutes)

gateway-list

List of the gateways configured for the DHCP clients

dns-list

List of the DNS servers configured for the DHCP clients

domain-name

The domain name configured for the DHCP clients

nbns-list

List of the NetBIOS servers configured for the DHCP clients

 

1.1.21  dns-list

Syntax

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

undo dns-list { ip-address | all }

View

DHCP address pool view

Parameter

ip-address&<1-8>: IP address of a DNS server. &<1-8> string means you can provide up to eight DNS server IP addresses. When inputting more than one IP address, separate two neighboring IP addresses with a space.

all: Specifies all configured DNS server IP addresses.

Description

Use the dns-list command to configure one or multiple DNS server IP addresses for a global DHCP address pool.

Use the undo dns-list command to remove one or all DNS server IP addresses configured for the DHCP address pool.

By default, no DNS server IP address is configured.

If you execute the dns-list command repeatedly, the new configuration overwrites the previous one.

Related command: dhcp server dns-list and dhcp server ip-pool.

Example

# Configure the DNS server IP address 1.1.1.254 for global DHCP address pool 0.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] dhcp server ip-pool 0

[H3C-dhcp-pool-0] dns-list 1.1.1.254

1.1.22  domain-name

Syntax

domain-name domain-name

undo domain-name

View

DHCP address pool view

Parameter

domain-name: Domain name for the DHCP clients of a global DHCP address pool, a string of 3 to 50 characters.

Description

Use the domain-name command to configure a domain name for the DHCP clients of a global DHCP address pool.

Use the undo domain-name command to remove the domain name.

By default, no domain name is configured for the DHCP clients of a global DHCP address pool.

Related command: dhcp server ip-pool and dhcp server domain-name.

Example

# Configure the domain name “mydomain.com” for the DHCP clients of the global DHCP address pool 0.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] dhcp server ip-pool 0

[H3C-dhcp-pool-0] domain-name mydomain.com

1.1.23  expired

Syntax

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

undo expired

View

DHCP address pool view

Parameter

day day: Specifies the number of days. The day argument ranges from 0 to 365.

hour hour: Specifies the number of hours. The hour argument ranges from 0 to 23.

minute minute: Specifies the number of minutes. The minute argument ranges from 0 to 59.

unlimited: Specifies that the lease time is unlimited. (But actually, the system limits the maximum lease time to about 25 years.)

Description

Use the expired command to configure the lease time of the IP addresses in a global DHCP address pool.

Use the undo expired command to restore the default lease time.

The default lease time is one day.

Related command: dhcp server ip-pool and dhcp server expired.

Example

# Set the lease time of the IP addresses in the global DHCP address pool 0 to 1 day, 2 hours and 3 minutes.

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] dhcp server ip-pool 0

[H3C-dhcp-pool-0] expired day 1 hour 2 minute 3

1.1.24  ga