257
# Configure port GigabitEthernet 1/0/2 of Device 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.
<DeviceB> system-view
[DeviceB] interface gigabitethernet 1/2
[DeviceB-GigabitEthernet1/0/2] user-bind ip-address 192.168.0.1 mac-address 0001-0203-
0406
[DeviceB-GigabitEthernet1/0/2] quit
# Configure port GigabitEthernet 1/0/1 of Device B to allow only IP packets with the source MAC
address of 0001-0203-0407 and the source IP address of 192.168.0.2 to pass.
[DeviceB] interface gigabitethernet 1/0/1
[DeviceB-GigabitEthernet1/0/1] user-bind ip-address 192.168.0.2 mac-address 0001-0203-
0407
Verification
# On Device A, display information about static IPv4 source guard binding entries. The output shows that
the static IPv4 source guard binding entries are configured successfully.
<DeviceA> 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 Device B, display information about static IPv4 source guard binding entries. The output shows that
the static IPv4 source guard binding entries are configured successfully.
<DeviceB> 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
0001-0203-0407 192.168.0.2 N/A GE1/0/1 Static
Global static binding excluded port configuration example
Network requirements
As shown in
, Host A and Host B connect to access switch Device B, and Device B connects to
distribution switch Device A. Host A is in VLAN 10, and its gateway IP address is 192.168.0.1, which is
the IP address of VLAN interface 1 on Device A. Host B is in VLAN 20, and its gateway IP address is
192.168.1.1, which is the IP address of VLAN interface 2 on Device A. Device B has VLANs but not IP
addresses configured. Host A and Host B communicate with each other through Device A.
Configure Device B to satisfy the following requirements:
Device B can filter IP packets from any host that spoofs Host A or Host B.
Device B forwards packets between Host A and Host B.