15-DHCP-Snooping Command

Download


Chapter 1  DHCP-Snooping Configuration Commands

1.1  DHCP-Snooping Configuration Commands

1.1.1  dhcp-snooping

Syntax

dhcp-snooping

undo dhcp-snooping

View

System view

Parameter

None

Description

Use dhcp-snooping command to enable the DHCP-snooping function for a switch.

Use the undo dhcp-snooping command to disable the DHCP-snooping function.

By default, the DHCP-snooping function is disabled.

Related command: display dhcp-snooping.

Example

# Enable the DHCP-snooping function.

<H3C> system-view

System View: return to User View with Ctrl+Z

[H3C] dhcp-snooping

1.1.2  display dhcp-snooping

Syntax

display dhcp-snooping [ unit unit-id ]

View

Any view

Parameter

unit unit-id: Displays the DHCP-snooping information on other devices in cluster when the switch is in cluster. unit-id indicates the number of the device whose DHCP-snooping information needs to be viewed.

Description

Use the display dhcp-snooping command to display the correspondence between user IP addresses and MAC addresses recorded by the DHCP snooping function.

Related command: dhcp-snooping.

Example

# Display the correspondence between user IP addresses and MAC addresses recorded by the DHCP snooping function.

<H3C> display dhcp-snooping

DHCP-Snooping is enabled.

 Type : D--Dynamic , S--Static

 Unit ID : 1

 Type IP Address      MAC Address     Lease     VLAN Interface

 ==== =============== =============== ========= ==== =================

 D    192.168.0.4     0010-5ce6-067c  N/A       1    Ethernet1/0/1

---   1 dhcp-snooping item(s) of unit 1 found   ---

Table 1-1 Description on the fields of the display dhcp snooping command

Field

Description

Type

Binding type:D——Dynamic Binding;S——Static Binding

Unit ID

Unit ID

IP Address

IP address assigned to the DHCP client

MAC Address

MAC address of the DHCP client

Lease

Lease period of the IP address in seconds

VLAN

VLAN where the port connecting the DHCP client resides

Interface

Port to which the DHCP client is connected