- Table of Contents
-
- 17-Network Management and Monitoring Command Reference
- 00-Preface
- 01-System maintenance and debugging commands
- 02-NQA commands
- 03-NTP commands
- 04-PoE commands
- 05-SNMP commands
- 06-RMON commands
- 07-Event MIB commands
- 08-NETCONF commands
- 09-SmartMC commands
- 10-CWMP commands
- 11-EAA commands
- 12-Process monitoring and maintenance commands
- 13-Sampler commands
- 14-Mirroring commands
- 15-NetStream commands
- 16-IPv6 NetStream commands
- 17-sFlow commands
- 18-Performance management commands
- 19-Flow log commands
- 20-Information center commands
- 21-Packet capture commands
- 22-Cloud connection commands
- Related Documents
-
Title | Size | Download |
---|---|---|
14-Mirroring commands | 73.30 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
Parameters
group-id: Specifies a mirroring group by its ID. The value range for this argument is 1 to 6.
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:
GigabitEthernet1/0/1 Inbound
Monitor port: GigabitEthernet1/0/2
Table 1 Command output
Field |
Description |
Mirroring group |
ID of the 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
Parameters
group-id: Specifies a mirroring group ID.The value range for this argument is 1 to 6.
local: Specifies local mirroring groups.
all: Specifies all mirroring groups.
Examples
# Create local mirroring group 1.
<Sysname> system-view
[Sysname] mirroring-group 1 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
Parameters
group-id: Specifies a mirroring group by its ID. The value range for this argument is 1 to 6.
both: Mirrors both received and sent packets.
inbound: Mirrors only received packets.
outbound: Mirrors only sent packets.
Usage guidelines
A source port cannot be used as a monitor port.
If you configure a software forwarding interface as a source port for a mirroring group, the following rules apply:
· If the software forwarding interface operates in Layer 2 mode, the inbound and outbound IPv4 traffic, IPv6 traffic, and MPLS traffic of the interface will be mirrored.
· If the software forwarding interface operates in Layer 3 mode, the inbound and outbound IPv4 traffic, IPv6 traffic, and MPLS traffic of the interface will be mirrored. Make sure the interface has an IP address.
A software forwarding interface is an Ethernet interface. You can use the port link-mode command to change the link mode of an Ethernet interface. For more information, see Ethernet interface configuration in Interface Configuration Guide.
Examples
# Create local mirroring group 1 to monitor the bidirectional traffic of port GigabitEthernet 1/0/1.
<Sysname> system-view
[Sysname] mirroring-group 1 local
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/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
Parameters
group-id: Specifies a mirroring group by its ID. The value range for this argument is 1 to 6.
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.
If you configure a software forwarding interface as a source port for a mirroring group, the following rules apply:
· If the software forwarding interface operates in Layer 2 mode, the inbound and outbound IPv4 traffic, IPv6 traffic, and MPLS traffic of the interface will be mirrored.
· If the software forwarding interface operates in Layer 3 mode, the inbound and outbound IPv4 traffic, IPv6 traffic, and MPLS traffic of the interface will be mirrored. Make sure the interface has an IP address.
A software forwarding interface is an Ethernet interface. You can use the port link-mode command to change the link mode of an Ethernet interface. For more information, see Ethernet interface configuration in Interface Configuration Guide.
Examples
# Create local mirroring group 1 to monitor the bidirectional traffic of GigabitEthernet 1/0/1.
<Sysname> system-view
[Sysname] mirroring-group 1 local
[Sysname] mirroring-group 1 mirroring-port gigabitethernet 1/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
Parameters
group-id: Specifies a mirroring group by its ID. The value range for this argument is 1 to 6.
Usage guidelines
Use a monitor port only for port mirroring, so the data monitoring device receives and analyzes only the mirrored traffic.
The member port of an existing mirroring group cannot be configured as a monitor port.
Examples
# Create local mirroring group 1 and configure GigabitEthernet 1/0/1 as its monitor port.
<Sysname> system-view
[Sysname] mirroring-group 1 local
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/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
Parameters
group-id: Specifies a mirroring group by its ID. The value range for this argument is 1 to 6.
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.
Examples
# Create local mirroring group 1 and configure GigabitEthernet 1/0/1 as its monitor port.
<Sysname> system-view
[Sysname] mirroring-group 1 local
[Sysname] mirroring-group 1 monitor-port gigabitethernet 1/0/1
Related commands
mirroring-group
Flow mirroring commands
Flow mirroring does not support mirroring traffic to Layer 3 Ethernet interfaces.
The following compatibility matrixes show the support of hardware platforms for flow mirroring:
Hardware |
Flow mirroring compatibility |
MSR810, MSR810-W, MSR810-W-DB, MSR810-LM, MSR810-W-LM, MSR810-10-PoE, MSR810-LM-HK, MSR810-W-LM-HK, MSR810-LM-CNDE-SJK, MSR810-CNDE-SJK |
Yes |
MSR810-LMS, MSR810-LUS |
Yes |
MSR810-LMS-EA, MSR810-LME |
Yes |
MSR2600-6-X1, MSR2600-10-X1 |
Yes |
MSR 2630 |
Yes |
MSR3600-28, MSR3600-51 |
Yes |
MSR3600-28-SI, MSR3600-51-SI |
Yes |
MSR3600-28-X1, MSR3600-28-X1-DP, MSR3600-51-X1, MSR3600-51-X1-DP |
Yes |
MSR3610-I-DP, MSR3610-IE-DP, MSR3610-IE-ES, MSR3610-IE-EAD, MSR3610-I-IG, MSR3610-IE-IG |
Yes |
MSR3610-X1, MSR3610-X1-DP, MSR3610-X1-DC, MSR3610-X1-DP-DC |
Yes |
MSR 3610, MSR 3620, MSR 3620-DP, MSR 3640, MSR 3660 |
Yes |
MSR3610-G, MSR3620-G |
No |
Hardware |
Flow mirroring compatibility |
MSR810-W-WiNet, MSR810-LM-WiNet |
Yes |
MSR830-4LM-WiNet |
Yes |
MSR830-5BEI-WiNet, MSR830-6EI-WiNet, MSR830-10BEI-WiNet |
Yes |
MSR830-6BHI-WiNet, MSR830-10BHI-WiNet |
Yes |
MSR2600-6-WiNet , MSR2600-10-X1-WiNet |
Yes |
MSR2630-WiNet |
Yes |
MSR3600-28-WiNet |
Yes |
MSR3610-X1-WiNet |
Yes |
MSR3610-WiNet, MSR3620-10-WiNet, MSR3620-DP-WiNet, MSR3620-WiNet, MSR3660-WiNet |
Yes |
Hardware |
Flow mirroring compatibility |
MSR2630-XS |
Yes |
MSR3600-28-XS |
Yes |
MSR3610-XS |
Yes |
MSR3620-XS |
Yes |
MSR3610-I-XS |
Yes |
MSR3610-IE-XS |
Yes |
Hardware |
Flow mirroring compatibility |
MSR810-LM-GL |
Yes |
MSR810-W-LM-GL |
Yes |
MSR830-6EI-GL |
Yes |
MSR830-10EI-GL |
Yes |
MSR830-6HI-GL |
Yes |
MSR830-10HI-GL |
Yes |
MSR2600-6-X1-GL |
Yes |
MSR3600-28-SI-GL |
Yes |
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
Parameters
interface-type interface-number: Specifies an interface by its type and number.
Usage guidelines
You can mirror traffic to only one interface. If you execute this command for a traffic behavior multiple times, the most recent configuration takes effect.
Examples
# Create traffic behavior 1 and configure the action of mirroring traffic to GigabitEthernet 1/0/1 for the traffic behavior.
<Sysname> system-view
[Sysname] traffic behavior 1
[Sysname-behavior-1] mirror-to interface gigabitethernet 1/0/1