monitor session

Enables a port mirroring session, which sends copies of packets that enter or exit one port to another physical port or LAG interface, where the packets can be analyzed.

Syntax

monitor session session_number
source { ethernet slot / port | port-channel index | ve index } destination { ethernet slot / port | port-channel index } direction dir
no monitor session session_number

Parameters

session_number
Specifies a session identification number. Valid values range from 1 through 512.
source
Specifies the interface for which you are defining a mirror.
ethernet
Specifies a physical Ethernet interface.
slot
Specifies a valid slot number. For devices that do not support linecards, specify 0.
port
Specifies a valid port number.
port-channel index
Specifies a valid port-channel interface number.
ve index
Specifies a valid virtual ethernet interface number.
destination
Specifies the physical-interface or port-channel mirror to use as the destination for mirroring.
ethernet
Specifies a physical Ethernet interface.
slot
Specifies a valid slot number. For devices that do not support linecards, specify 0.
port
Specifies a valid port number.
port-channel index
Specifies a port-channel interface.
direction dir
Specifies the direction of packets to mirror. Acceptable values are both (ingress and egress), rx (ingress only), or tx (egress only).

Modes

Global configuration mode

Usage Guidelines

All protocols such as LLDP must be disabled on interfaces that you select to be destination interfaces.

Run the no monitor session session_number command to delete the port mirroring session.

Examples

The following example enables session 22 for monitoring traffic from source Ethernet 0/1 to destination Ethernet 0/2 in the egress direction.

device# configure terminal
device(config)# monitor session 22 
device(config-session-22)# source ethernet 0/1 destination ethernet 0/2 direction tx

The following example enables session 23 for monitoring traffic from source Ethernet 0/1 to destination Ethernet 0/2 in the ingress direction.

device# configure terminal
device(config)# monitor session 23 
device(config-session-23)# source ethernet 0/1 destination ethernet 0/2 direction rx

The following example enables session 24 for monitoring traffic from source Ethernet 0/1 to destination Ethernet 0/2 in both directions.

device# configure terminal
device(config)# monitor session 24 
device(config-session-24)# source ethernet 0/1 destination ethernet 0/2 direction both

The following example shows the configuration of mirroring from a Port Channel to a destination that is a Port Channel. Traffic from both directions is mirrored.

SLX# configure terminal
SLX (config)# monitor session 25
SLX (config-session-25)# source port-channel 1 destination port-channel 11 direction both