< Home

Example for Configuring Local Port Mirroring (N:1 Mirroring)

N:1 Mirroring Overview

In N:1 mirroring, packets on N mirrored ports are copied to one observing port so that packets on different ports can be copied to the same monitoring device for analysis.

Configuration Notes

  • You must dedicate observing ports for mirroring use and do not configure other services on them to prevent mirrored traffic and other service traffic from affecting each other. Do not configure any member port of an Eth-Trunk as an observing port. If you must do so, ensure that the bandwidth of service traffic on this port and the bandwidth occupied by the mirrored traffic do not exceed the bandwidth limit of the port.

  • If the mirroring function is deployed on many ports of a device, a great deal of internal forwarding bandwidth will be occupied, which affects the forwarding of other services. Additionally, if the mirrored port bandwidth is higher than the observing port bandwidth, for example, 1000 Mbit/s on a mirrored port and 100 Mbit/s on an observing port, the observing port will fail to forward all mirrored packets in a timely manner because of insufficient bandwidth, leading to packet loss.

  • Both physical interfaces and Eth-Trunks can be configured as mirrored ports. If an Eth-Trunk is configured as a mirrored port, its member ports cannot be configured as observing ports.

  • This configuration example applies to all switches running all versions.

Networking Requirements

As shown in Figure 1, three departments (science and technology department 1, science and technology department 2, and administrative department) of a company access the Internet through the Switch, and the monitoring device Server is directly connected to the Switch.

Internet access traffic of the three departments needs to be monitored through the Server.
Figure 1 Local port mirroring networking

Configuration Roadmap

  1. Configure GE0/0/4 of the Switch as a local observing port to forward mirrored packets to the Server.
  2. Configure GE0/0/1 through GE0/0/3 of the Switch as mirrored ports to copy Internet access traffic of the three departments to the local observing port.

Procedure

  1. Configure an observing port.

    # Configure GE0/0/4 of the Switch as a local observing port.

    <HUAWEI> system-view
    [HUAWEI] sysname Switch
    [Switch] observe-port 1 interface gigabitethernet 0/0/4     //Configure GE0/0/4 as a local observing port 1.

  2. Configure mirrored ports.

    # Configure GE0/0/1 through GE0/0/3 of the Switch as mirrored ports to copy the packets received by the mirrored ports to the local observing port.

    [Switch] interface gigabitethernet 0/0/1
    [Switch-GigabitEthernet0/0/1] port-mirroring to observe-port 1 inbound     //Mirror incoming traffic on GE0/0/1 to observing port 1.
    [Switch-GigabitEthernet0/0/1] quit
    [Switch] interface gigabitethernet 0/0/2
    [Switch-GigabitEthernet0/0/2] port-mirroring to observe-port 1 inbound     //Mirror incoming traffic on GE0/0/2 to observing port 1.
    [Switch-GigabitEthernet0/0/2] quit
    [Switch] interface gigabitethernet 0/0/3
    [Switch-GigabitEthernet0/0/3] port-mirroring to observe-port 1 inbound     //Mirror incoming traffic on GE0/0/3 to observing port 1.
    [Switch-GigabitEthernet0/0/3] return

  3. Verify the configuration.

    # Check the observing port configuration.

    <Switch> display observe-port
      ----------------------------------------------------------------------
      Index          : 1
      Untag-packet   : No
      Interface      : GigabitEthernet0/0/4
      ----------------------------------------------------------------------

    # Check the mirrored port configuration.

    <Switch> display port-mirroring
      ----------------------------------------------------------------------
      Observe-port 1 : GigabitEthernet0/0/4
      ----------------------------------------------------------------------
      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
      ----------------------------------------------------------------------  

Configuration Files

Configuration file of the Switch

#
sysname Switch
#
observe-port 1 interface GigabitEthernet0/0/4
#
interface GigabitEthernet0/0/1
 port-mirroring to observe-port 1 inbound
#
interface GigabitEthernet0/0/2
 port-mirroring to observe-port 1 inbound
#
interface GigabitEthernet0/0/3
 port-mirroring to observe-port 1 inbound
#
return
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >