port-mirroring to

Function

The port-mirroring to command specifies an observing port for mirroring.

The undo port-mirroring to command deletes an observing port for mirroring.

By default, no observing port is specified for an interface.

Format

port-mirroring to observe-index observe-index

port-mirroring to observe-index observe-index &<2-8>

port-mirroring to null0

port-mirroring to observe-index observe-index { inbound | outbound }

undo port-mirroring to observe-index observe-index

undo port-mirroring to observe-index observe-index &<2-8>

undo port-mirroring to null0

undo port-mirroring to observe-index observe-index { inbound | outbound }

Parameters

Parameter Description Value
observe-index observe-index

Specifies the index of an observing port.

The value is an integer that ranges from 1 to 255.

null0

Indicates that interface null0 functions as the observing port.

If no actual observing port is available, you can set the observing port to null0, which allows the device to obtain traffic information on a mirrored port using the user-defined offset and statstics collection.

-

inbound

Assign mirror to the inbound of an interface.

-

outbound

Assign mirror to the outbound of an interface.

-

Views

100ge sub-interface view, 100GE interface view, 10GE sub-interface view, 10G LAN interface view, 10G WAN interface view, 25GE sub-interface view, 25GE interface view, 40GE sub-interface view, 40GE interface view, 50GE interface view, Eth-Trunk sub-interface view, Eth-Trunk interface view, GE optical interface view, GE sub-interface view, EVC view of an Eth-Trunk interface, EVC view of an Ethernet interface

Default Level

3: Management level

Task Name and Operations

Task Name Operations
mirror write

Usage Guidelines

Usage Scenario

You can specify an observing port using one of the following methods:

  • Specify an observing port for an interface board.
  • Specify an observing port for an interface.

    After the port-mirroring to observe-index <observe-index> command is run, the uplink and downlink mirrored traffic on an interface is sent to a specified observing port.

    After the port-mirroring to observe-index <observe-index> &<2-8> command is run the uplink and downlink mirrored traffic on an interface is sent to multiple specified observing ports.

    Run the port-mirroring to null0 command to send the uplink and downlink mirrored traffic of an interface to the null0 observing port.

    After the port-mirroring to observe-index <observe-index> { inbound | outbound } command is run, the uplink and downlink mirrored traffic on an interface can be sent to the same observing port or to different observing ports.

Prerequisites

You have configured a mirrored port and an observing port.

Precautions

  1. By default, when the port-mirroring to observe-index <observe-index> or port-mirroring to observe-index <observe-index> { inbound | outbound } command is run, original packet replication starts from the Layer 2 header if the observing port is a main interface, but starts from the Layer 3 header if the observing port is a sub-interface.
  2. By default, when the port-mirroring to observe-index <observe-index> &<2-8> command is run, original packet replication starts from the Layer 2 header.
  3. When the configuration is switched from port-mirroring to observe-index <observe-index> or port-mirroring to observe-index <observe-index> { inbound | outbound } to port-mirroring to observe-index <observe-index> &<2-8>, pay attention to the format change of mirrored packets.
  4. The port-mirroring without-linklayer-header command can be run to configure a mirrored port to mirror packets from Layer 3 headers. The port-mirroring without-linklayer-header command is not supported in flow mirroring.

Example

# Configure interface null0 as the observing port.
<HUAWEI> system-view
[~HUAWEI] interface GigabitEthernet0/1/0
[~HUAWEI-GigabitEthernet0/1/0] port-mirroring to null0
# Specify the observing port for an interface.
<HUAWEI> system-view
[~HUAWEI] interface GigabitEthernet0/1/0
[~HUAWEI-GigabitEthernet0/1/0] port-mirroring to observe-index 1 2
# Configure an observing port for inbound or outbound mirrored packets on an interface.
<HUAWEI> system-view
[~HUAWEI] interface GigabitEthernet0/1/0
[~HUAWEI-GigabitEthernet0/1/0] port-mirroring to observe-index 1 inbound
Copyright ? Huawei Technologies Co., Ltd.
Copyright ? Huawei Technologies Co., Ltd.
< Previous topic Next topic >