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 port_number destination type port_number direction dir
no monitor session session_number

Parameters

session_number
Specifies a session identification number. Valid values range from 1 through 512.
source ethernet port_number
Specifies the source Ethernet interface port.
destination type port_number
Specifies the destination type and port number for the copied packets. Acceptable types are ethernet or port-channel.
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