Example for Configuring Observing Ports for the Upstream and Downstream Packets of a Mirrored Port

Networking Requirements

On the network shown in Figure 1, the user packets of VLAN 10 and VLAN 20 are sent to DeviceB through SwitchA. To monitor the upstream and downstream VLAN 10 packets that are sent from SwitchA to DeviceB through interface2, configure interface1 on DeviceB as the observing port for the upstream VLAN packets of interface2 and interface4 on DeviceB as the observing port for the downstream VLAN packets of interface2. Then, configure port mirroring on interface2 to copy all upstream packets of interface2 to interface1 for analysis by HostD and copy all downstream packets of interface2 to interface4 for analysis by HostE.

Figure 1 Networking of port mirroring
  • The configurations in this example are performed on DeviceB and DeviceC, both of which can be HUAWEI NetEngine 8000 F Series devices.
  • Interfaces 1 through 4 in this example represent GE0/1/0, GE0/1/16, GE0/1/17, and GE0/1/1, respectively.

Device Name

Interface Number

Interface IP Address

Interface MAC Address

DeviceB

GE0/1/0

10.10.1.1/24

-

DeviceB

GE0/1/16

-

-

DeviceB

GE0/1/17

10.1.1.2/24

-

DeviceB

GE0/1/1

10.20.1.1/24

-

Precautions

Do not configure an interface as both an observing port and a mirrored port.

Configuration Roadmap

The configuration roadmap is as follows:

  1. On DeviceB, configure GE0/1/0 as the observing port for the upstream packets of the mirrored port and GE0/1/1 as the observing port for the downstream packets of the mirrored port.

  2. On DeviceB, configure GE0/1/16 as the mirrored port and enable the port mirroring function.

Data Preparation

To complete the configuration, you need the following data:

  • Interface types and numbers for the observing and mirrored ports

Procedure

  1. Configure IP addresses for device interfaces and ensure route reachability. (The configuration details are not mentioned here.)
  2. Configure GE0/1/0 as an observing port.

    <DeviceB> system-view
    [~DeviceB] interface gigabitethernet0/1/0
    [~DeviceB-GigabitEthernet0/1/0] port-observing observe-index 1
    [*DeviceB-GigabitEthernet0/1/0] commit
    [~DeviceB-GigabitEthernet0/1/0] quit

  3. Configure GE0/1/1 as an observing port.

    <DeviceB> system-view
    [~DeviceB] interface gigabitethernet0/1/1
    [~DeviceB-GigabitEthernet0/1/1] port-observing observe-index 2
    [*DeviceB-GigabitEthernet0/1/1] commit
    [~DeviceB-GigabitEthernet0/1/1] quit

  4. On GE0/1/16, enable the port mirroring function for the upstream and downstream VLAN packets.

    [~DeviceB] vlan 10
    [*DeviceB-vlan10] commit
    [~DeviceB-vlan10] quit
    [~DeviceB] interface gigabitethernet0/1/16
    [~DeviceB-GigabitEthernet0/1/16] portswitch
    [*DeviceB-GigabitEthernet0/1/16] port default vlan 10
    [*DeviceB-GigabitEthernet0/1/16] port-mirroring inbound vlan 10
    [*DeviceB-GigabitEthernet0/1/16] port-mirroring outbound vlan 10
    [*DeviceB-GigabitEthernet0/1/16] commit
    [~DeviceB-GigabitEthernet0/1/16] quit

  5. Specify observing ports for the upstream and downstream packets of the mirrored port.

    [~DeviceB] interface gigabitethernet0/1/16
    [~DeviceB-GigabitEthernet0/1/16] port-mirroring to observe-index 1 inbound
    [*DeviceB-GigabitEthernet0/1/16] port-mirroring to observe-index 2 outbound
    [*DeviceB-GigabitEthernet0/1/16] commit
    [~DeviceB-GigabitEthernet0/1/16] quit

    After the preceding configurations are complete, the upstream and downstream packets of GE0/1/16 are mirrored to GE0/1/0 and GE0/1/1, respectively.

  6. Verifying the Configuration

    To view traffic mirroring information, run the ping command or use other traffic generation methods. For example, if SwitchA sends 10 ping packets to GE0/1/16 of DeviceB, HostD is expected to receive all the upstream packets sent from SwitchA.

    Check traffic statistics about GE0/1/0 on DeviceB.

    <DeviceB> display interface gigabitethernet0/1/0
    GigabitEthernet0/1/0 current state : UP
    Line protocol current state : UP
    Description:HUAWEI, GigabitEthernet0/1/0 Interface
    Route Port,The Maximum Transmit Unit is 1500
    Internet protocol processing : disabled
    IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 00e0-fc7d-a497
    The Vendor PN is HFBR-5710L
    Port BW: 1G, Transceiver max BW: 1G, Transceiver Mode: MultiMode
    WaveLength: 850nm, Transmission Distance: 550m
     Loopback:none, full-duplex mode, negotiation: disable, Pause Flowcontrol:Send and Receive Enable
    Statistics last cleared:never
        Last 300 seconds input rate: 0 bits/sec, 0 packets/sec
        Last 300 seconds output rate: 0 bits/sec, 0 packets/sec
        Input: 107628 bytes, 1016 packets
        Output: 107628 bytes, 1016 packets
        Input:
          Unicast: 0, Multicast: 0
          Broadcast: 0, JumboOctets: 0
          CRC: 0, Symbol: 0
          Overrun: 0 , InRangeLength: 0
          LongPacket: 0 , Jabber: 0, Alignment: 0
          Fragment: 0, Undersized Frame: 0
          RxPause: 0
        Output:
          Unicast: 10, Multicast: 0
          Broadcast: 0, Jumbo: 0
          Lost: 0, Overflow: 0, Underrun: 0
          TxPause: 0                                    

Configuration Files

  • DeviceB configuration file

    #
     sysname DeviceB
     vlan 10
    #
    interface GigabitEthernet0/1/16
     portswitch
     port default vlan 10
     port-mirroring inbound vlan 10
     port-mirroring outbound vlan 10
     port-mirroring to observe-index 1 inbound
     port-mirroring to observe-index 2 outbound
    #
    interface GigabitEthernet0/1/17
     ip address 10.1.1.2 255.255.255.0
    #
    interface GigabitEthernet0/1/0
     ip address 10.10.1.1 255.255.255.0
     port-observing observe-index 1
    #
    interface GigabitEthernet0/1/1
     ip address 10.20.1.1 255.255.255.0
     port-observing observe-index 2
    #
    return
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >