monitor session destination
To create a new Switched Port Analyzer (SPAN) or Remote SPAN (RSPAN) destination session, use the monitor session destination command in Global Configuration mode. To remove a destination session, use the no form of the command.
Syntax
monitor session session_number destination {{interface interface-id [network]} | {remote vlan vlan-id reflector-port interface-id} network}
no monitor session session_number destination
Parameters
-
session_number—Specify the session number identified with the SPAN, RSPAN or flow mirror session. The range is 1 to 4.
-
interface interface-id—Specify the destination interface for the SPAN, RSPAN or flow mirror session (Ethernet port). When the source interface is a RSPAN VLAN the RSPAN VLAN_ID is removed from all frames copied to the interface.
-
network—Specify that the destination port acts also as a network port.
-
remote vlan vlan-id—Specify the RSPAN VLAN for an RSPAN destination session. Not more than one RSPAN destination VLAN can be defined.
-
reflector-port interface-id—Specify the destination interface for a RSPAN session (Ethernet port). The RSPAN VLAN_ID is added to all frames copied to the interface.
Default Configuration
No SPAN and RSPAN sessions are configured.
Command Mode
Global Configuration mode
User Guidelines
Use the monitor session session_number destination interface interface-id, to create a SPAN, local flow mirror, final RSPAN or final remote flow mirror destination session to copy traffic to a destination port.
Use the monitor session session_number destination remote vlan vlan-id reflector-port interface-id command, to create a start RSPAN destination session to copy traffic to a RSPAN VLAN via a reflector port.
A destination or reflector port cannot be a source port.
A destination or reflector port cannot be a OOB port.
If the network keyword is not defined only mirrored traffic sent on a destination port and all input traffic is discard and a value of DOWN is advertised as its operational status to all applications running on it.
A destination port configured without the network keyword has the following limitations:
-
UDLD cannot be enabled on the port.
-
802.1x cannot be enabled on the port.
A port cannot be configured as destination port with the network keyword if one the following conditions is true:
-
It belongs to the source VLAN
-
It belongs to the remote VLAN
Please, do not add the destination port to the source/remote VLAN.
A port cannot be configured as reflector if it belongs to the remote VLAN.
The remote VLAN cannot be configured as a source VLAN.
Only in the final switch the remote VLAN can be configured as a source remote VLAN
A destination port with the network keyword or reflector port cannot be configured on an edge port (a port having one of the vlan-mapping modes.
Mirrored traffic is sent to queue number 1 of the destination port.
Use the no monitor session session_number destination command to remove one destination session.
Examples
Example 1. The following example configures a SPAN session consisting from 3 source and one destination session. The first source session copies traffic for both directions from the source port gi1/0/2, the second source session copies bridges traffic from VLAN 100, and the third source session copies traffic for received on the source port gi1/0/3. The destination session defines port gi1/0/1 as the destination port.
switchxxxxxx(config)# monitor session 1 source interface gi1/0/2 both
switchxxxxxx(config)# monitor session 1 source vlan 100
switchxxxxxx(config)# monitor session 1 source interface gi1/0/3 rx
witchxxxxxx(config)# monitor session 1 destination interface gi1/0/1
Example 2. The following example configures a flow mirror session:
switchxxxxxx(config)# ip access-list extended ip1
switchxxxxxx(config-ip-al)# permit ip any any
switchxxxxxx(config-ip-al)# exit
switchxxxxxx(config)# class-map c1
switchxxxxxx(config-cmap)# match access-group ip1
switchxxxxxx(config-cmap)# exit
switchxxxxxx(config)# policy-map p1
switchxxxxxx(config-pmap)# class c1
switchxxxxxx(config-pmap-c)# mirror 1
switchxxxxxx(config-pmap-c)# exit
switchxxxxxx(config-pmap)# exit
Example 3. The following example configures a RSPAN start session consisting from 2 source and one destination sessions. The first source session copies traffic for both directions from the source port gi1/0/2 and the second session copies traffic from VLAN 100. The destination session defines VLAN 2 as the RSPAN VLAN and port gi1/0/1 as the reflector port.
switchxxxxxx(config)# monitor session 1 source interface gi1/0/2 both
switchxxxxxx(config)# monitor session 1 source vlan 100
switchxxxxxx(config)# monitor session 1 destination remote vlan 2 reflector-port gi1/0/1 network
Example 4. The following example configures a final RSPAN session that copies traffic from a RSPAN VLAN 2 to destination port gi1/0/1:
switchxxxxxx(config)# vlan 2
switchxxxxxx(config-vlan)# remote-span
switchxxxxxx(config-vlan)# exit
switchxxxxxx(config)# monitor session 1 source remote vlan 2
switchxxxxxx(config)# monitor session 1 destination interface gi1/0/1