In Figure 1, three departments (R&D departments 1 and 2 and marketing department) of a company access the Internet through the switch, and monitoring devices Server1 and Server2 are directly connected to the switch.
Internet-bound traffic from the three departments needs to be copied and sent to different servers for different monitoring and analysis purposes.
# Configure GE0/0/4 and GE0/0/5 of the Switch as local observing ports in a batch.
<HUAWEI> system-view [HUAWEI] sysname Switch [Switch] observe-port 1 interface-range gigabitethernet 0/0/4 gigabitethernet 0/0/5
[Switch] observe-port 1 forwarding disable
# Configure GE0/0/1 through GE0/0/3 of the Switch as mirrored ports to copy the packets received by the mirrored ports and send them to different local observing ports.
In M:N mirroring, the number of observing ports is determined by the mirroring specifications. For details, see M:N Mirroring Specifications.
[Switch] interface gigabitethernet 0/0/1 [Switch-GigabitEthernet0/0/1] port-mirroring to observe-port 1 inbound [Switch-GigabitEthernet0/0/1] quit [Switch] interface gigabitethernet 0/0/2 [Switch-GigabitEthernet0/0/2] port-mirroring to observe-port 1 inbound [Switch-GigabitEthernet0/0/2] quit [Switch] interface gigabitethernet 0/0/3 [Switch-GigabitEthernet0/0/3] port-mirroring to observe-port 1 inbound [Switch-GigabitEthernet0/0/3] return
# Check the observing port configuration.
<Switch> display observe-port ---------------------------------------------------------------------- Index : 1 Untag-packet : No Forwarding : No Interface-range: GigabitEthernet0/0/4 to GigabitEthernet0/0/5 ----------------------------------------------------------------------
# Check the mirrored port configuration.
<Switch> display port-mirroring ---------------------------------------------------------------------- Observe-port 1 : GigabitEthernet0/0/4 to GigabitEthernet0/0/5 ---------------------------------------------------------------------- Port-mirror: ---------------------------------------------------------------------- Mirror-port Direction Observe-port ---------------------------------------------------------------------- 1 GigabitEthernet0/0/1 Inbound Observe-port 1 2 GigabitEthernet0/0/2 Inbound Observe-port 1 3 GigabitEthernet0/0/3 Inbound Observe-port 1 ----------------------------------------------------------------------