4.3 Configure SPAN/RSPAN/ERSPAN
Aligned to Cisco's 350-401 ENCOR v1.2 exam topics.
On this page
What this objective tests
Sometimes counters and logs are not enough. You need to see the packets. Switched Port Analyzer (SPAN) copies traffic from a source to an analyzer. The exam tests the three variants and the basic configuration of each.
| Feature | Use it when | How mirrored traffic moves |
|---|---|---|
| SPAN | Source and analyzer are on the same switch. | Local copy to a destination port. |
| RSPAN | Source and analyzer are on different switches in the same Layer 2 domain. | A dedicated remote-span VLAN. |
| ERSPAN | Source and analyzer are separated by Layer 3. | GRE-encapsulated traffic over IP. |
Local SPAN
Source interface Gi1/0/1 carries user traffic. The analyzer connects to Gi1/0/48 on the same switch:
conf t
monitor session 1 source interface GigabitEthernet1/0/1 both
monitor session 1 destination interface GigabitEthernet1/0/48 encapsulation replicate
endbothmirrors received and transmitted traffic. Userxortxfor one direction.encapsulation replicatekeeps the original VLAN tag on the mirrored copy.
Note: A destination SPAN port stops normal switching. Do not connect an end user to it.
RSPAN with a dedicated VLAN
Remote SPAN (RSPAN) carries mirrored frames across a special VLAN. The source switch puts copies into the remote-span VLAN. Trunks carry it. The destination switch sends it to the analyzer.
Source switch SW1:
conf t
vlan 999
name RSPAN-CAPTURE
remote-span
!
monitor session 2 source interface GigabitEthernet1/0/1 both
monitor session 2 destination remote vlan 999
endTrunk between the switches:
interface GigabitEthernet1/0/24
switchport mode trunk
switchport trunk allowed vlan add 999Destination switch SW2:
conf t
vlan 999
name RSPAN-CAPTURE
remote-span
!
monitor session 2 source remote vlan 999
monitor session 2 destination interface GigabitEthernet1/0/48
endNote: The RSPAN VLAN is a transport for copied frames. Do not use it for user traffic. Do not put access ports in it. It must exist as a remote-span VLAN on each switch in the path and be allowed on the trunks. Spanning tree keeps it loop-free, but the switches flood the copied frames across the whole VLAN.
Verify the transport on both switches:
show vlan remote-span
show interfaces trunkERSPAN configuration: source and destination
Encapsulated Remote SPAN (ERSPAN) wraps mirrored traffic in GRE and sends it over a routed network. A complete ERSPAN configuration has two halves: a source session on the switch near the traffic and a destination session on the device near the analyzer. Define a source session with a destination IP and an origin IP.
ERSPAN source on SW1:
conf t
monitor session 3 type erspan-source
source interface GigabitEthernet1/0/1 both
destination
erspan-id 30
ip address 10.20.20.20
origin ip address 10.20.20.10
endERSPAN destination on the remote device:
conf t
monitor session 3 type erspan-destination
destination interface GigabitEthernet1/0/48
source
erspan-id 30
ip address 10.20.20.10
endip address 10.20.20.20on the source is the tunnel destination IP: the analyzer-side device.origin ip address 10.20.20.10is the tunnel source IP on SW1.- The ERSPAN ID must match on both ends.
ERSPAN needs routed reachability between the two IPs. Check routing, ACLs on GRE, and MTU overhead before you blame the session.
Verify with show monitor session all
show monitor session allExpected output for the three sessions above:
Session 1
---------
Type : Local Session
Source Ports :
Both : Gi1/0/1
Destination Ports : Gi1/0/48
Encapsulation : Replicate
Session 2
---------
Type : Remote Source Session
Source Ports :
Both : Gi1/0/1
Dest RSPAN VLAN : 999
Session 3
---------
Type : ERSPAN Source Session
Source Ports :
Both : Gi1/0/1
Destination IP Address : 10.20.20.20
Origin IP Address : 10.20.20.10
ERSPAN ID : 30A configured session proves only that the switch tries to copy traffic. If the destination port or analyzer cannot keep up, the capture drops packets while production traffic continues.
Lab: build all three mirror types
Topology:
PC1 -- Gi1/0/1 [SW1] Gi1/0/24 ==== Gi1/0/24 [SW2] Gi1/0/48 -- Analyzer (VLAN 999 path)
PC1 -- [SW1] -- routed network -- [SW3] Gi1/0/48 -- Analyzer (ERSPAN path)
origin 10.20.20.10 tunnel dest 10.20.20.20Goal: mirror PC1 traffic three ways and verify each session.
Do these steps:
- On SW1, configure local SPAN session 1: source Gi1/0/1 both, destination Gi1/0/48 with encapsulation replicate.
- Verify with
show monitor session 1. Generate traffic from PC1 and confirm the local analyzer sees it. - On SW1 and SW2, create VLAN 999 and set
remote-span. - Allow VLAN 999 on the trunk between SW1 and SW2.
- On SW1, configure session 2: source Gi1/0/1 both, destination remote vlan 999.
- On SW2, configure session 2: source remote vlan 999, destination Gi1/0/48.
- Verify with
show vlan remote-spanandshow monitor session 2. Confirm the analyzer on SW2 sees PC1 packets. - On SW1, configure ERSPAN session 3: type erspan-source, source Gi1/0/1 both, erspan-id 30, destination ip 10.20.20.20, origin ip 10.20.20.10.
- Verify routing with
show ip route 10.20.20.20, thenshow monitor session 3. - Run
show monitor session alland confirm all three sessions match the expected output above.
Expected result: session 1 is Local, session 2 is Remote Source with VLAN 999, session 3 is ERSPAN Source with the correct IPs. Each analyzer receives the mirrored PC1 traffic.
Exam traps
- Mirror two 1 Gbps directions into one 1 Gbps analyzer port and the capture drops packets. SPAN is a copy, not extra bandwidth.
- Mirroring only
rxmisses return traffic. Usebothunless you know the direction you need. - RSPAN can be correct on both switches and still fail if VLAN 999 is not allowed on the trunk path.
- The RSPAN VLAN is capture transport only. User ports in VLAN 999 break the design.
- ERSPAN needs routed reachability between origin and destination IPs. Check routing before the session config.
- Syntax varies by platform. Local SPAN and RSPAN use plain
monitor sessioncommands. ERSPAN usesmonitor session ... type erspan-source.
Pass check
You are ready when you can do these things:
- Pick SPAN, RSPAN, or ERSPAN from a topology description.
- Configure all three session types with concrete interfaces, VLANs, and IPs.
- Read
show monitor session alland name the type and state of each session. - Explain why the RSPAN VLAN must stay free of user traffic.
Related objectives
- 4.1 Diagnose network problems using such as debugs, conditional debugs, traceroute, ping, SNMP, and syslog
- 4.2 Configure and verify Flexible NetFlow
- 4.4 Configure and verify IPSLA
- 4.5 Describe how Cisco Catalyst Center (formerly Cisco DNA Center) is used to apply network configuration, monitoring, and management using traditional and AI-powered workflows