12-Port Mirroring Commands
Chapters Download (86.17 KB)
Table of Contents
1 Port Mirroring Configuration Commands
Port Mirroring Configuration Commands
mirroring-group mirroring-port
mirroring-group reflector-port
Syntax
display mirroring-group { group-id | all | local | remote-destination | remote-source }
View
Any view
Default Level
2: System level
Parameters
group-id: Number of the port mirroring group to be displayed, in the range of 1 to 2.
all: Displays all port mirroring groups.
local: Displays local mirroring groups.
remote-destination: Displays remote destination mirroring groups.
remote-source: Displays remote source port mirroring groups.
Description
Use the display mirroring-group command to display information about the specified port mirroring group or groups.
The output varies by port mirroring group type and is sorted by mirroring group number.
Examples
# Display information about all the port mirroring groups.
mirroring-group 1:
type: local
status: active
mirroring port:
GigabitEthernet1/0/2 both
monitor port: GigabitEthernet1/0/4
mirroring-group 2:
type: remote-destination
status: active
monitor port: GigabitEthernet1/0/6
remote-probe VLAN: 10
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 be one of the following: local, remote-source, or remote-destination. |
status |
Status of the port mirroring group, which can be active or inactive. |
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: Specifies the number of the port mirroring group to be created or removed. Its value range is 1 to 2.
all: Removes all port mirroring groups.
local: Creates a local mirroring group or removes all local mirroring groups with the undo command.
remote-destination: Creates a remote destination mirroring group or removes all remote destination mirroring groups with the undo command.
remote-source: Creates a remote source mirroring group or removes all remote source 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.
To mirror packets from a port to another port on the same device, create a local mirroring group.
To mirror packets from a port (a mirroring port) on the current device to another port (the monitor port) either on the same device or on a different device, create remote mirroring groups. When doing that, create the remote source mirroring group on the device where the mirroring port is located and create the remote destination mirroring group on the device where the monitor port is located.
An S5810 series switch supports up to two mirroring groups. These two mirroring groups can be:
l A local mirroring group and a remote destination mirroring group.
l A remote source mirroring group and a remote destination mirroring group.
Examples
# Create a local port mirroring group numbered 1.
<Sysname> system-view
[Sysname] mirroring-group 1 local
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 mirroring group, in the range of 1 to 2.
mirroring-port-list: A list of ports/port ranges to be assigned to or removed from the port mirroring group specified by groupid. 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 local or remote source mirroring group as mirroring ports.
Use the undo mirroring-group mirroring-port command to remove mirroring ports from the mirroring group.
Note that:
l You cannot configure mirroring ports for a remote destination mirroring group.
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.
Examples
# Configure mirroring ports in port mirroring group 1, assuming that the mirroring group already exists.
<Sysname> system-view
[Sysname] mirroring-group 1 mirroring-port gigabitethernet 1/0/1 to gigabitethernet 1/0/23 both
# Remove mirroring ports from port mirroring group 1.
<Sysname> system-view
[Sysname] undo mirroring-group 1 mirroring-port gigabitethernet 1/0/1 to gigabitethernet 1/0/10 both
Syntax
mirroring-group groupid monitor-port monitor-port-id
undo mirroring-group groupid monitor-port monitor-port-id
View
System view
Default Level
2: System level
Parameters
groupid: Number of a local or remote destination mirroring group, in the range of 1 to 2.
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 local or remote destination mirroring group as the monitor port.
Use the undo mirroring-group monitor-port command to remove the monitor port from the local or remote destination mirroring group.
In a local or remote destination mirroring group, you must configure a monitor port. From this port, mirrored packets are sent to the monitor device for analysis.
Note that:
l You can configure only one monitor port for a mirroring group.
l A remote source mirroring group does not contain a monitor port.
l Before assigning a port to a mirroring group, make sure that the 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.
Examples
# Configure GigabitEthernet 1/0/1 as the monitor port in remote destination mirroring group 1.
<Sysname> system-view
[Sysname] mirroring-group 1 remote-destination
[Sysname] mirroring-group 1 monitor-port gigabitethernet 1/0/1
Syntax
In system view:
mirroring-group groupid reflector-port reflector-port-id
undo mirroring-group groupid reflector-port reflector-port-id
In interface view:
mirroring-group groupid reflector-port
undo mirroring-group groupid reflector-port
View
System view, port view
Default Level
2: System level
Parameters
groupid: Number of a remote source mirroring group, in the range of 1 to 2.
reflector-port-id: 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 mirroring group.
Use the undo mirroring-group reflector-port command to remove the reflector port from the remote source mirroring group.
Note that:
l You can configure an egress port for a remote source mirroring group only, not for other types of mirroring group.
l A remote source mirroring group can contain only one egress port.
On some types of devices, a port can be configured as a reflector port only when it is operating with the duplex mode, port speed, and MDI setting being the defaults. Once a port is configured as a reflector port, these settings cannot be modified.
Examples
# Configure GigabitEthernet 1/0/1 as the reflector port in port mirroring group 1 in system view.
<Sysname> system-view
[Sysname] mirroring-group 1 remote-source
[Sysname] mirroring-group 1 reflector-port gigabitethernet 1/0/1
# Configure GigabitEthernet 1/0/2 as the reflector port in port mirroring group 2 in Ethernet port view.
<Sysname> system-view
[Sysname] mirroring-group 2 remote-source
[Sysname] interface gigabitethernet 1/0/2
[Sysname-GigabitEthernet1/0/2] mirroring-group 2 reflector-port
Syntax
mirroring-group groupid remote-probe vlan rprobe-vlan-id
undo mirroring-group groupid remote-probe vlan rprobe-vlan-id
View
System view
Default Level
2: System level
Parameters
groupid: Number of a remote source or destination mirroring group, in the range of 1 to 2.
rprobe-vlan-id: ID of the VLAN to be configured as the remote probe VLAN. This VLAN must be a static VLAN that already exists.
Description
Use the mirroring-group remote-probe vlan command to specify a VLAN as 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 the remote source or destination mirroring group.
Note that:
l For a remote source or destination mirroring group, you must configure and can configure only one remote probe VLAN to carry mirrored packets. You cannot configure the remote probe VLAN for a local mirroring group.
l To ensure correct packet handling, use the VLAN configured as a remote probe VLAN for remote mirroring only.
Examples
# Specify VLAN 2 as the remote probe VLAN of port mirroring group 1, assuming that VLAN 2 already exists.
<Sysname> system-view
[Sysname] mirroring-group 1 remote-source
[Sysname] mirroring-group 1 remote-probe vlan 2
Syntax
[ mirroring-group groupid ] mirroring-port { inbound | outbound | both }
undo [ mirroring-group groupid ] mirroring-port { inbound | outbound | both }
View
Interface view
Default Level
2: System level
Parameters
groupid: Number of a local or remote source mirroring group, in the range of 1 to 2.
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 or remote source 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 If no mirroring group is specified, the port is assigned to port mirroring group 1.
l You cannot configure mirroring ports for a remote destination mirroring group.
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
# Configure GigabitEthernet 1/0/1 as a mirroring port in remote source mirroring group numbered 2.
<Sysname> system-view
[Sysname] mirroring-group 2 remote-source
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] mirroring-group 2 mirroring-port both
Syntax
[ mirroring-group groupid ] monitor-port
undo [ mirroring-group groupid ] monitor-port
View
Interface view
Default Level
2: System level
Parameters
groupid: Number of a local or remote destination mirroring group, in the range of 1 to 2.
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.
When assigning a port to a mirroring group as the monitor port, note that:
l If no mirroring group is specified, the port is assigned to port mirroring group 1.
l You cannot configure a monitor port for a remote source mirroring group.
l The port cannot belong to any other mirroring groups.
Examples
# Configure GigabitEthernet 1/0/1 as the monitor port in local mirroring group numbered 1.
<Sysname> system-view
[Sysname] mirroring-group 1 local
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] monitor-port