As shown in Figure 1, HostA connects to SwitchA through GigabitEthernet0/0/1. The server directly connects to GigabitEthernet0/0/2 on SwitchA.
The server (monitoring device) is required to monitor packets with the 802.1p priority of 6 sent by HostA.
# Configure GigabitEthernet0/0/2 on SwitchA as the observing interface
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] observe-port 1 interface gigabitethernet 0/0/2
# Create ACL 4001 (Layer 2 ACL) on SwitchA to match packets with the 802.1p priority of 6.
[SwitchA] acl 4001 [SwitchA-acl-L2-4001] rule permit 8021p 6 [SwitchA-acl-L2-4001] quit
# Configure an ACL-based traffic policy on GigabitEthernet0/0/1 to mirror packets with the 802.1p priority of 6.
[SwitchA] interface gigabitethernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] traffic-mirror inbound acl 4001 to observe-port 1 [SwitchA-GigabitEthernet0/0/1] quit [SwitchA] quit
# Check the ACL-based traffic policy that has been applied to GigabitEthernet0/0/1 and the traffic behavior.
<SwitchA> display traffic-applied interface gigabitethernet 0/0/1 inbound ----------------------------------------------------------- ACL applied inbound interface GigabitEthernet0/0/1 ACL 4001 rule 5 permit 8021p 6 ACTIONS: mirror to observe-port 1 -----------------------------------------------------------
The preceding information shows that the traffic behavior in the ACL-based traffic policy defines the action of mirroring packets with the 802.1p priority of 6 on GigabitEthernet0/0/1.