Configuring port mirroring
Both Layer 2 and Layer 3 interfaces support port mirroring. The term "port" in this chapter collectively
refers to these two types of interface. The Layer 3 Ethernet interface in this document refers to an Ethernet
port that can perform IP routing and inter-VLAN routing. You can set an Ethernet port as a Layer 3
Ethernet interface by using the port link-mode route command (see Layer 2—LAN Switching
Configuration Guide).
Port mirroring copies packets passing through a port/CPU (called a mirroring port/CPU) to another port
(called the monitor port) connected with a monitoring device for packet analysis.
You can select to port-mirror inbound, outbound, or bidirectional traffic on a port/CPU as needed.
Port mirroring types
Port mirroring falls into the following types:
Local port mirroring: In local port mirroring, the mirroring ports/CPUs and the monitor port are
•
located on the same device.
Layer 2 remote port mirroring: In Layer 2 remote port mirroring, the mirroring ports/CPUs and the
•
monitor port are located on different devices on a same Layer 2 network.
Layer 3 remote port mirroring: In Layer 3 remote port mirroring, the mirroring ports/CPUs and the
•
monitor port are separated by IP networks.
NOTE:
•
Because a monitor port can monitor multiple ports, it may receive multiple duplicates of a packet in
some cases. Suppose that Port 1 is monitoring bidirectional traffic on Port 2 and Port 3 on the same
device. If a packet travels from Port 2 to Port 3, two duplicates of the packet will be received on Port 1.
On the HP 5820X&5800 switch series, if incoming traffic is mirrored, the mirrored traffic is sent with
•
the same VLAN tag (if any) as the original traffic; if the outgoing traffic is mirrored, the mirrored
traffic carries the same VLAN tag as the original traffic did before it was sent out the mirroring ports.
Implementing port mirroring
Port mirroring is implemented through port mirroring groups. Mirroring groups have the types: local,
remote source, and remote destination.
The following subsections describe how local port mirroring, Layer 2 remote port mirroring, and Layer 3
remote port mirroring are implemented.
Local port mirroring
Local port mirroring is implemented through a local mirroring group. In local port mirroring, packets
passing through a port/CPU (mirroring port/CPU) are mirrored to the monitor port located on the same
device.
165