- Table of Contents
-
- 11-Network Management and Monitoring Command Reference
- 00-Preface
- 01-System maintenance and debugging commands
- 02-NQA commands
- 03-NTP commands
- 04-PTP commands
- 05-Network synchronization commands
- 06-SNMP commands
- 07-NETCONF commands
- 08-Process monitoring and maintenance commands
- 09-Mirroring commands
- 10-Performance management commands
- 11-Information center commands
- 12-Packet capture commands
- Related Documents
-
Title | Size | Download |
---|---|---|
09-Mirroring commands | 60.29 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 number. 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: Ten-GigabitEthernet2/0/0 Inbound
Monitor port: Ten-GigabitEthernet2/0/1
Table 1 Command output
Field |
Description |
Mirroring group |
Number of the mirroring group. |
Type |
Type of the mirroring group. Only local mirroring groups are supported. |
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, which might be followed by the following keywords: · Both—Mirrors both the received and the sent packets of the interface. · Inbound—Mirrors the received packets of the interface. · Outbound—Mirrors the sent packets of the interface. |
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 by its number in the range of 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 number. The specified mirroring group must already exist. 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 port can act as a source port for only one mirroring group.
A source port cannot be used as a monitor port.
Examples
# Create local mirroring group 1 to monitor the bidirectional traffic of Ten-GigabitEthernet 2/0/0.
<Sysname> system-view
[Sysname] mirroring-group 1 local
[Sysname] interface ten-gigabitethernet 2/0/0
[Sysname-Ten-GigabitEthernet2/0/0] 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 number. The specified mirroring group must already exist. The value range for this argument is 1 to 6.
interface-list: Specifies a space-separated list of up to eight port items. Each item specifies a single port or a port range in the form of interface-type interface-number1 to interface-type interface-number2. The specified interfaces must be of the same type and on the same slot. The value for the interface-number2 argument must be equal to or greater than the value for the interface-number1 argument.
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.
Examples
# Create local mirroring group 1 to monitor the bidirectional traffic of Ten-GigabitEthernet 2/0/0.
<Sysname> system-view
[Sysname] mirroring-group 1 local
[Sysname] mirroring-group 1 mirroring-port ten-gigabitethernet 2/0/0 both
mirroring-group
mirroring-group monitor-port (interface view)
Use mirroring-group monitor-port to configure a port as a 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 a monitor port for any mirroring groups.
Views
Interface view
Predefined user roles
network-admin
Parameters
group-id: Specifies a mirroring group by its number. The specified mirroring group must already exist. 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.
The source port of an existing mirroring group cannot be configured as a monitor port.
Examples
# Create local mirroring group 1 and configure Ten-GigabitEthernet 2/0/0 as its monitor port.
<Sysname> system-view
[Sysname] mirroring-group 1 local
[Sysname] interface ten-gigabitethernet 2/0/0
[Sysname-Ten-GigabitEthernet2/0/0] 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-list
undo mirroring-group group-id monitor-port interface-list
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 number. The specified mirroring group must already exist. The value range for this argument is 1 to 6.
interface-list: Specifies a space-separated list of up to eight port items. Each item specifies a single port or a port range in the form of interface-type interface-number1 to interface-type interface-number2. The value for the interface-number2 argument must be equal to or greater than the value for the interface-number1 argument.
Usage guidelines
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.
The source port of an existing mirroring group cannot be configured as a monitor port.
Examples
# Create local mirroring group 1 and configure Ten-GigabitEthernet 2/0/0 as its monitor port.
<Sysname> system-view
[Sysname] mirroring-group 1 local
[Sysname] mirroring-group 1 monitor-port ten-gigabitethernet 2/0/0
# Create local mirroring group 3 and configure ports Ten-GigabitEthernet 2/0/0 through Ten-GigabitEthernet 2/0/2 and Ten-GigabitEthernet 2/0/4 as its monitor ports.
<Sysname> system-view
[Sysname] mirroring-group 3 local
[Sysname] mirroring-group 3 monitor-port ten-gigabitethernet 2/0/0 to ten-gigabitethernet 2/0/2 ten-gigabitethernet 2/0/4
Related commands
mirroring-group