- Table of Contents
-
- 12-Network Management and Monitoring Command Reference
- 00-Preface
- 01-System Maintenance and Debugging Commands
- 02-NQA Commands
- 03-NTP Commands
- 04-Clock Monitoring Commands
- 05-IPC Commands
- 06-SNMP Commands
- 07-RMON Commands
- 08-Sampler Commands
- 09-Mirroring Commands
- 10-NetStream Commands
- 11-IPv6 NetStream Commands
- 12-Protocol Packet Statistics Commands
- 13-Information Center Commands
- 14-Flow Logging Commands
- Related Documents
-
Title | Size | Download |
---|---|---|
09-Mirroring Commands | 124.75 KB |
Contents
Mirroring configuration commands
mirroring-group mirroring-port
mirroring-group reflector-port
mirroring-group remote-probe vlan
|
NOTE: The router supports remote mirroring only when the system working mode is SPC or SPE. |
display mirroring-group
Syntax
display mirroring-group { group-id | all | local | remote-destination | remote-source } [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
2: System level
Parameters
group-id: Mirroring group number, in the range of 1 to 64.
all: Displays all mirroring groups.
local: Displays local mirroring groups.
remote-destination: Displays remote destination mirroring groups.
remote-source: Displays remote source mirroring groups.
|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Description
Use the display mirroring-group command to display the information about a mirroring group or multiple mirroring groups, such as the types, status, and content of a mirroring group.
The output of this command varies with mirroring group types.
The output of this command is sorted by mirroring group number.
Examples
# Display the information about all the mirroring groups.
<Sysname> display mirroring-group all
mirroring-group 1:
type: local
status: active
mirroring port:
GigabitEthernet2/1/2 both
GigabitEthernet2/1/4 both
monitor port: GigabitEthernet2/1/5
mirroring-group 23:
type: local
status: inactive
mirroring port:
monitor port: GigabitEthernet2/1/3
Table 1 Output description
Field |
Description |
mirroring-group |
Mirroring group number. |
type |
Mirroring group type, which can be local, remote-source, and remote-destination. |
status |
Status of the mirroring group, which can be active or inactive. |
mirroring port |
Source port. |
monitor port |
Destination port. |
mirroring-group
Syntax
mirroring-group group-id { local | remote-destination | remote-source }
undo mirroring-group { group-id | all | local | remote-destination | remote-source }
View
System view
Default level
2: System level
Parameters
group-id: Mirroring group number, in the range of 1 to 64.
all: Removes all mirroring groups.
local: Creates/Removes a local mirroring group.
remote-destination: Creates/Removes a remote destination mirroring group.
remote-source: Creates/Removes a remote source mirroring group.
Description
Use the mirroring-group command to create a mirroring group.
Use the undo mirroring-group command to remove a mirroring group.
By default, no mirroring groups exist.
Examples
# Create local mirroring group 1.
<Sysname> system-view
[Sysname] mirroring-group 1 local
mirroring-group mirroring-port
Syntax
mirroring-group group-id mirroring-port mirroring-port-list { both | inbound | outbound }
undo mirroring-group group-id mirroring-port mirroring-port-list { both | inbound | outbound }
View
System view
Default level
2: System level
Parameters
group-id: Number of a local or remote source group, in the range of 1 to 64. The mirroring group specified by the group-id argument must already exist. .
mirroring-port-list: List of ports to be added to the mirroring group. You can specify multiple ports by providing this argument in the form of { interface-type interface-number [ to interface-type interface-number ] }&<1-8>, where the interface-type argument is port type, the interface-number argument is the port number, and &<1-8> means that you can provide up to eight port indexes/port index lists for this argument.
both: Mirrors inbound and outbound packets on the specified port(s).
inbound: Mirrors incoming packets only.
outbound: Mirrors outgoing packets only.
Description
Use the mirroring-group mirroring-port command to configure source ports for a mirroring group.
Use the undo mirroring-group mirroring-port command to remove source ports from a mirroring group.
By default, a mirroring group has no source port.
You can configure source ports for local and remote source mirroring groups only, but not for remote destination mirroring groups.
The source ports of local mirroring groups can be Layer 2 Ethernet ports, Layer 3 Ethernet interfaces, ATM interfaces or subinterfaces, POS interfaces, serial interfaces, MP interfaces, FR interfaces or subinterfaces, and MFR interfaces or subinterfaces.
Layer 2 and Layer 3 Ethernet interfaces can be source ports of remote source mirroring groups.
When removing source ports from a mirroring group, make sure the keyword specified in the undo mirroring-group mirroring-port command (that is, the inbound keyword, the outbound keyword, or the both keyword) matches the actual direction of the source ports.
The mirroring group specified by group-id must already exist.
Related commands: mirroring-group.
Examples
# Create local mirroring group 1, assign ports GigabitEthernet 4/1/1 through GigabitEthernet 4/1/23 to it as source ports, and specify the mirroring group to mirror both incoming and outgoing packets on the source ports.
<Sysname> system-view
[Sysname] mirroring-group 1 local
[Sysname] mirroring-group 1 mirroring-port GigabitEthernet 4/1/1 to GigabitEthernet 4/1/23 both
# Remove source ports GigabitEthernet 4/1/1 through GigabitEthernet 4/1/23 from mirroring group 1.
[Sysname] undo mirroring-group 1 mirroring-port GigabitEthernet 4/1/1 to GigabitEthernet 4/1/10 both
mirroring-group reflector-port
Syntax
In system view:
mirroring-group group-id reflector-port reflector-port
undo mirroring-group group-id reflector-port reflector-port
In interface view:
mirroring-group group-id reflector-port
undo mirroring-group group-id reflector-port
View
System view, port view
Default level
2: System level
Parameters
group-id: Number of a remote source group. The mirroring group specified by group-id must already exist. Its value range is 1 to 64.
reflector-port: Port to be configured as the reflector port in the specified mirroring group. The argument takes the form of interface-type interface-number, where interface-type specifies the port type and interface-number specifies the port number.
Description
Use the mirroring-group reflector-port command to configure the reflector port in a remote source group.
Use the undo mirroring-group reflector-port command to remove the reflector port of the remote source group.
By default, no reflector port is configured for a mirroring group, and a port does not serve as the reflector port of any mirroring group.
You can configure a reflector port for a remote source group only, not for other types of mirroring groups.
You can configure a reflector port only when the router works in SPC mode.
Related commands: mirroring-group.
Examples
# Create remote source group 1, and configure port GigabitEthernet 3/0/1 as its reflector port in system view.
<Sysname> system-view
[Sysname] mirroring-group 1 remote-source
[Sysname] mirroring-group 1 reflector-port gigabitEthernet 3/0/1
# Create remote source group 2, and configure port GigabitEthernet 3/0/2 as its reflector port in port view.
<Sysname> system-view
[Sysname] mirroring-group 2 remote-source
[Sysname] interface GigabitEthernet 3/0/2
[Sysname- GigabitEthernet 3/0/2] mirroring-group 2 reflector-port
mirroring-group monitor-port
Syntax
mirroring-group group-id monitor-port monitor-port-id
undo mirroring-group group-id monitor-port monitor-port-id
View
System view
Default level
2: System level
Parameters
group-id: Number of a local or remote destination group, in the range of 1 to 64. The mirroring group specified by group-id must already exist.
monitor-port-id: Monitor port index, in the form of interface-type interface-number, where interface-type is the port type and interface-number is the port number.
Description
Use the mirroring-group monitor-port command to configure the monitor port for a mirroring group.
Use the undo mirroring-group monitor-port command to remove the monitor port from a mirroring group.
By default, no monitor port has been configured for a mirroring group.
You can configure a monitor port for a local or remote destination mirroring group, but not for a remote source mirroring group.
A mirroring group can have only one monitor port.
The mirroring group specified by group-id must already exist.
The monitor port of a local or remote destination mirroring group can be a Layer 2 or Layer 3 Ethernet interface.
A member port of an existing mirroring group cannot be a monitor port.
Related commands: mirroring-group.
Examples
# Create local mirroring group 1, and configure port GigabitEthernet 4/1/1 as its monitor port.
<Sysname> system-view
[Sysname] mirroring-group 1 local
[Sysname] mirroring-group 1 monitor-port gigabitethernet 4/1/1
# Create remote destination mirroring group 1, and configure GigabitEthernet 4/1/2 as its monitor port.
<Sysname> system-view
[Sysname] mirroring-group 1 remote-destination
[Sysname] mirroring-group 1 monitor-port GigabitEthernet 4/1/2
mirroring-group remote-probe vlan
Syntax
mirroring-group group-id remote-probe vlan rprobe-vlan-id
undo mirroring-group group-id remote-probe vlan rprobe-vlan-id
View
System view
Default level
2: System level
Parameters
group-id: Number of a remote source or destination mirroring group, in the range of 1 to 64. The mirroring group specified by group-id must already exist.
rprobe-vlan-id: Remote probe VLAN ID. The VLAN must be an existing static VLAN.
Description
Use the mirroring-group remote-probe vlan command to configure the remote probe VLAN for a remote source or destination mirroring group.
Use the undo mirroring-group remote-probe vlan command to remove the remote probe VLAN from a remote source or destination mirroring group.
|
NOTE: · You can configure a remote probe VLAN for a remote source or destination mirroring group, but not for a local mirroring group. · Only a static VLAN that already exists can be configured as a remote probe VLAN. A VLAN can serve as the remote probe VLAN of only one mirroring group. · To delete a VLAN that is configured as a remote probe VLAN, remove the remote probe VLAN configuration first. · The monitor port of a remote destination mirroring group must belong to the remote probe VLAN configured for the mirroring group. |
Related commands: mirroring-group.
Examples
# Create remote source mirroring group 1, and configure VLAN 10 as its remote probe VLAN.
<Sysname> system-view
[Sysname] mirroring-group 1 remote-source
[Sysname] mirroring-group 1 remote-probe vlan 10
# Create remote destination group 2, and configure VLAN 20 as its remote probe VLAN.
<Sysname> system-view
[Sysname] mirroring-group 2 remote-destination
[Sysname] mirroring-group 2 remote-probe vlan 20
mirroring-port
Syntax
[ mirroring-group group-id ] mirroring-port { inbound | outbound | both }
undo [ mirroring-group group-id ] mirroring-port { inbound | outbound | both }
View
Interface view
Default level
2: System level
Parameters
mirroring-group group-id: Specifies a local or remote source mirroring group by its number. The value range for the group-id argument is 1 to 64. The mirroring group specified by group-id must already exist.
both: Mirrors both inbound and outbound packets on the current port.
inbound: Mirrors only incoming packets on the current port.
outbound: Mirrors only outgoing packets on the current port.
Description
Use the mirroring-port command to assign the current port to a local or remote source mirroring group as a source port.
Use the undo mirroring-port command to remove the current port from the mirroring group.
By default, a port does not serve as a source port for any mirroring group.
You cannot configure source ports for a remote destination mirroring group.
If you do not specify the mirroring group number, this command applies to mirroring group 1.
You can assign ports to local mirroring groups as source ports in Layer 2 Ethernet port view, Layer 3 Ethernet interface view, ATM interface or subinterface view, POS interface view, serial interface view, MP-group interface view, frame relay (FR) or subinterface interface view, or MFR interface or subinterface interface view.
You can assign ports/interfaces to remote mirroring groups as source ports in Layer 2 or Layer 3 Ethernet interface view.
When removing a source port from a mirroring group, make sure the keyword specified in the undo mirroring-port command (that is, the inbound keyword, the outbound keyword, or the both keyword) matches the actual direction of the source port.
The mirroring group specified by group-id must already exist.
Examples
# Create local mirroring group 1, configure GigabitEthernet 4/1/1 as a source port of the mirroring group, and specify that the mirroring group monitor the bidirectional traffic of the port.
<Sysname> system-view
[Sysname] mirroring-group 1 local
[Sysname] interface GigabitEthernet4/1/1
[Sysname-GigabitEthernet4/1/1] mirroring-group 1 mirroring-port both
# Create remote source mirroring group 2, assign GigabitEthernet 4/1/2 as a source port of the mirroring group, and specify that the mirroring group monitor the bidirectional traffic of the port.
<Sysname> system-view
[Sysname] mirroring-group 2 remote-source
[Sysname] interface GigabitEthernet 4/1/2
[Sysname-GigabitEthernet4/1/2] mirroring-group 2 mirroring-port both
mirror-to cpu
Syntax
mirror-to cpu
undo mirror-to cpu
View
Traffic behavior view
Default level
2: System level
Parameters
cpu: Mirrors traffic to the CPU.
Description
Use the mirror-to cpu command to configure the action of mirroring traffic to the CPU for a traffic behavior.
Use the undo mirror-to cpu command to remove the action of mirroring traffic to the CPU from a traffic behavior.
By default, the action of mirroring traffic to the CPU is not configured for a traffic behavior.
You can configure only one type of traffic mirroring actions for a traffic behavior. Three traffic mirroring types are available: mirroring traffic to an interface, mirroring traffic to the CPU, and mirroring traffic to a VLAN.
Examples
# Create traffic behavior 1, and configure the action of mirroring traffic to the CPU for the traffic behavior.
<Sysname> system-view
[Sysname] traffic behavior 1
[Sysname-behavior-1] mirror-to cpu
mirror-to interface
Syntax
mirror-to interface interface-type interface-number
undo mirror-to interface interface-type interface-number
View
Traffic behavior view
Default level
2: System level
Parameters
interface interface-type interface-number: Mirrors traffic to an interface specified by its type and number.
Description
Use the mirror-to interface command to configure the action of mirroring traffic to an interface for a traffic behavior.
Use the undo mirror-to interface command to remove the action of mirroring traffic to an interface from a traffic behavior.
By default, the action of mirroring traffic to an interface is not configured for a traffic behavior.
You can configure only one type of traffic mirroring actions for a traffic behavior. Three traffic mirroring types are available: mirroring traffic to an interface, mirroring traffic to the CPU, and mirroring traffic to a VLAN.
Examples
# Create traffic behavior 1, and configure the action of mirroring traffic to port GigabitEthernet 2/1/1 for the traffic behavior.
<Sysname> system-view
[Sysname] traffic behavior 1
[Sysname-behavior-1] mirror-to interface GigabitEthernet 2/1/1
mirror-to vlan
Syntax
mirror-to vlan vlan-id
undo mirror-to vlan vlan-id
View
Traffic behavior view
Default level
2: System level
Parameters
vlan vlan-id: Mirrors traffic to a VLAN specified by its VLAN ID, which ranges from 1 to 4094.
Description
Use the mirror-to vlan command to configure the action of mirroring traffic to a VLAN for a traffic behavior.
Use the undo mirror-to vlan command to remove the action of mirroring traffic to a VLAN from a traffic behavior.
By default, the action of mirroring traffic to a VLAN is not configured for a traffic behavior.
You can configure only one type of traffic mirroring actions for a traffic behavior. Three traffic mirroring types are available: mirroring traffic to an interface, mirroring traffic to the CPU, and mirroring traffic to a VLAN.
If you configure the action of mirroring traffic to a VLAN multiple times for a traffic behavior, the new configuration overwrites the previous one.
You can configure the action of mirroring traffic to a non-existent VLAN. After the VLAN is created and ports are assigned to it, traffic mirroring will take effect automatically on the ports in the VLAN.
Examples
# Create traffic behavior 1, and configure the action of mirroring traffic to VLAN 2 for the traffic behavior.
<Sysname> system-view
[Sysname] traffic behavior 1
[Sysname-behavior-1] mirror-to vlan 2
monitor-port
Syntax
[ mirroring-group group-id ] monitor-port
undo [ mirroring-group group-id ] monitor-port
View
Interface view
Default level
2: System level
Parameters
mirroring-group group-id: Specifies a local or remote destination mirroring group by its number. The value range for the group-id argument is 1 to 64.
Description
Use the monitor-port command to assign the current port to a local or remote destination mirroring group as the monitor port.
Use the undo monitor-port command to remove the current port from the mirroring group.
You cannot configure a monitor port for a remote source mirroring group.
If you do not specify the mirroring group ID, this command applies to mirroring group 1.
You cannot configure a member port of an existing mirroring group as a monitor port.
The mirroring group specified by group-id must already exist.
Related commands: mirroring-group.
Examples
# Create local mirroring group 1, and configure port GigabitEthernet 4/1/1 as its monitor port.
<Sysname> system-view
[Sysname] mirroring-group 1 local
[Sysname] interface GigabitEthernet 4/1/1
[Sysname-GigabitEthernet4/1/1] monitor-port