Published On: August 6ᵗʰ, 2019 02:05
Cisco Enterprise Network Compute System Switch Command Reference
Monitor Commands
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 History
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
monitor session destination
To create a SPAN or RSPAN destination session, use the monitor session destination command in switch configuration mode. To remove a destination session, use the no form of this command.
monitor session session_number destination { interfaces gigabitEthernet interface-id [ network] | remote vlan vlan-id reflector-port gigabitEthernet interface-id network}
no monitor session session_number destination
Syntax Description
session_number |
Specifies the session number identified with the SPAN or flow mirror session. Valid range is from 1 to 7. |
interfaces gigabitEthernet interface-id |
Specifies the Gigabit Ethernet port for the SPAN or flow mirror session. |
network |
Specifies that the destination port acts also as a network port. |
remote vlan vlan-id |
Specifies the remote VLAN for an RSPAN session. |
reflector-port gigabitEthernet interface-id |
Specifies the reflector Gigabit Ethernet port that will flood the RSPAN traffic onto the RSPAN VLAN. |
Command History
Usage Guidelines
Use the monitor session session_number destination interfaces gigabitEthernet interface-id command to create a SPAN session to copy traffic to a destination port.
If the network keyword is not defined, only mirrored traffic is sent on a destination port. All input traffic is discarded and a value of DOWN is advertised as its operational status to all applications running on it. 802.1x cannot be enabled on a destination port configured without the network keyword.
A destination port cannot be a source port. A port cannot be configured as the destination port with the network keyword if it belongs to the source VLAN. Mirrored traffic is sent to queue number 1 of the destination port.
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