216
# Configure the IPv4 source guard function on GigabitEthernet 1/0/1 to filter packets based on the
source IP address.
[DeviceB] interface gigabitethernet 1/0/1
[DeviceB-GigabitEthernet1/0/1] ip verify source ip-address
# Configure GigabitEthernet 1/0/1 to allow only IP packets with the source IP address of 192.168.0.2
to pass.
[DeviceB-GigabitEthernet1/0/1] ip source binding ip-address 192.168.0.2
[DeviceB-GigabitEthernet1/0/1] quit
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 ip source binding static
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 ip source binding static
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 device 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 device to record the DHCP snooping entry of the host. Enable the IPv4
source guard function on the device’s port GigabitEthernet 1/0/1 to filter packets based on the DHCP
snooping entry, allowing only packets from clients that obtain IP addresses through the DHCP server to
pass.
For information about DHCP server configuration, see
Layer 3—IP Services Configuration Guide.
Figure 68
Network diagram for configuring dynamic IPv4 source guard binding by DHCP snooping