- Table of Contents
-
- 14-Network Management and Monitoring Command Reference
- 00-Preface
- 01-System maintenance and debugging commands
- 02-NQA commands
- 03-NTP commands
- 04-SNMP commands
- 05-RMON commands
- 06-Event MIB commands
- 07-NETCONF commands
- 08-CWMP commands
- 09-EAA commands
- 10-Process monitoring and maintenance commands
- 11-Sampler commands
- 12-Mirroring commands
- 13-NetStream commands
- 14-IPv6 NetStream commands
- 15-Fast log output commands
- 16-Information center commands
- Related Documents
-
Title | Size | Download |
---|---|---|
12-Mirroring commands | 68.33 KB |
mirroring-group mirroring-port (interface view)
mirroring-group mirroring-port (system view)
mirroring-group monitor-port (interface view)
mirroring-group monitor-port (system view)
Port mirroring commands
display mirroring-group
Use display mirroring-group to display mirroring group information.
Syntax
display mirroring-group { group-id | all | local }
Views
Any view
Predefined user roles
network-admin
network-operator
mdc-admin
mdc-operator
Parameters
group-id: Specifies a mirroring group by its ID.
· 1 to 4: Specifies a local common mirroring group.
· 257 to 384: Specifies a local FPGA mirroring group.
all: Specifies all mirroring groups.
local: Specifies local mirroring groups.
Usage guidelines
Mirroring group information includes the type, status, and content of a mirroring group. It is sorted by mirroring group number.
Examples
# Display information about all mirroring groups.
<Sysname> display mirroring-group all
Mirroring group 1:
Type: Local
Status: Active
Mirroring port:
GigabitEthernet2/0/1 Inbound
Monitor port: GigabitEthernet2/0/2
Table 1 Command output
Field |
Description |
Mirroring group |
ID of the mirroring group. · 1 to 4: Specifies a local common mirroring group. · 257 to 384: Specifies a local FPGA mirroring group. |
Type |
Type of the mirroring group: Local. |
Status |
Status of the mirroring group: · Active—The mirroring group has taken effect. · Incomplete—The mirroring group configuration is not complete and does not take effect. |
Mirroring port |
Source port. |
Monitor port |
Destination port. |
mirroring-group
Use mirroring-group to create a mirroring group.
Use undo mirroring-group to delete mirroring groups.
Syntax
mirroring-group group-id local
undo mirroring-group { group-id | all | local }
Default
No mirroring groups exist.
Views
System view
Predefined user roles
network-admin
mdc-admin
Parameters
group-id: Specifies a mirroring group ID.
· 1 to 4: Specifies a local common mirroring group.
· 257 to 384: Specifies a local FPGA mirroring group. Only FIP260 and FIP380 cards support local FPGA mirroring groups.
local: Specifies local mirroring groups.
all: Specifies all mirroring groups.
Usage guidelines
In local port mirroring, the source device is directly connected to a data monitoring device. The source device also acts as the destination device and forwards mirrored packets directly to the data monitoring device.
Local port mirroring groups include the following types:
· Local common mirroring—Uses software algorithms to mirror packets.
· Local FPGA mirroring—Use the FPGA hardware module to mirror packets at a high speed. Through configuring two local FPGA mirroring groups, you can mirror the incoming packets and outgoing packets of a source port to different monitor ports separately.
Examples
# Create local mirroring group 1.
<Sysname> system-view
[Sysname] mirroring-group 1 local
# Create local FPGA mirroring group 257.
<Sysname> system-view
[Sysname] mirroring-group 257 local
mirroring-group mirroring-port (interface view)
Use mirroring-group mirroring-port to configure a port as a source port for a mirroring group.
Use undo mirroring-group mirroring-port to restore the default.
Syntax
mirroring-group group-id mirroring-port { both | inbound | outbound }
undo mirroring-group group-id mirroring-port
Default
A port does not act as a source port for any mirroring groups.
Views
Interface view
Predefined user roles
network-admin
mdc-admin
Parameters
group-id: Specifies a mirroring group by its ID.
· 1 to 4: Specifies a local common mirroring group.
· 257 to 384: Specifies a local FPGA mirroring group. Only FIP260 and FIP380 cards support local FPGA mirroring groups.
both: Mirrors both received and sent packets.
inbound: Mirrors only received packets.
outbound: Mirrors only sent packets.
Usage guidelines
A port can act as a source port for only one mirroring group. A source port cannot be used as a monitor port.
For a local FPGA mirroring group, make sure the source ports and monitor ports are on the same interface card.
Examples
# Create local mirroring group 1 to monitor the bidirectional traffic of port GigabitEthernet 2/0/1.
<Sysname> system-view
[Sysname] mirroring-group 1 local
[Sysname] interface gigabitethernet 2/0/1
[Sysname-GigabitEthernet2/0/1] mirroring-group 1 mirroring-port both
Related commands
mirroring-group
mirroring-group mirroring-port (system view)
Use mirroring-group mirroring-port to configure source ports for a mirroring group.
Use undo mirroring-group mirroring-port to remove source ports from a mirroring group.
Syntax
mirroring-group group-id mirroring-port interface-list { both | inbound | outbound }
undo mirroring-group group-id mirroring-port interface-list
Default
No source port is configured for a mirroring group.
Views
System view
Predefined user roles
network-admin
mdc-admin
Parameters
group-id: Specifies a mirroring group by its ID.
· 1 to 4: Specifies a local common mirroring group.
· 257 to 384: Specifies a local FPGA mirroring group. Only FIP260 and FIP380 cards support local FPGA mirroring groups.
interface-list: Specifies a space-separated list of up to eight interface items. Each item specifies an interface by its type and number or specifies a range of interfaces in the form of interface-type interface-number1 to interface-type interface-number2. When you specify a range of interfaces, the interfaces must be of the same type and on the same slot. The start interface number must be identical to or lower than the end interface number.
both: Mirrors both received and sent packets.
inbound: Mirrors only received packets.
outbound: Mirrors only sent packets.
Usage guidelines
A port can act as a source port for only one mirroring group. A source port cannot be used as a monitor port.
For a local FPGA mirroring group, make sure the source ports and monitor ports are on the same interface card.
Examples
# Create local mirroring group 1 to monitor the bidirectional traffic of GigabitEthernet 2/0/1.
<Sysname> system-view
[Sysname] mirroring-group 1 local
[Sysname] mirroring-group 1 mirroring-port gigabitethernet 2/0/1 both
mirroring-group
mirroring-group monitor-port (interface view)
Use mirroring-group monitor-port to configure a port as the monitor port for a mirroring group.
Use undo mirroring-group monitor-port to restore the default.
Syntax
mirroring-group group-id monitor-port
undo mirroring-group group-id monitor-port
Default
A port does not act as the monitor port for any mirroring groups.
Views
Interface view
Predefined user roles
network-admin
mdc-admin
Parameters
group-id: Specifies a mirroring group by its ID.
· 1 to 4: Specifies a local common mirroring group.
· 257 to 384: Specifies a local FPGA mirroring group. Only FIP260 and FIP380 cards support local FPGA mirroring groups.
Usage guidelines
Use a monitor port only for port mirroring, so the data monitoring device receives and analyzes only the mirrored traffic.
A mirroring group can contain only one monitor port.
The member port of an existing mirroring group cannot be configured as a monitor port.
The member port of an aggregate interface cannot be configured as a monitor port.
For a local FPGA mirroring group, make sure the source ports and monitor ports are on the same interface card.
Examples
# Create local mirroring group 1 and configure GigabitEthernet 2/0/1 as its monitor port.
<Sysname> system-view
[Sysname] mirroring-group 1 local
[Sysname] interface gigabitethernet 2/0/1
[Sysname-GigabitEthernet2/0/1] mirroring-group 1 monitor-port
Related commands
mirroring-group
mirroring-group monitor-port (system view)
Use mirroring-group monitor-port to configure the monitor ports for a mirroring group.
Use undo mirroring-group monitor-port to remove the monitor ports from a mirroring group.
Syntax
mirroring-group group-id monitor-port interface-type interface-number
undo mirroring-group group-id monitor-port interface-type interface-number
Default
No monitor port is configured for a mirroring group.
Views
System view
Predefined user roles
network-admin
mdc-admin
Parameters
group-id: Specifies a mirroring group by its ID.
· 1 to 4: Specifies a local common mirroring group.
· 257 to 384: Specifies a local FPGA mirroring group. Only FIP260 and FIP380 cards support local FPGA mirroring groups.
interface-type interface-number: Specifies an interface by its type and number.
Usage guidelines
Do not enable the spanning tree feature on the monitor port of a mirroring group.
Use a monitor port only for port mirroring, so the data monitoring device receives only the mirrored traffic.
The member port of an existing mirroring group cannot be configured as a monitor port.
For a local FPGA mirroring group, make sure the source ports and monitor ports are on the same interface card.
Examples
# Create local mirroring group 1 and configure GigabitEthernet 2/0/1 as its monitor port.
<Sysname> system-view
[Sysname] mirroring-group 1 local
[Sysname] mirroring-group 1 monitor-port gigabitethernet 2/0/1
Related commands
mirroring-group
Flow mirroring commands
mirror-to interface
Use mirror-to interface to configure a mirroring action that mirrors traffic to an interface.
Use undo mirror-to interface to delete a mirroring action that mirrors traffic to an interface.
Syntax
mirror-to interface interface-type interface-number
undo mirror-to interface interface-type interface-number
Default
No mirroring actions exist to mirror traffic to interfaces.
Views
Traffic behavior view
Predefined user roles
network-admin
mdc-admin
Parameters
interface-type interface-number: Specifies an interface by its type and number.
Usage guidelines
You can execute this command multiple times for a traffic behavior to mirror traffic to different interfaces.
Examples
# Create traffic behavior 1 and configure the action of mirroring traffic to GigabitEthernet 2/0/1 for the traffic behavior.
<Sysname> system-view
[Sysname] traffic behavior 1
[Sysname-behavior-1] mirror-to interface gigabitethernet 2/0/1