411
# Configure port GigabitEthernet 1/0/1 of Router A to allow only IP packets with the source MAC
address of 0001-0203-0406 and the source IP address of 192.168.0.1 to pass.
[RouterA] interface Gigabitethernet 1/0/1
[RouterA-GigabitEthernet1/0/1] user-bind ip-address 192.168.0.1 mac-address 0001-0203-
0406
[RouterA-GigabitEthernet1/0/1] quit
2.
Configure Router B.
# Configure port GigabitEthernet 1/0/2 of Router B to allow only IP packets with the source MAC
address of 0001-0203-0406 and the source IP address of 192.168.0.1 to pass.
<RouterB> system-view
[RouterB] interface Gigabitethernet 1/0/2
[RouterB-GigabitEthernet 1/0/2] user-bind ip-address 192.168.0.1 mac-address 0001-0203-
0406
[RouterB-GigabitEthernet 1/0/2] quit
# Configure port GigabitEthernet 1/0/1 of Router B to allow only IP packets with the source IP address
of 192.168.0.2 to pass.
[RouterB] interface Gigabitethernet 1/0/1
[RouterB-GigabitEthernet1/0/1] user-bind ip-address 192.168.0.2
[RouterB-GigabitEthernet1/0/1] quit
Verification
# On Router A, display information about static IPv4 source guard binding entries. The output shows that
the static IPv4 source guard binding entries are configured successfully.
[RouterA] display user-bind
Total entries found: 2
MAC Address IP Address VLAN Interface Type
0001-0203-0405 192.168.0.3 N/A GE1/0/2 Static
0001-0203-0406 192.168.0.1 N/A GE1/0/1 Static
# On Router B, display information about static IPv4 source guard binding entries. The output shows that
the static IPv4 source guard binding entries are configured successfully.
[RouterB] display user-bind
Total entries found: 2
MAC Address IP Address VLAN Interface Type
0001-0203-0406 192.168.0.1 N/A GE1/0/2 Static
N/A 192.168.0.2 N/A GE1/0/1 Static
Dynamic IPv4 source guard binding by DHCP snooping
configuration example
Network requirements
As shown in
, the router connects to the host (client) and the DHCP server through ports
GigabitEthernet 1/0/1 and GigabitEthernet 1/0/2, respectively. The host obtains an IP address from
the DHCP server.
Enable DHCP snooping on the router to record the DHCP snooping entry of the host. Enable the dynamic
IPv4 source guard binding function on the router's port GigabitEthernet 1/0/1 to filter packets based on