Figure 2-1 Network diagram for configuring traffic mirroring to a port
# Enter system view.
# Configure basic IPv4 ACL 2000 to match packets with the source IP address 192.168.0.1.
[Sysname] acl number 2000
[Sysname-acl-basic-2000] rule permit source 192.168.0.1 0
# Create class 1 and configure the class to use ACL 2000 for traffic classification.
[Sysname] traffic classifier 1
[Sysname-classifier-1] if-match acl 2000
# Create behavior 1 and configure the action of mirroring traffic to GigabitEthernet1/0/2 in the traffic
[Sysname] traffic behavior 1
[Sysname-behavior-1] mirror-to interface GigabitEthernet 1/0/2
# Create QoS policy 1 and associate traffic behavior 1 with class 1 in the QoS policy.
[Sysname] qos policy 1
[Sysname-policy-1] classifier 1 behavior 1
# Apply the QoS policy to the incoming traffic of GigabitEthernet 1/0/1.
[Sysname] interface GigabitEthernet 1/0/1
[Sysname-GigabitEthernet1/0/1] qos apply policy 1 inbound
After the configurations, you can monitor all packets sent from Host A on the data monitoring device.