- Table of Contents
- Related Documents
-
Title | Size | Download |
---|---|---|
07-Mirroring Commands | 63.45 KB |
Port mirroring configuration commands
Support for port mirroring commands depends on the device model. For more information, see About the H3C Access Controllers Command References.
display mirroring-group
Use display mirroring-group to display mirroring group information.
Syntax
display mirroring-group { group-id | all | local } [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command level
2: System level
Parameters
group-id: Specifies the number of the mirroring group. The value is 1.
all: Displays all mirroring groups.
local: Displays local 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.
Usage guidelines
The output varies by mirroring group types and is sorted by mirroring group numbers.
Examples
# Display information about all the mirroring groups.
<Sysname> display mirroring-group all
mirroring-group 3:
type: local
status: active
mirroring port:
GigabitEthernet1/0/1 inbound
GigabitEthernet1/0/2 both
monitor port : GigabitEthernet1/0/3
Table 1 Command output
Field |
Description |
mirroring-group |
Number of the mirroring group. |
type |
Type of the mirroring group. |
status |
Status of the mirroring group, active or inactive. |
mirroring port |
Source 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 group exists.
Views
System view
Default command level
2: System level
Parameters
group-id: Specifies the number of the mirroring group. The value is 1.
all: Deletes all mirroring groups.
local: Specifies local mirroring groups.
Examples
# Create local mirroring group 1.
<Sysname> system-view
[Sysname] mirroring-group 1 local
mirroring-group mirroring-port
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 mirroring-port-list { both | inbound | outbound }
undo mirroring-group group-id mirroring-port mirroring-port-list { both | inbound | outbound }
Default
No source port is configured for a mirroring group.
Views
System view
Default command level
2: System level
Parameters
group-id: Specifies the number of a mirroring group. The value is 1. The specified mirroring group must already exist.
mirroring-port-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.
both: Mirrors both inbound and outbound packets.
inbound: Mirrors only inbound packets.
outbound: Mirrors only outbound packets.
Usage guidelines
When you remove a source port from a mirroring group, make sure the direction specified in the undo command matches the port mirroring direction.
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
Related commands
mirroring-group
mirroring-group monitor-port
Use mirroring-group monitor-port to configure a port as the monitor port for a mirroring group.
Use undo mirroring-group monitor-port to remove the monitor port from a mirroring group.
Syntax
mirroring-group group-id monitor-port monitor-port-id
undo mirroring-group group-id monitor-port monitor-port-id
Default
No monitor port is configured for a mirroring group.
Views
System view
Default command level
2: System level
Parameters
group-id: Specifies the number of a mirroring group. The value is 1. The specified mirroring group must already exist.
monitor-port-id: Specifies the 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.
Usage guidelines
You cannot configure a source port in an existing mirroring group as the monitor port.
Examples
# Create local mirroring group 1, and configure port 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
mirroring-port
Use mirroring-port to configure a source port for a mirroring group.
Use undo mirroring-port to remove the port from a mirroring group.
Syntax
[ mirroring-group group-id ] mirroring-port { inbound | outbound | both }
undo [ mirroring-group group-id ] mirroring-port { inbound | outbound | both }
Default
No source port is configured for a mirroring group.
Views
Interface view
Default command level
2: System level
Parameters
mirroring-group group-id: Specifies a mirroring group by its number. The value is 1. The specified mirroring group must already exist.
both: Mirrors both inbound and outbound packets.
inbound: Mirrors only inbound packets.
outbound: Mirrors only outbound packets.
Usage guidelines
When you remove a source port from a mirroring group, make sure the direction specified in the undo command matches the port mirroring direction.
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] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] mirroring-group 1 mirroring-port both
monitor-port
Use monitor-port to configure a port as the monitor port for a mirroring group.
Use undo monitor-port to remove the monitor port from a mirroring group.
Syntax
[ mirroring-group group-id ] monitor-port
undo [ mirroring-group group-id ] monitor-port
Default
No monitor port is configured for a mirroring group.
Views
Interface view
Default command level
2: System level
Parameters
mirroring-group group-id: Specifies a mirroring group by its number. The value is 1. The specified mirroring group must already exist.
Usage guidelines
You cannot configure a source port of an existing mirroring group 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] monitor-port
Related commands
mirroring-group