monitor session source
To create a SPAN or RSPAN source session, use the monitor session source command in switch configuration mode. To remove a source session, use the no form of this command.
monitor session session_number source { interfaces gigabitEthernet interface-id [ both| rx | tx] | [ remote] vlan vlan-id}
no monitor session session_number source { interfaces gigabitEthernet interface-id | [ remote] vlan vlan-id}
Syntax Description
session_number |
Specifies the session number identified with the SPAN or RSPAN session. Valid range is from 1 to 7. |
interfaces gigabitEthernet interface-id |
Specifies the Gigabit Ethernet port for a SPAN session. |
both, rx, tx |
Specifies the traffic direction to monitor. If you do not specify a traffic direction, the source interface sends both transmitted and received traffic. |
remote |
Specifies remote VLAN for an RSPAN session. |
vlan vlan-id |
Specifies the VLAN for a SPAN or an RSPAN session. Only value of 1 is allowed for the session_number parameter. |
Command Default
No SPAN sessions are configured.
Command Modes
Switch configuration (config-switch)
Command History
Release | Modification |
---|---|
3.6.1 |
This command was introduced. |
Usage Guidelines
To create a SPAN source session to monitor the traffic that enters or leaves a source port, use the monitor session session_number source interfaces gigabitEthernet interface-id [ both | rx | tx] command . To create a SPAN source session to monitor the traffic that is bridged into a source VLAN, use the monitor session session_number source vlan vlan-id command.
A session can have up to eight source ports and one destination port with the same session number. A source port cannot be a destination port. Each monitor session session_number source command defines only one Gigabit Ethernet port or VLAN. If a packet is mirrored by a port-based ingress mirroring mechanism along with any other ingress mirroring mechanism, the session with the higher session number is selected.
A session cannot have both SPAN and RSPAN source ports. All source ports in a session must be of same type, that is, either SPAN or RSPAN.
Use the no monitor session session_number source { interfaces gigabitEthernet interface-id | vlan vlan-id} command to remove one source port of a source session. Use the no monitor session session_number source command to remove all sources ports of a source session. To change a source port, you must first remove it and then create it again as shown in Example 2.
Examples
The following
example configures a SPAN session consisting of three source ports and one
destination port. The first source session copies traffic for both directions
from the source port
1/1
, the second source session copies the bridged
traffic from VLAN 100, and the third source session copies the traffic received
on the source port
1/2
. The port
1/3
is configured as the destination port.
nfvis(config-switch)# monitor session 1 source interfaces gigabitEthernet 1/1 both
nfvis(config-switch)# monitor session 1 source vlan 100
nfvis(config-switch)# monitor session 1 source interfaces gigabitEthernet 1/2 rx
nfvis(config-switch)# monitor session 1 destination interfaces gigabitEthernet 1/3
Examples
The following example shows how to change a source session.
nfvis(config-switch)# monitor session 1 source interfaces gigabitEthernet 1/3 tx
nfvis(config-switch)# commit
nfvis(config-switch)# no monitor session 1 source interfaces gigabitEthernet 1/3 tx
nfvis(config-switch)# commit
nfvis(config-switch)# monitor session 1 source interfaces gigabitEthernet 1/3 rx
nfvis(config-switch)# commit