Chapter 1 Port Mirroring Configuration
Port mirroring refers to the process of
copying packets of a specified port to a destination port. A destination port
is connected to a data detect device, which you can use to analyze the packets
mirrored from the source to the destination port for monitoring and
troubleshooting your network.

Figure 1-1 Schematic diagram of port
mirroring
Port mirroring is implemented through
mirroring groups. S5500-SI series Ethernet switches support the configuration
of local mirroring group to implement the local port mirroring function. Local
port mirroring is to copy packets from one or more ports (source ports) of a
device to a monitor port (destination port) on the same device for traffic
analysis and monitoring. In this case, the source ports and the destination
port locate at the same device.
Follow these steps to configure a local
port mirroring:
|
To do…
|
Use the command…
|
Remarks
|
|
Enter system view
|
system-view
|
—
|
|
Create local mirroring group
|
mirroring-group groupid local
|
Required
|
|
Configure mirroring port for the
mirroring group
|
Configure mirroring port under system
view
|
mirroring-group groupid mirroring-port mirroring-port-list { inbound |
outbound | both }
|
One of them is required.
You can configure multiple mirroring
ports at the same time under system view, or configure a mirroring port under
a specific interface view.
|
|
Configure mirroring port under interface
view
|
interface interface-type
interface-number
|
|
[ mirroring-group groupid ]
mirroring-port { inbound | outbound | both }
|
|
quit
|
|
Configure monitor port for the mirroring
group
|
Configure monitor port under system view
|
mirroring-group groupid monitor-port monitor-port-id
|
One of them is required.
The two ways of configuration are the
same.
|
|
Configure monitor port under interface
view
|
interface interface-type
interface-number
|
|
[ mirroring-group groupid ]
monitor-port
|
l
The local mirroring group takes effect only
after a source port and a destination port are added to it.
l
A monitor port can’t enable STP RSTP or
MSTP; otherwise it will affect the device’s normal functions. And vice
versa.
l
A monitor port cannot be a member port of the current
mirroring group.
l
You can configure multiple mirroring ports for a
mirroring group, but only one monitor port.
Follow these steps to display and maintain
port mirroring:
|
To do…
|
Use the command…
|
|
Display the configuration information of
port mirroring group
|
display mirroring-group { groupid | local }
|
I. Network requirements
The
user’s network is described as follows:
l
The packets of Department 1 are connected to
Switch C through port GigabitEthernet1/0/1.
l
The packets of Department 2 are connected to
Switch C through port GigabitEthernet1/0/2.
l
The data detect device is connected to Switch C
through port GigabitEthernet1/0/3.
The demand is to monitor packets of
Department 1 and Department 2 through the Server.
For implementing the demand using local
port mirroring, run the following configuration on Switch C:
l
Configure GigabitEthernet1/0/1 and GigabitEthernet1/0/2
as the mirroring port.
l
Connect the Server’s port GigabitEthernet1/0/3
as the monitor port.
II. Network diagram

Figure 1-2 Configuring Local Port Mirroring Network Diagram
III. Configuration procedure
Configuring Switch C:
# Enter system view.
<Sysname> system-view
# Create local mirroring group
[Sysname] mirroring-group 1 local
# Configure mirroring and monitor ports for
local mirroring group.
[Sysname] mirroring-group 1
mirroring-port GigabitEthernet 1/0/1 to GigabitEthernet 1/0/2 both
[Sysname] mirroring-group 1
monitor-port GigabitEthernet 1/0/3
# Display configuration information of mirroring
group 1.
[Sysname] display mirroring-group 1
mirroring-group 1:
type: local
status: active
mirroring port:
GigabitEthernet1/0/1 both
GigabitEthernet1/0/2 both
monitor port: GigabitEthernet1/0/3
After finishing the configuration, the user
can monitor all the packets received and sent by Department 1 and Department 2
on the Server.