- Table of Contents
-
- 01-Access Volume
- 01-CPOS Interface Commands
- 02-POS Interface Commands
- 03-Ethernet Interface Commands
- 04-WAN Interface Commands
- 05-Frame Relay Commands
- 06-HDLC Commands
- 07-PPP Commands
- 08-Logical Interface Commands
- 09-Modem Management Commands
- 10-ATM Interface Commands
- 11-ATM Commands
- 12-E-CPOS Interface Commands
- 13-VLAN Termination Commands
- 14-Port Mirroring Commands
- Related Documents
-
Title | Size | Download |
---|---|---|
14-Port Mirroring Commands | 75.35 KB |
Table of Contents
1 Port Mirroring Configuration Commands
Port Mirroring Configuration Commands
Commands in this chapter are supported on the SR6602 only.
Port Mirroring Configuration Commands
display mirroring-group
Syntax
display mirroring-group { group-id | local }
View
Any view
Default Level
2: System level
Parameters
group-id: Number of the port mirroring group to be displayed, in the range 1 through 4.
all: Displays all port mirroring groups.
local: Displays local mirroring groups.
Description
Use the display mirroring-group command to display information about the specified port mirroring group or groups.
The output is sorted by mirroring group number.
Examples
# Display information about port mirroring group 1.
<Sysname> display mirroring-group 1
mirroring-group 1:
type: local
status: active
mirroring port:
GigabitEthernet3/0/1 inbound
GigabitEthernet3/0/2 both
monitor port : GigabitEthernet3/0/3
Table 1-1 display mirroring-group command output description
Field |
Description |
mirroring-group |
Number of the port mirroring group |
type |
Type of the port mirroring group, which can only be local. |
status |
Status of the port mirroring group, which can be active or inactive. |
mirroring-group
Syntax
mirroring-group group-id local
undo mirroring-group { group-id | local }
View
System view
Default Level
2: System level
Parameters
group-id: Specifies the number of the port mirroring group to be created or removed. Its value range is 1 through 4.
local: Creates a local mirroring group or removes all local mirroring groups with the undo command.
Description
Use the mirroring-group command to create a port mirroring group.
Use the undo mirroring-group command to remove the specified port mirroring group or groups.
By default, no port mirroring groups exist.
Examples
# Create a local mirroring group numbered 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 port mirroring group, in the range 1 through 4.
mirroring-port-list: A list of ports/port ranges to be assigned to or removed from the port mirroring group specified by group-id. The total number of single ports plus port ranges cannot exceed eight. In the list, a single port takes the form of interface-type interface-number. A port range takes the form interface-type start-interface-number to interface-type end-interface-number, where the end port number must be greater than the start port number.
both: Mirrors both inbound and outbound packets on the specified port(s).
inbound: Mirrors only inbound packets on the specified port(s).
outbound: Mirrors only outbound packets on the specified port(s).
Description
Use the mirroring-group mirroring-port command to assign ports to a mirroring group as mirroring ports.
Use the undo mirroring-group mirroring-port command to remove mirroring ports from the mirroring group.
Note that:
l When removing a mirroring port from a mirroring group, make sure the traffic direction you specified in the undo mirroring-group mirroring-port command matches the actual monitored direction of the port.
l You cannot assign mirroring ports to a non-existent port mirroring group.
Related commands: mirroring-group.
Examples
# Create local mirroring group 1, configure GigabitEthernet 3/0/1 as its mirroring port, and configure to mirror both inbound and outbound packets on GigabitEthernet 3/0/1.
<Sysname> system-view
[Sysname] mirroring-group 1 local
[Sysname] mirroring-group 1 mirroring-port gigabitethernet 3/0/1 both
# Remove GigabitEthernet 3/0/1 from local mirroring group 1.
<Sysname> system-view
[Sysname] undo mirroring-group 1 mirroring-port gigabitethernet 3/0/1 both
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 mirroring group, in the range 1 through 4.
monitor-port-id: Port to be assigned to the specified mirroring group as the monitor port. 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 monitor-port command to assign a port to a mirroring group as the monitor port.
Use the undo mirroring-group monitor-port command to remove the monitor port from the mirroring group.
In a local mirroring group, you must configure a monitor port. From this port, mirrored packets are sent to the monitor device for analysis.
Note that:
l Before assigning a port to a port mirroring group, make sure that the mirroring group already exists.
l In a mirroring group, you can configure only one monitor port. This port must not belong to any other mirroring group.
l The monitor port can be an aggregation group member port.
Related commands: mirroring-group.
Examples
# Create local mirroring group 1, and configure GigabitEthernet 3/0/1 as its monitor port.
<Sysname> system-view
[Sysname] mirroring-group 1 local
[Sysname] mirroring-group 1 monitor-port gigabitethernet 3/0/1
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
group-id: Number of a local mirroring group. Its value range is 1 through 4, and the default value is 1.
both: Mirrors both inbound and outbound packets on the current port.
inbound: Mirrors only inbound packets on the current port.
outbound: Mirrors only outbound packets on the current port.
Description
Use the mirroring-port command to assign the current port to a local mirroring group as a mirroring port.
Use the undo mirroring-port command to remove the current port from the port mirroring group.
When assigning a port to a mirroring group as a mirroring port, note that:
l Make sure that the mirroring group you specify already exists.
l When removing a mirroring port from a mirroring group, make sure the traffic direction you specified in the undo mirroring-group command matches the actual monitored direction of the port.
Examples
# Create local mirroring group 1, configure GigabitEthernet 3/0/1 as its mirroring port, and configure to mirror both inbound and outbound packets on GigabitEthernet 3/0/1.
<Sysname> system-view
[Sysname] mirroring-group 1 local
[Sysname] interface gigabitethernet 3/0/1
[Sysname-GigabitEthernet3/0/1] mirroring-group 1 mirroring-port both
# Remove GigabitEthernet 3/0/1 from local mirroring group 1.
<Sysname> system-view
[Sysname] undo mirroring-group 1 mirroring-port gigabitethernet 3/0/1 both
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
group-id: Number of a mirroring group. Its value range is 1 through 4, and the default value is 1.
Description
Use the monitor-port command to assign the current port to a mirroring group as the monitor port.
Use the undo monitor-port command to remove the current port from the mirroring group.
When assigning a port to a mirroring group as the monitor port, note that:
l Make sure that the mirroring group that you specify already exists.
l The port cannot belong to any other mirroring groups.
Related commands: mirroring-group.
Examples
# Create local mirroring group 1, and configure GigabitEthernet 3/0/1 as its monitor port.
<Sysname> system-view
[Sysname] mirroring-group 1 local
[Sysname] interface gigabitethernet 3/0/1
[Sysname-GigabitEthernet3/0/1] monitor-port