297
[DeviceA] interface gigabitethernet 1/0/2
[DeviceA-GigabitEthernet1/0/2] user-bind ip-address 192.168.0.3 mac-address
0001-0203-0405
[DeviceA-GigabitEthernet1/0/2] quit
# Configure port GigabitEthernet 1/0/1 of Device 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.
[DeviceA] interface gigabitethernet 1/0/1
[DeviceA-GigabitEthernet1/0/1] user-bind ip-address 192.168.0.1 mac-address
0001-0203-0406
2. Configure Device B
# Configure the IP addresses of the interfaces (omitted).
# 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 entries. The output shows that the
static IPv4 source guard 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 entries. The output shows that the
static IPv4 source guard 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
Dynamic IPv4 source guard using DHCP snooping
configuration example
Network requirements
As shown in Figure 106, the device connects to the host (client) and the DHCP server through ports
GigabitEthernet 1/0/1 and GigabitEthernet 1/0/2, respectively.