No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

Command Reference

S1720, S2700, S5700, and S6720 V200R011C10

This document describes all the configuration commands of the device, including the command function, syntax, parameters, views, default level, usage guidelines, examples, and related commands.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Mirroring Configuration Commands

Mirroring Configuration Commands

NOTE:

The device supports the mirroring function, which is mainly used for network monitoring and fault management and may use user communication information. Huawei will not collect or save user communication information independently. You must use this function in compliance with applicable laws and regulations. Ensure that your customers' privacy is protected when you are using or saving communication information.

Command Support

Commands provided in this section and all the parameters in the commands are supported by all switch models by default, unless otherwise specified. For details, see specific commands.

display observe-port

Function

The display observe-port command displays the observing port configuration.

Format

display observe-port

Parameters

None

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

After observing ports are configured using the observe-port (local observing port) or observe-port (remote observing port) command in the system view, you can run the display observe-port command to check detailed information about the configured observing ports.

Example

# Display the observing port configuration.

<HUAWEI> display observe-port
  ----------------------------------------------------------------------
  Index          : 1
  Untag-packet   : No
  Interface      : GigabitEthernet0/0/1
  Vlan           : 10
  ----------------------------------------------------------------------
Table 16-65  Description of the display observe-port command output

Item

Description

Index

Index of an observing port. This parameter is configured using the observe-port (local observing port) or observe-port (remote observing port) command.

Untag-packet

Whether to remove VLAN tags of mirrored packets. This parameter is configured using the observe-port (local observing port) command.

NOTE:

VLAN tags of mirrored packets can be removed only when local observing ports are configured on an S5720HI. Each mirrored packet can have at most two VLAN tags removed.

Interface

Observing ports configured one by one. This parameter is configured using the observe-port (local observing port) or observe-port (remote observing port) command.

Vlan

ID of the VLAN to which an observing port belongs. This parameter is configured using the observe-port (remote observing port) command.

display port-mirroring

Function

The display port-mirroring command displays the mirroring configuration.

Format

display port-mirroring

Parameters

None

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

After observing ports and mirrored ports are configured on the switch, you can run the display port-mirroring command to check detailed mirroring configuration on the switch.

Example

# Display the mirroring configuration.

<HUAWEI> display port-mirroring
 ----------------------------------------------------------------------
  Observe-port 1 : GigabitEthernet0/0/2
  ----------------------------------------------------------------------
  Port-mirror:
  ----------------------------------------------------------------------
       Mirror-port               Direction  Observe-port
  ----------------------------------------------------------------------
  1    GigabitEthernet0/0/15     Inbound    Observe-port 1
  ----------------------------------------------------------------------
  Stream-mirror:
  ----------------------------------------------------------------------
       Behavior                  Direction  Observe-port
  ----------------------------------------------------------------------
  1    b1                        -          Observe-port 1
  ----------------------------------------------------------------------
  Vlan-mirror:
  ----------------------------------------------------------------------
  Mirror-vlan              Direction     Observe-port
  ----------------------------------------------------------------------
  10                       Inbound       Observe-port 1
  ----------------------------------------------------------------------
  Mac-mirror:
  ----------------------------------------------------------------------
  Mirror-mac       Vlan    Direction     Observe-port
  ----------------------------------------------------------------------
  0001-0001-0001   10      Inbound       Observe-port 1
  ----------------------------------------------------------------------
Table 16-66  Description of the display port-mirroring command output

Item

Description

Port-mirror

Port mirroring configuration.

Mirror-port

Mirrored port. This parameter is configured using the port-mirroring to observe-port command.

Direction

Direction of mirrored packets:
  • Inbound

  • Outbound

This parameter is configured using the port-mirroring to observe-port command.

Observe-port

Observing port to which mirrored packets are sent. This parameter is configured using the observe-port (local observing port) or observe-port (remote observing port) command.

Stream-mirror

Traffic mirroring configuration.

Behavior

Traffic behavior of traffic mirroring.

Vlan-mirror

VLAN mirroring configuration.

Mirror-vlan

VLAN ID in VLAN mirroring. This parameter is configured using the mirroring to observe-port (VLAN view) command.

Mac-mirror

MAC address mirroring configuration.

Mirror-mac

MAC address in MAC address mirroring. This parameter is configured using the mac-mirroring command.

Vlan

VLAN in which MAC address mirroring is used.

mac-mirroring

Function

The mac-mirroring command copies packets with a specified MAC address to observing ports.

The undo mac-mirroring command cancels copying packets with a specified MAC address to observing ports.

By default, packets with a specified MAC address are not copied to observing ports.

NOTE:

This command is not supported by the S5720HI.

Format

mac-mirroring mac-address to observe-port observe-port-index inbound

undo mac-mirroring mac-address [ to observe-port observe-port-index ] inbound

Parameters

Parameter

Description

Value

mac-address

Specifies the MAC address of mirrored packets.

The value is in H-H-H format, where H is a hexadecimal number of 1 to 4 digits.

observe-port-index

Specifies the index of observing ports.

The value is an integer. The value ranges from 1 to 8 on the S5720EI, S6720EI, or S6720S-EI. The value is 1 on other devices.

inbound

Copies inbound packets on all the active ports in a VLAN to observing ports.

-

Views

VLAN view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

In MAC address mirroring, you can run the mac-mirroring command to copy packets matching a specified source or destination MAC address in a VLAN to observing ports.

Prerequisites

Observing ports have been configured using the observe-port (local observing port) or observe-port (remote observing port) command in the system view.

Precautions

Currently, in MAC address mirroring, only the packets that are received by all the active ports in a VLAN and contain a specified MAC address can be copied to observing ports.

Example

# Copy inbound packets of which the source or destination MAC address is 0000-0000-0001 on the active ports in VLAN 3 to observing ports with index 1.

<HUAWEI> system-view
[HUAWEI] observe-port 1 interface gigabitethernet 0/0/1
[HUAWEI] vlan 3
[HUAWEI-vlan3] mac-mirroring 0000-0000-0001 to observe-port 1 inbound

mirroring to observe-port (VLAN view)

Function

The mirroring to observe-port command copies packets on all the active ports in a VLAN to observing ports.

The undo mirroring command cancels copying packets on all the active ports in a VLAN to observing ports.

By default, packets on all the active ports in a VLAN are not copied to observing ports.

NOTE:

This command is not supported by the S5720HI.

Format

mirroring to observe-port observe-port-index inbound

undo mirroring [ to observe-port observe-port-index ] inbound

Parameters

Parameter

Description

Value

observe-port-index

Specifies the index of observing ports.

The value is an integer. The value ranges from 1 to 8 on the S5720EI, S6720EI, or S6720S-EI. The value is 1 on other devices.

inbound

Copies inbound packets on all the active ports in a VLAN to observing ports.

-

Views

VLAN view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

In VLAN mirroring, you can run the mirroring to observe-port command to copy packets on all the active ports in a specified VLAN to observing ports.

Prerequisites

Observing ports have been configured using the observe-port (local observing port) or observe-port (remote observing port) command in the system view.

Precautions

Currently, in VLAN mirroring, only the packets that are received by all the active ports in a VLAN can be copied to observing ports.

Example

# Copy inbound packets on the active ports in VLAN 10 to observing ports with index 1.

<HUAWEI> system-view
[HUAWEI] observe-port 1 interface gigabitethernet 0/0/1
[HUAWEI] vlan 10
[HUAWEI-vlan10] mirroring to observe-port 1 inbound

mirroring to observe-port (traffic behavior view)

Function

The mirroring to observe-port command copies traffic that matches rules to observing ports.

The undo mirroring command cancels copying traffic that matches rules to observing ports.

By default, the switch does not copy traffic that matches rules to observing ports.

Format

mirroring to observe-port observe-port-index

undo mirroring

Parameters

Parameter

Description

Value

observe-port-index

Specifies the index of an observing port.

The value is an integer. The value ranges from 1 to 8 on the S5720EI, S5720HI, S6720EI, or S6720S-EI. The value is 1 on other devices.

Views

Traffic behavior view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

In traffic mirroring, you can run the mirroring to observe-port command to copy traffic that matches rules to specified observing ports.

Prerequisites

Observing ports have been configured using the observe-port (local observing port) or observe-port (remote observing port) command in the system view.

Example

# Copy traffic that matches rules to observing ports with index 1.

<HUAWEI> system-view
[HUAWEI] observe-port 1 interface gigabitethernet 0/0/1
[HUAWEI] traffic behavior tb1
[HUAWEI-behavior-tb1] mirroring to observe-port 1

observe-port (local observing port)

Function

The observe-port command configures local observing ports.

The undo observe-port command deletes local observing ports.

By default, no local observing ports are configured.

Format

observe-port [ observe-port-index ] interface interface-type interface-number [ untag-packet ] (single configuration)

observe-port [ observe-port-index ] interface-range { interface-type interface-number [ to interface-type interface-number ] } &<1-n> [ untag-packet ] (batch configuration, supported only by the S5720EI, S5720HI, S6720EI, and S6720S-EI; n in &<1-n> is 4 on an S5720EI, S6720EI, or S6720S-EI and 8 on an S5720HI)

observe-port observe-port-index interface-range { add | delete } interface-type interface-number (supported only by the S5720EI, S5720HI, S6720EI, and S6720S-EI)

undo observe-port observe-port-index

Parameters

Parameter Description Value
observe-port-index

Specifies the index of observing ports.

The value is an integer. The value ranges from 1 to 8 on the S5720EI, S5720HI, S6720EI, or S6720S-EI, and ranges from 1 to 6 on other devices.

interface-type interface-number

Specifies the type and number of an interface.

-
add

Adds observing ports to the observing ports configured in a batch.

-
delete

Deletes observing ports from the observing ports configured in a batch.

-
untag-packet

Removes VLAN tags of mirrored packets.

NOTE:

Only the S5720HI supports this parameter. Each mirrored packet can have at most two VLAN tags removed.

-

Views

System view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

When an observing port is directly connected to a monitoring host, you can run the observe-port command to configure a local observing port. Observing ports can be configured one by one or in a batch. The single configuration and batch configuration modes can be used simultaneously. If multiple observing ports are configured in a batch, these observing ports are bound to the same mirrored port. Therefore, batch configuration is often used to simplify the configuration of 1:N mirroring.

Precautions

  • The management interface cannot be configured as an observing port.
  • If you configure observing ports without specifying observe-port-index, the system selects the smallest unused indexes and assigns the indexes to the observing ports in sequence.
  • If you need to update the observing ports configured in a batch, run the observe-port observe-port-index interface-range { add | delete } interface-type interface-number command to add or delete observing ports to or from the configured observing ports.
  • In 1:N mirroring, if you configure packets (in the inbound or outbound direction) on a mirrored port to be copied to multiple observing ports configured in a batch, the packets cannot be copied to other observing ports.
  • On the S5720EI, S5720HI, S6720EI, and S6720S-EI, both Ethernet ports and Eth-Trunks can be configured as observing ports. On other devices, only Ethernet ports can be configured as observing ports.
  • An observing port in blocked state can still forward mirrored packets.
  • The maximum number of observing ports varies depending on device models. For details, see Observing Port Specifications in "Mirroring Configuration" in the S1720, S2700, S5700, and S6720 V200R011C10 Configuration Guide - Network Management and Monitoring.
  • An observing port is dedicated to forwarding mirrored traffic. Do not configure other services on an observing port; otherwise, mirrored traffic and other service traffic interfere with 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.

Example

# Configure GigabitEthernet0/0/1 as a local observing port.

<HUAWEI> system-view
[HUAWEI] observe-port 1 interface gigabitethernet 0/0/1
# Configure GigabitEthernet0/0/1 through GigabitEthernet0/0/3 as local observing ports in a batch.
<HUAWEI> system-view
[HUAWEI] observe-port 1 interface-range gigabitethernet 0/0/1 to gigabitethernet 0/0/3

observe-port (remote observing port)

Function

The observe-port command configures remote observing ports.

The undo observe-port command deletes remote observing ports.

By default, no remote observing ports are configured.

Format

observe-port [ observe-port-index ] interface interface-type interface-number vlan vlan-id (Layer 2 remote observing port configured one by one)

observe-port [ observe-port-index ] interface-range { interface-type interface-number [ to interface-type interface-number ] } &<1-n> vlan vlan-id (Layer 2 remote observing ports configured in a batch, supported only by the S5720EI, S5720HI, S6720EI, and S6720S-EI; n in &<1-n> is 4 on an S5720EI, S6720EI, or S6720S-EI and 8 on an S5720HI)

observe-port observe-port-index interface-range { add | delete } interface-type interface-number (supported only by the S5720EI, S5720HI, S6720EI, and S6720S-EI)

undo observe-port observe-port-index

Parameters

Parameter Description Value
observe-port-index

Specifies the index of observing ports.

The value is an integer. The value ranges from 1 to 8 on the S5720EI, S5720HI, S6720EI, or S6720S-EI, and ranges from 1 to 6 on other devices.

interface-type interface-number

Specifies the type and number of an interface.

-
add

Adds observing ports to the observing ports configured in a batch.

-
delete

Deletes observing ports from the observing ports configured in a batch.

-
vlan vlan-id

Specifies the VLAN ID encapsulated into mirrored packets.

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

Views

System view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

In remote mirroring, a monitoring device and monitored device where an observing port resides are connected through a Layer 2 network. The monitored device adds a specified VLAN tag to mirrored packets, and then the observing port broadcasts the mirrored packets in a specified VLAN so that the mirrored packets can be sent to the monitoring device.

Observing ports can be configured one by one or in a batch. The single configuration and batch configuration modes can be used simultaneously. If multiple observing ports are configured in a batch, these observing ports are bound to the same mirrored port. Therefore, batch configuration is often used to simplify the configuration of 1:N mirroring.

Precautions

  • The management interface cannot be configured as an observing port.
  • If you configure observing ports without specifying observe-port-index, the system selects the smallest unused indexes and assigns the indexes to the observing ports in sequence.
  • If you need to update the observing ports configured in a batch, run the observe-port observe-port-index interface-range { add | delete } interface-type interface-number command to add or delete observing ports to or from the configured observing ports.
  • In 1:N mirroring, if you configure packets (in the inbound or outbound direction) on a mirrored port to be copied to multiple observing ports configured in a batch, the packets cannot be copied to other observing ports.
  • On the S5720EI, S5720HI, S6720EI, and S6720S-EI, both Ethernet ports and Eth-Trunks can be configured as observing ports. On other devices, only Ethernet ports can be configured as observing ports.
  • An observing port in blocked state can still forward mirrored packets.
  • The maximum number of observing ports varies depending on device models. For details, see Observing Port Specifications in "Mirroring Configuration" in the S1720, S2700, S5700, and S6720 V200R011C10 Configuration Guide - Network Management and Monitoring.
  • An observing port is dedicated to forwarding mirrored traffic. Do not configure other services on an observing port; otherwise, mirrored traffic and other service traffic interfere with 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.

Example

# Configure GigabitEthernet0/0/1 as a Layer 2 remote observing port, and bind the port to VLAN 10.

<HUAWEI> system-view
[HUAWEI] observe-port 1 interface gigabitethernet 0/0/1 vlan 10
# Configure GigabitEthernet0/0/1 through GigabitEthernet0/0/3 as Layer 2 remote observing ports in a batch, and bind these ports to VLAN 10.
<HUAWEI> system-view
[HUAWEI] observe-port 2 interface-range gigabitethernet 0/0/1 to gigabitethernet 0/0/3 vlan 10

port-mirroring to observe-port

Function

The port-mirroring to observe-port command copies packets on a mirrored port to observing ports.

The undo port-mirroring command cancels copying packets on a mirrored port to observing ports.

By default, packets on a mirrored port are not copied to observing ports.

Format

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

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

Parameters

Parameter Description Value
observe-port-index

Specifies the index of observing ports.

The value is an integer. The value ranges from 1 to 8 on the S5720EI, S5720HI, S6720EI, or S6720S-EI, and ranges from 1 to 6 on other devices.

both

Copies inbound and outbound packets on a mirrored port to observing ports.

-

inbound

Copies inbound packets on a mirrored port to observing ports.

-

outbound

Copies outbound packets on a mirrored port to observing ports.

-

Views

Ethernet interface view, GE interface view, XGE interface view, MultiGE interface view, 40GE interface view, Eth-Trunk interface view, port group view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

In port mirroring, you can run the port-mirroring to observe-port command to copy packets that pass through a mirrored port to specified observing ports.

Prerequisites

Observing ports have been configured using the observe-port (local observing port) or observe-port (remote observing port) command in the system view.

Precautions

To prevent mirrored packets from being lost, ensure that mirrored and monitoring ports have the same port type and bandwidth.

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.

Example

# Configure port mirroring for inbound packets on GigabitEthernet0/0/1.

<HUAWEI> system-view
[HUAWEI] observe-port 1 interface gigabitethernet 0/0/2
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] port-mirroring to observe-port 1 inbound
Translation
Download
Updated: 2019-10-21

Document ID: EDOC1000178165

Views: 48633

Downloads: 1165

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next