1. Configure an observing port
. # Configure interface GE0/0/2 on the Switch as a local observing port.
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] observe-port 1 interface gigabitethernet 0/0/2 //This port is connected to a computer, and wireshark captures packets
2. Configure the mirror port
# Configure interface GE0/0/ on the Switch 1 is a mirroring port, bind its inbound direction to the local observing port, that is, copy the packets received by the mirroring port to the local observing port.
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] port-mirroring to observe-port 1 both // Capture the packets in both directions of the mirror port
[Switch-GigabitEthernet0/0/1] return