412
the DHCP snooping entry, allowing only packets from clients that obtain IP addresses through the DHCP
server to pass.
NOTE:
For information about DHCP server configuration, see
Layer 3—IP Services Configuration Guide.
Figure 142
Network diagram for configuring dynamic IPv4 source guard binding by DHCP snooping
Host
MAC: 0001-0203-0406
Router
DHCP server
GE1/0/1
GE1/0/2
DHCP snooping
DHCP client
Configuration procedure
1.
Configure DHCP snooping.
# Enable DHCP snooping.
<Router> system-view
[Router] dhcp-snooping
# Configure port GigabitEthernet 1/0/2, which is connected to the DHCP server, as a trusted port.
[Router] interface Gigabitethernet 1/0/2
[Router-GigabitEthernet 1/0/2] dhcp-snooping trust
[Router-GigabitEthernet1/0/2] quit
2.
Configure the dynamic IPv4 source guard binding function.
# Configure the dynamic IPv4 source guard binding function on port GigabitEthernet 1/0/1 to filter
packets based on both the source IP address and MAC address.
[Router] interface gigabitethernet 1/0/1
[Router-GigabitEthernet1/0/1] ip check source ip-address mac-address
[Router-GigabitEthernet1/0/1] quit
Verification
# Display the dynamic IPv4 source guard binding entries generated on port GigabitEthernet 1/0/1.
[Router] display ip check source
Total entries found: 1
MAC Address IP Address VLAN Interface Type
0001-0203-0406 192.168.0.1 1 GE1/0/1 DHCP-SNP
# Display DHCP snooping entries to see whether they are consistent with the dynamic entries generated
on GigabitEthernet 1/0/1.
[Router] display dhcp-snooping
DHCP Snooping is enabled.
The client binding table for all untrusted ports.
Type : D--Dynamic , S--Static
Type IP Address MAC Address Lease VLAN Interface
==== =============== ============== ============ ==== =================
D 192.168.0.1 0001-0203-0406 86335 1 GigabitEthernet1/0/1
The output shows that a dynamic IPv4 source guard entry has been generated based on the DHCP
snooping entry.