Port Monitor Commands

This chapter contains the following sections:

monitor session destination interface

To start a destination interface (monitoring) of a port monitor session (mirroring), use the monitor session destination interface Global Configuration mode command.

To stop a destination interface of a port monitoring session, use the no form of this command.

Syntax

monitor session session-number destination interface interface-id [allow-ingress-packet]

no monitor session session-number destination interface interface-id

Parameters

session-number—The identifier for a port monitor session. (Range: 1 to 4)

interface-id—The destination interface ID. The interface must be an Ethernet interface.

allow-ingress-packet—(Optional) Enables ingress traffic forwarding for the destination interface.

Default Configuration

N/A

Command Mode

Global Configuration mode

User Guidelines

This command specifies the destination port for a monitor session. The following restrictions apply to the ports that are configured to be monitored ports:

  • The port cannot be source port.

  • The port is not a member in the port channel.

  • GVRP is not enabled on the port.

Example

The following example defines the destination port fa24 for the monitor session 1:

switchxxxxxx(config)# monitor session 1 destination interface gi24

monitor session destination remote-span

To start a destination interface for remote SPAN, use the monitor session destination remote-span Global Configuration mode command.

To stop a destination interface for remote SPAN, use the no form of this command.

Syntax

monitor session session-number destination remote-span vlan vlan-id reflector-interface interface-id

no monitor session session-number destination remote-span

Parameters

session-number—The identifier of the monitor session. (Range: 1 to 4)

vlan vlan-id—Specifies the remote VLAN for a RSPAN destination session. (Range: 2 to 4094)

reflector-interface interface-id—Specifies the reflector interface ID. The interface ID must be an Ethernet port.

Command Mode

Global Configuration mode

Example

The following example defines the destination remote-span VLAN 2 and reflector interface fa11 for the monitor session 1:

switchxxxxxx(config)# vlan 2 
switchxxxxxx(config-vlan)# remote-span
switchxxxxxx(config-vlan)# exit
switchxxxxxx(config)# monitor session 1 destination remote-span vlan 2 reflector-interface gi11

monitor session source interfaces

To start a source interface (monitored) of a port monitor session (mirroring), use the monitor session source interfaces Global Configuration mode command.

Use the no form of this command to stop a port monitor session.

Syntax

monitor session session-number source interfaces interface-id {both | rx | tx}

no monitor session session-number source interfaces interface-id {both | rx | tx}

monitor session session-number source vlan vlan-id

no monitor session session-number source vlan

Parameters

session-number—The identifier for the port monitor session. (Range: 1 to 4)

interface-id—The source interface ID. The interface ID must be an Ethernet port.

both—Monitors both transmitted and received packets.

rx—Monitors received packets only.

tx—Monitors transmitted packets only.

vlan vlan-id—Specifies a VLAN.

Default Configuration

N/A

Command Mode

Global Configuration mode

User Guidelines

This command specifies the source ports for a monitor session. The port that is configured to be a source port cannot be a destination port.

In this mode some traffic duplication on the analyzer port may be observed. For example:

  • Port 2 is being egress monitored by port 4.

  • Port 2 and 4 are members in VLAN 3.

  • Unknown unicast packet sent to VLAN 3 will egress from port 4 twice, one instance as normal forward and another instance as mirrored from port 2.

  • Moreover, if port 2 is an untagged member in VLAN 3 and port 4 is a tagged member, then both instances will look different (one tagged and the other is not).

Example

The following example copies traffic for both directions (Tx and Rx) from the source port fa2 to the monitor session 1:

switchxxxxxx(config)# monitor session 1 source interfaces gi2 both

monitor session source remote-span

To start a source interface for remote SPAN (RSPAN), use the monitor session source remote-span Global Configuration mode command.

To stop a source interface for remote SPAN, use the no form of this command.

Syntax

monitor session session-number source remote-span vlan vlan-id

no monitor session session-number source remote-span

Parameters

session-number—RSPAN monitor session number. (Range: 1 to 4)

vlan vlan-id—Specifies the remote VLAN for a RSPAN source session. The VLAN is used to copy traffic to another device. (Range: 2 to 4094)

Command Mode

Global Configuration mode

Example

The following example defines the source remote-span VLAN 2 for the monitor session 1:

switchxxxxxx(config)# vlan 2
switchxxxxxx(config-vlan)# remote-span
switchxxxxxx(config-vlan)# exit
switchxxxxxx(config)# monitor session 1 source remote-span vlan 2

no monitor session

To disable all monitor sessions or disable a specific monitor session, use the no monitor session Global Configuration mode command.

Syntax

no monitor session {session number | all | local | remote}

Parameters

session number—A specific monitor session to be disabled. (Range: 1 to 4)

all—Disables all monitor sessions.

local—Disables a local monitor session.

remote—Disables a RSPAN session.

Default Configuration

N/A

Command Mode

Global Configuration mode

Example

switchxxxxxx(config)# no monitor session all

remote-span

To enable remote SPAN, use the remote-span VLAN Configuration mode command.

To disable remote SPAN, use the no form of this command.

Syntax

remote-span

no remote-span

Parameters

N/A

Command Mode

VLAN Configuration mode

Example

The following example defines VLAN 2 as a RSPAN VLAN:

switchxxxxxx(config)# vlan 2
switchxxxxxx(config-vlan)# remote-span

show monitor

To show the status for all monitor sessions or for a specific monitor session, use the show monitor Privileged EXEC Mode command.

Syntax

show monitor [session session-number]

Parameters

session session-number—(Optional) Specifies the identifier of the monitor session. If not specified, all monitor sessions will be displayed. (Range: 1 to 4)

Default Configuration

N/A

Command Mode

Privileged EXEC Mode

Example

switchxxxxxx# show monitor
Session 1 Configuration
Session Type  : Unknown
Mirrored source   : Not Config
Destination port  : Not Config
Session 2 Configuration
Session Type  : Unknown
Mirrored source   : Not Config
Destination port  : Not Config
Session 3 Configuration
Session Type  : Unknown
Mirrored source   : Not Config
Destination port  : Not Config
Session 4 Configuration
Session Type  : Unknown
Mirrored source   : Not Config
Destination port  : Not Config

show vlan remote-span

To show the remote SPAN VLAN, use the show vlan remote-span Privileged EXEC Mode command.

Syntax

show vlan remote-span

Parameters

N/A

Default Configuration

N/A

Command Mode

Privileged EXEC Mode

Example

switchxxxxxx# show vlan remote-span
Remote SPAN VLAN ID: 3