Static IPv4SG configuration example
Network requirements
As shown in Figure 197, all hosts use static IP addresses.
Configure static IPv4SG bindings on Device A and Device B to meet the following requirements:
GigabitEthernet 1/0/2 of Device A allows only IP packets from Host C to pass.
GigabitEthernet 1/0/1 of Device A allows only IP packets from Host A to pass.
GigabitEthernet 1/0/2 of Device B allow IP packets from Host A to pass.
GigabitEthernet 1/0/1 of Device B allows IP packets from Host B to pass.
Figure 192: Network diagram
Configuration procedure
Configure Device A:
# Configure IP addresses for the interfaces. (Details not shown.)
# Enable IPv4SG on GigabitEthernet 1/0/2.
<DeviceA> system-view [DeviceA] interface gigabitethernet 1/0/2 [DeviceA-GigabitEthernet1/0/2] ip verify source ip-address mac-address
# On GigabitEthernet 1/0/2, configure a static IPv4SG binding for Host C.
[DeviceA-GigabitEthernet1/0/2] ip source binding ip-address 192.168.0.3 mac-address 0001-0203-0405 [DeviceA-GigabitEthernet1/0/2] quit
# Enable IPv4SG on GigabitEthernet 1/0/1.
[DeviceA] interface gigabitethernet 1/0/1 [DeviceA-GigabitEthernet1/0/1] ip verify source ip-address mac-address
# On GigabitEthernet 1/0/1, configure a static IPv4SG binding for Host A.
[DeviceA-GigabitEthernet1/0/1] ip source binding ip-address 192.168.0.1 mac-address 0001-0203-0406 [DeviceA-GigabitEthernet1/0/1] quit
Configure Device B:
# Configure an IP address for each interface. (Details not shown.)
# Enable IPv4SG on GigabitEthernet 1/0/2.
<DeviceB> system-view [DeviceB] interface gigabitethernet 1/0/2 [DeviceB-GigabitEthernet1/0/2] ip verify source ip-address mac-address [DeviceB-GigabitEthernet1/0/2] quit
# On GigabitEthernet 1/0/2, configure a static IPv4SG binding for Host A.
[DeviceB] interface gigabitethernet 1/0/2 [DeviceB-GigabitEthernet1/0/2] ip source binding ip-address 192.168.0.1 mac-address 0001-0203-0406 [DeviceB-GigabitEthernet1/0/2] quit
# Enable IPv4SG on GigabitEthernet 1/0/1.
[DeviceB] interface gigabitethernet 1/0/1 [DeviceB-GigabitEthernet1/0/1] ip verify source ip-address mac-address
# On GigabitEthernet 1/0/1, configure a static IPv4SG binding for Host B.
[DeviceB] interface gigabitethernet 1/0/1 [DeviceB-GigabitEthernet1/0/1] ip source binding mac-address 0001-0203-0407 [DeviceB-GigabitEthernet1/0/1] quit
Verifying the configuration
# Verify that the static IPv4SG bindings are configured successfully on Device A.
<DeviceA> display ip source binding static Total entries found: 2 IP Address MAC Address Interface VLAN Type 192.168.0.1 0001-0203-0405 GE1/0/2 N/A Static 192.168.0.3 0001-0203-0406 GE1/0/1 N/A Static
# Verify that the static IPv4SG bindings are configured successfully on Device B.
<DeviceB> display ip source binding static Total entries found: 2 IP Address MAC Address Interface VLAN Type 192.168.0.1 0001-0203-0406 GE1/0/2 N/A Static N/A 0001-0203-0407 GE1/0/1 N/A Static