- New and Changed Information
- Overview
- Configuring CDP
- Configuring the Domain
- Managing Server Connections
- Managing the Configuration
- Working with Files
- Managing Users
- Configuring NTP
- Configuring Local SPAN and ERSPAN
- Configuring SNMP
- Configuring NetFlow
- Configuring System Message Logging
- Configuring iSCSI Multipath
- Configuration Limits
Configuring Local SPAN and ERSPAN
This chapter describes how to configure the Local and ER Ethernet switched port analyzer (SPAN) feature to monitor traffic.
Information About SPAN and ERSPAN
The Switched Port Analyzer (SPAN) feature (sometimes called port mirroring or port monitoring) allows network traffic to be analyzed by a network analyzer such as a Cisco SwitchProbe or other Remote Monitoring (RMON) probe.
SPAN lets you monitor traffic on one or more ports, or one or more VLANs, and send the monitored traffic to one or more destination ports where the network analyzer is attached.
SPAN Sources
The interfaces from which traffic can be monitored are called SPAN sources. These include Ethernet, virtual Ethernet, port-channel, and VLAN. When a VLAN is specified as a SPAN source, all supported interfaces in the VLAN are SPAN sources. Traffic can be monitored in the receive direction, the transmit direction, or both directions for Ethernet and virtual Ethernet source interfaces.
Characteristics of Source Ports
A source port has these characteristics:
- Can be port type Ethernet, virtual Ethernet, port-channel, or VLAN.
- Cannot be a destination port.
- Can be configured to monitor the direction of traffic —receive, transmit, or both.
- Source ports can be in the same or different VLANs.
- For VLAN SPAN sources, all active ports in the source VLAN are included as source ports.
- Local SPAN sources must be on the same host (linecard) as the destination port.
SPAN Destinations
SPAN destinations refer to the interfaces that monitor source ports. This section includes the following topics:
Characteristics of Local SPAN Destination Ports
Each local SPAN session must have at least one destination port (also called a monitoring port) that receives a copy of traffic from the source ports or VLANs. A destination port has these characteristics:
- Can be any physical or virtual Ethernet port or a port channel.
- Cannot be a source port.
- Is excluded from the source list and is not monitored if it belongs to a source VLAN of any SPAN session.
- Receives copies of transmitted and received traffic for all monitored source ports. If a destination port is oversubscribed, it can become congested. This congestion can affect traffic forwarding on one or more of the source ports.
- Must be on the same host (linecard) as the source port.
- In Local SPAN, the source interface and destination interface are on the same device.
See Figure 9-1, Local SPAN.
Characteristics of ERSPAN Destination Ports
- An ERSPAN destination is specified by an IP address.
- In ERSPAN, source SPAN interface and destination SPAN interface may be on different devices interconnected by an IP network. ERSPAN traffic is GRE-encapsulated. See Figure 9-2, ERSPAN.
Local SPAN
In Local SPAN, the source interface and destination interface are on the same device. The network analyzer is attached directly to the SPAN destination port. The SPAN source can be a port or a VLAN interface.The destination, although usually a port, could also be a VLAN.
Figure 9-1 shows that traffic transmitted by host A is received on the SPAN source interface. Traffic (ACLs, QoS, and so forth) is processed as usual. Traffic is then replicated. The original packet is forwarded on toward host B. The replicated packet is then sent to the destination SPAN interface where the monitor is attached.
Local SPAN can replicate to one or more destination ports. Traffic can be filtered so that only traffic of interest is sent out the destination SPAN interface.
Local SPAN can monitor all traffic received on the source interface including BPDUs.

Encapsulated Remote SPAN
Encapsulated remote (ER) SPAN monitors traffic in multiple network devices across an IP network and sends that traffic in an encapsulated envelope to destination analyzers. In contrast, Local SPAN cannot forward traffic through the IP network. ERSPAN can be used to monitor traffic remotely. ERSPAN sources can be ports or VLANs.
In Figure 9-2, the ingress and egress traffic for host A are monitored using ERSPAN. Encapsulated ERSPAN packets are routed from host A through the routed network to the destination device where they are de-capsulated and forwarded to the attached network analyzer. The destination may also be on the same L2 network as the source.

Network Analysis Module
You can also use the Cisco Network Analysis Module (NAM) to monitor ERSPAN data sources for application performance, traffic analysis, and packet header analysis.
To use NAM for monitoring the Cisco Nexus 1000V ERSPAN data sources see the Cisco Nexus 1010 Network Analysis Module Installation and Configuration Note, 4.2.
SPAN Sessions
You can create up to 64 total SPAN sessions (Local SPAN plus ERSPAN) on your local device.
You can configure an ERSPAN session ID that is added to the ERSPAN header of the encapsulated frame to differentiate between various ERSPAN streams of traffic at the termination box. You can also configure the range of flow ID numbers. For more information, see
You can also create a SPAN session to monitor multiple VLAN sources and choose only VLANs of interest to transmit on multiple destination ports. For example, you can configure SPAN on a trunk port and monitor traffic from different VLANs on different destination ports.
Figure 9-3 shows a VLAN-based SPAN configuration that copies traffic from three VLANs to three specified destination ports. You can choose which VLANs to allow on each destination port to limit the traffic transmitted. In Figure 9-3, the device transmits packets from one VLAN at each destination port.

Note VLAN-based SPAN sessions cause all source packets to be copied to all destinations, whether the packets are required at the destination or not. VLAN traffic filtering occurs at transmit destination ports.
Figure 9-3 VLAN-based SPAN Configuration

SPAN Guidelines and Limitations
SPAN has the following configuration guidelines and limitations:
- A maximum of 64 SPAN sessions (Local SPAN plus ERSPAN) can be configured on the VSM.
- A maximum of 32 source VLANs are allowed in a session.
- A maximum of 128 source interfaces are allowed in a session.


To avoid an overload on uplink ports, use caution when configuring ERSPAN, especially when sourcing VLANs.
- A port can be configured in a maximum of 4 SPAN sessions.
- The destination port used in one SPAN session cannot also be used as the destination port for another SPAN session.
- You cannot configure a port as both a source and destination port.
- In a SPAN session, packets that source ports receive may be replicated even though they are not transmitted on the ports. The following are examples of this behavior:
Default Settings
Table 9-1 lists the SPAN default settings.
|
|
---|---|
Configuring SPAN
This section describes how to configure SPAN and includes the following procedures.
- Configuring a Local SPAN Session
- Configuring an ERSPAN Port Profile
- Configuring an ERSPAN Session
- Shutting Down a SPAN Session
- Resuming a SPAN Session
- Verifying the SPAN Configuration
Configuring a Local SPAN Session
Use this procedure to configure a SPAN session.

Note If you are configuring ERSPAN, see the Configuring an ERSPAN Session.
BEFORE YOU BEGIN
- You are logged in to the CLI in EXEC mode.
- You know the number of the SPAN session you are going to configure.
- The source and destination ports are already configured in either access or trunk mode. For more information, see the Cisco Nexus 1000V Interface Configuration Guide, Release 4.0(4)SV1(3).
- SPAN sessions are created in the shut state by default.
- When you create a SPAN session that already exists, any additional configuration is added to that session. To make sure the session is cleared of any previous configuration, you can delete the session first (see Step 2, no monitor session).
- This procedure involves creating the SPAN session in Monitor Configuration mode; and then, optionally, configuring allowed VLANs in Interface Configuration mode.
SUMMARY STEPS
2. no monitor session session-number
3. monitor session session-number
5. source {interface type | vlan} {number | range} [ rx | tx | both ]
6. (Optional) Repeat Step 5 to configure additional SPAN sources.
7. (Optional) filter vlan {number | range}
8. (Optional) Repeat Step 7 to configure all source VLANs to filter.
9. destination interface type {number | range}
10. (Optional) Repeat Step 9 to configure all SPAN destination ports.
13. (Optional) interface ethernet slot / port [- port ]
14. (Optional) switchport trunk allowed vlan { vlan-range | add vlan-range | except vlan-range | remove vlan-range | all | none }
15. (Optional) Repeat Step 13 and Step 14 to configure the allowed VLANs on each destination port.
16. (Optional) show interface ethernet slot / port [- port ] trunk
DETAILED STEPS
|
|
|
---|---|---|
monitor session session-number |
Creates a session with the given session number and places you in the CLI Monitor Configuration mode to further configure the session. |
|
source {interface type | vlan} n1000v(config-monitor)# source interface ethernet 2/1-3, ethernet 3/1 rx n1000v(config-monitor)# source interface port-channel 2 |
For the specified session, configures the sources and the direction of traffic to monitor.
|
|
(Optional) Repeat Step 5 to configure additional SPAN sources. |
||
(Optional) For the specified SPAN session, configures the filter from among the source VLANs. |
||
(Optional) Repeat Step 7 to configure all source VLANs to filter. |
||
destination interface type n1000v(config-monitor)# destination interface ethernet 2/5, ethernet 3/7 |
For the specified SPAN session, configures the port(s) to act as destination(s) for copied source packets.
Note SPAN destination ports must already be configured as either access or trunk ports. |
|
(Optional) Repeat Step 9 to configure all SPAN destination ports. |
||
|
Enables the SPAN session. By default, the session is created in the shut state. |
|
(Optional) Exits Monitor Configuration mode and places you in CLI Configuration mode. |
||
interface ethernet slot / port [- port ] |
(Optional) Places you in CLI Interface Configuration mode for the specified interface. |
|
switchport trunk allowed vlan { vlan-range | add vlan-range | except vlan-range | remove vlan-range | all | none } |
(Optional) For the specified interface. configures the range of VLANS that are allowed on the interface. By default all VLANs are allowed on the interface.
|
|
(Optional) Repeat Step 13 and Step 14 to configure the allowed VLANs on each destination port. |
||
(Optional) Displays the interface trunking configuration for the selected slot and port or range of ports. |
||
(Optional) Saves the running configuration persistently through reboots and restarts by copying it to the startup configuration. |
Configuring an ERSPAN Port Profile
Use this procedure to configure a port profile on the VSM to carry ERSPAN packets through the IP network to a remote destination analyzer.
BEFORE YOU BEGIN
- You are logged in to the CLI in EXEC mode.
- This configuration must be completed for all hosts in the vCenter Server.
- You know the name to be used for this port profile.

Note The port profile name is used to configure the VMKNIC that is required on each of the ESX hosts.
- You know the name of the VMware port group to which this profile maps.
- You have the VMware documentation for adding a new virtual adapter.
- You have already created the system VLAN and you know its VLAN ID which will be used in this configuration.
For more information about system port profiles, see the Cisco Nexus 1000V Port Profile Configuration Guide, Release 4.0(4)SV1(3).
- The port profile used for ERSPAN must be configured for Layer 3 control. This procedure includes a step for making this configuration.
- Only one VM kernel NIC can be assigned to this Layer 3 control port profile per host.
– If more than one VMware kernel NIC is assigned to a host, the last one assigned takes effect.
– If more than one VMware kernel NIC is assigned to a host, and you remove the second one assigned, then the VEM does not use the first one assigned. Instead, you must remove both VMware kernel NICs and then add one back.
- The port profile must be an access port profile. It cannot be a trunk port profile. This procedure includes steps to configure the port profile as an access port profile.
- For more information about creating a Layer 3 control port profile, see the Creating a Port Profile for Layer 3 Control.
SUMMARY STEPS
2. port-profile port_profile_name
6. switchport access vlan vlan_id
DETAILED STEPS
Configuring an ERSPAN Session
Use this procedure to configure an ERSPAN session.

Note If you are configuring Local SPAN, see the Configuring a Local SPAN Session.
BEFORE YOU BEGIN
- You are logged in to the CLI in EXEC mode.
- You know the number of the SPAN session you are going to configure.
- You have already configured an ERSPAN-capable port profile on the VSM using the Configuring an ERSPAN Port Profile.
- Using the VMware documentation for adding a new virtual adapter, you have already configured the required VMKNIC on each of the ESX hosts.
- SPAN sessions are created in the shut state by default.
- When you create a SPAN session that already exists, any additional configuration is added to that session. To make sure the session is cleared of any previous configuration, you can delete the session first (see Step 2, no monitor session).
- This procedure involves creating the SPAN session in ERSPAN Source Configuration mode.
SUMMARY STEPS
2. no monitor session session-number
3. monitor session session-number type erspan-source
5. source {interface type | vlan} {number | range} [ rx | tx | both ]
6. (Optional) Repeat Step 5 to configure additional ERSPAN sources.
7. (Optional) filter vlan {number | range}
8. (Optional) Repeat Step 7 to configure all source VLANs to filter.
10. (Optional) ip ttl ttl_value
11. (Optional) ip prec ipp_value
12. (Optional) ip dscp dscp_value
DETAILED STEPS
|
|
|
---|---|---|
monitor session session-number type erspan-source |
Creates a session with the given session number and places you in the CLI ERSPAN Source Configuration mode. This configuration is saved in the running configuration. |
|
For the specified ERSPAN session, adds a description and saves it in the running configuration. |
||
source { interface type | vlan } n1000v(config-erspan-src)# source interface ethernet 2/1-3, ethernet 3/1 rx n1000v(config-erspan-src)# source interface port-channel 2 n1000v(config-erspan-src)# source interface vethernet 12 both |
For the specified session, configures the source(s) and the direction of traffic to monitor, and saves them in the running configuration.
|
|
(Optional) Repeat Step 5 to configure additional ERSPAN sources. |
||
(Optional) For the specified ERSPAN session, configures the VLANs, VLAN lists, or VLAN ranges to be monitored; and saves this in the running configuration. On the monitor port, only the traffic from the VLANs which match the VLAN filter list are replicated to the destination. |
||
(Optional) Repeat Step 7 to configure all source VLANs to filter. |
||
Configures the IP address of the host to which the encapsulated traffic is sent and saves it in the running configuration. |
||
(Optional) Specifies the IP time-to-live value, from 1-255, for the packets in the ERSPAN traffic, and saves it in the running configuration. |
||
(Optional) Specifies the IP precedence value, from 0-7, for the packets in the ERSPAN traffic, and saves it in the running configuration. |
||
(Optional) Specifies the IP DSCP value, from 0-63. for the packets in the ERSPAN traffic, and saves it in the running configuration. |
||
(Optional) Specifies an MTU size for the ERSPAN traffic, and saves it in the running configuration. |
||
Adds an ERSPAN ID (1-1023) to the session configuration and saves it in the running configuration. The session ERSPAN ID is added to the ERSPAN header of the encapsulated frame and can be used at the termination box to differentiate between various ERSPAN streams of traffic. |
||
|
Enables the ERSPAN session and saves it in the running configuration. |
|
show monitor session session_id |
(Optional) Displays the ERSPAN session configuration as it exists in the running configuration. |
|
(Optional) Exits ERSPAN Source Configuration mode and returns you to CLI Configuration mode. |
||
(Optional) Saves the running configuration persistently through reboots and restarts by copying it to the startup configuration. |
Shutting Down a SPAN Session
Use this procedure to discontinue the copying of packets for a SPAN session. You can discontinue copying packets from one souce and destination; and then resume for another source and destination.
BEFORE YOU BEGIN
Before beginning this procedure, you must know or do the following:
SUMMARY STEPS
From Global Configuration mode:
2. monitor session {session-number | session-range | all } shut
4. copy running-config startup-config
From Monitor Configuration mode:
2. monitor session {session-number | session-range | all } [type erspan-source]
DETAILED STEPS
Resuming a SPAN Session
Use this procedure to resume the copying of packets for a SPAN session. You can discontinue copying packets from one souce and destination; and then resume for another source and destination.
BEFORE YOU BEGIN
Before beginning this procedure, you must know or do the following:
SUMMARY STEPS
From Global Configuration mode:
2. no monitor session {session-number | session-range | all } shut
4. copy running-config startup-config
From Monitor Configuration mode:
2. monitor session {session-number | session-range | all } [type erspan-source]
DETAILED STEPS
Configuring the Allowable ERSPAN Flow IDs
Use this procedure to restrict the allowable range of flow IDs that can be assigned to ERSPAN sessions.
BEFORE YOU BEGIN
Before beginning this procedure, you must know or do the following:
SUMMARY STEPS
2. [no] limit-resource erspan-flow-id minimum min_val maximum max_val
DETAILED STEPS
Verifying the SPAN Configuration
To verify the SPAN configuration, use the following commands:
|
|
---|---|
show monitor session { all | session-number | range session-range } [ brief ] |
|
Displays the Layer 3 capable port profile that is required for ERSPAN. |
Example Configurations
This section includes the following example configurations:
Example Configuration for a SPAN Session
To configure a SPAN session, follow these steps:
Step 1 Configure destination ports in access or trunk mode, and enable SPAN monitoring.
Step 2 Configure a SPAN session.
Example Configuration for an ERSPAN Session
The following example shows how to create a bidirectional ERSPAN session for a source Ethernet interface and destination IP address. Packets arriving at the destination IP are identified by the ID 999 in their header.
Additional References
For additional information related to implementing SPAN, see the following sections:
Related Documents
Standards
|
|
---|---|
No new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature. |
Feature History for SPAN and ERSPAN
This section provides the SPAN and ERSPAN feature release history.
|
|
|
---|---|---|