Global basic DHCP snooping configuration example
Network requirements
As shown in Figure 31GigabitEthernet 1/0/1GigabitEthernet 1/0/3GigabitEthernet 1/0/2, Switch B is connected to the authorized DHCP server through , to the unauthorized DHCP server through , and to the DHCP client through .
Configure only the port connected to the authorized DHCP server to forward the responses from the DHCP server. Enable the DHCP snooping device to record clients' IP-to-MAC bindings by reading DHCP-ACK messages received from the trusted port and the DHCP-REQUEST messages.
Figure 31: Network diagram
Configuration procedure
# Enable DHCP snooping globally.
<SwitchB> system-view [SwitchB] dhcp snooping enable
# Configure as a trusted port.
[SwitchB] interface [SwitchB-] dhcp snooping trust [SwitchB-] quit
# Enable recording clients' IP-to-MAC bindings on .
[SwitchB] interface [SwitchB-] dhcp snooping binding record [SwitchB-] quit
Verifying the configuration
# Verify that the DHCP client can obtain an IP address and other configuration parameters only from the authorized DHCP server. (Details not shown.)
# Display the DHCP snooping entry recorded for the client.
[SwitchB] display dhcp snooping binding