SPAN & RSPAN — Port Mirroring
Modern switches forward frames only to the destination port — unlike hubs, which flooded every frame to every port. This efficiency is a problem for network analysts: a packet capture tool plugged into a spare switch port sees almost nothing. SPAN (Switched Port Analyser) solves this by instructing the switch to copy frames from one or more source ports to a designated destination port where a sniffer such as Wireshark is connected.
RSPAN (Remote SPAN) extends this capability across multiple switches — mirrored traffic is encapsulated in a dedicated VLAN and forwarded over trunk links to a remote switch where the analyser resides. This allows a single monitoring station to capture traffic from any switch in the campus without physically moving the sniffer.
Before starting this lab, you should be comfortable with VLAN creation and trunk port configuration — RSPAN depends on both. For traffic filtering on the captured stream, see Standard ACL Configuration and Extended ACL Configuration. For logging events triggered by port activity, see Syslog Configuration.
1. SPAN & RSPAN — Core Concepts
How SPAN Works
When a SPAN session is configured, the switch hardware duplicates every frame that ingresses or egresses the specified source ports and delivers a copy to the destination port. The original frame is still forwarded normally — SPAN does not interrupt production traffic. The destination port is placed in a special monitoring state: it does not participate in STP, does not send or receive normal traffic, and forwards only mirrored frames.
Local SPAN — same switch:
[Server: Fa0/1] ──────────────────────────────────────────┐
NetsTuts_SW1
[PC: Fa0/2] ──────────────────────────────────────────────┤
│ Fa0/10 — Destination port
[Laptop running Wireshark]
monitor session 1 source interface Fa0/1 both
monitor session 1 source interface Fa0/2 both
monitor session 1 destination interface Fa0/10
Result: Wireshark on Fa0/10 sees ALL frames to/from Fa0/1 and Fa0/2.
SPAN Terminology
| Term | Definition | Notes |
|---|---|---|
| Source port | The port(s) whose traffic is being copied | Can be access or trunk ports; monitored in one or both directions |
| Destination port | The port where the copy is delivered — connects to the analyser | Exits STP; cannot be a source port in the same session; cannot carry normal traffic |
| Monitor session | A numbered SPAN configuration instance (1–66 on most platforms) | Multiple sessions can coexist — each has independent sources and destinations |
Ingress (rx) |
Mirror only traffic received on the source port | Captures traffic arriving from the connected device |
Egress (tx) |
Mirror only traffic transmitted out the source port | Captures traffic the switch is sending to the connected device |
Both (both) |
Mirror ingress and egress — the default when direction is omitted | Most common choice for full traffic visibility |
| RSPAN VLAN | A special VLAN used exclusively to carry mirrored frames between switches | Must be configured on all switches in the path; no normal hosts allowed |
SPAN vs RSPAN — Key Differences
| Feature | Local SPAN | RSPAN |
|---|---|---|
| Source and destination location | Same switch | Different switches — any hop count apart |
| Transport mechanism | Hardware copy within the switch fabric | Dedicated RSPAN VLAN carried over trunk links |
| VLAN required | No | Yes — one RSPAN VLAN per session |
| Source switch config | monitor session with source + destination |
monitor session with source + destination VLAN (not port) |
| Destination switch config | N/A | monitor session with source VLAN + destination port |
| Trunk requirement | No | Yes — RSPAN VLAN must be allowed on all trunks between source and destination switch |
| STP on RSPAN VLAN | N/A | STP is disabled on the RSPAN VLAN by design |
SPAN Session Limits (Catalyst Platforms)
| Platform | Max SPAN Sessions | Max Source Ports per Session | Max Destination Ports per Session |
|---|---|---|---|
| Catalyst 2960/2960X | 2 | All ports | 1 |
| Catalyst 3560/3750 | 2 local + 66 RSPAN | All ports | 1 per session |
| Catalyst 4500/6500 | Up to 64 | All ports | Multiple (ERSPAN supported) |
2. Lab Topology & Scenario
This lab covers three scenarios: local SPAN on a single switch, RSPAN across two switches over a trunk, and filtering SPAN traffic by direction. All labs use the following topology:
192.168.10.0/24 192.168.10.0/24
[Server: 192.168.10.10] [PC3: 192.168.10.30]
Fa0/1 Fa0/1
| |
NetsTuts_SW1 ─────── Trunk (Gi0/1) ─────── NetsTuts_SW2
| |
Fa0/10 (Destination — local SPAN) Fa0/24 (Destination — RSPAN)
| |
[Wireshark Laptop A] [Wireshark Laptop B]
NetsTuts_SW1 ports:
Fa0/1 — Server (source)
Fa0/2 — PC1: 192.168.10.11 (source)
Fa0/3 — PC2: 192.168.10.12 (source)
Fa0/10 — Wireshark Laptop A (local SPAN destination)
Gi0/1 — Trunk to NetsTuts_SW2
NetsTuts_SW2 ports:
Fa0/1 — PC3 (source — RSPAN scenario)
Fa0/24 — Wireshark Laptop B (RSPAN destination)
Gi0/1 — Trunk to NetsTuts_SW1
Scenario 1: Local SPAN — mirror Fa0/1 and Fa0/2 on SW1 to Fa0/10
Scenario 2: RSPAN — mirror Fa0/1 on SW1 to Fa0/24 on SW2
Scenario 3: Ingress-only SPAN — monitor only inbound traffic on a trunk
3. Step 1 — Local SPAN Configuration
Local SPAN mirrors traffic from source ports to a destination port on the same switch. This is the most common SPAN use case — a Wireshark laptop is plugged into a spare port and configured as the SPAN destination:
NetsTuts_SW1>en NetsTuts_SW1#conf t Enter configuration commands, one per line. End with CNTL/Z. ! ── Session 1: Mirror Server (Fa0/1) and PC1 (Fa0/2) to Fa0/10 ── NetsTuts_SW1(config)#monitor session 1 source interface Fa0/1 both NetsTuts_SW1(config)#monitor session 1 source interface Fa0/2 both NetsTuts_SW1(config)#monitor session 1 destination interface Fa0/10 NetsTuts_SW1(config)#end NetsTuts_SW1#wr Building configuration... [OK] NetsTuts_SW1#
both mirrors ingress (received) and egress
(transmitted) frames on each source port. The destination port
Fa0/10 automatically exits STP and stops carrying normal VLAN traffic
— it becomes a pure mirror output. Any device connected to Fa0/10
that sends frames back into the switch will have those frames ignored
by default (ingress is disabled on SPAN destination ports).
Mirror a Single Direction
! ── Mirror only traffic RECEIVED on Fa0/1 (rx = ingress) ─ NetsTuts_SW1(config)#monitor session 1 source interface Fa0/1 rx ! ── Mirror only traffic SENT to Fa0/1 (tx = egress) ────── NetsTuts_SW1(config)#monitor session 1 source interface Fa0/1 tx
rx to capture only what a client is sending
to the network, or tx to capture only what the switch
is delivering to the client. This is useful when the destination
port's NIC cannot keep up with full bidirectional capture on a
high-speed source.
Mirror an Entire VLAN
! ── Mirror all ports in VLAN 10 on SW1 to Fa0/10 ───────── NetsTuts_SW1(config)#monitor session 2 source vlan 10 both NetsTuts_SW1(config)#monitor session 2 destination interface Fa0/10
source vlan instead of source interface
mirrors all ports currently assigned to VLAN 10 — you do not need to
list each port individually. This also automatically includes any
new ports added to VLAN 10 in the future. Session 2 is used here
because session 1 is already configured above — a destination port
can only be used by one session at a time, but this example reuses
Fa0/10 for demonstration.
Enable Ingress on the Destination Port
! ── Allow the analyser PC to also send traffic (e.g. send ARP, replies) NetsTuts_SW1(config)#monitor session 1 destination interface Fa0/10 ingress vlan 10
ingress vlan [id]
allows the analyser machine to also send traffic back into the switch
in the specified VLAN. This is needed when the analyst wants to
respond to packets (e.g. send a TCP RST) or when the monitoring host
needs network access itself. Use with care — enabling ingress blurs
the boundary between capture-only and active participation.
4. Step 2 — RSPAN Configuration (Remote SPAN)
RSPAN extends mirroring across switches. Configuration requires three parts: creating the RSPAN VLAN on every switch in the path, configuring the source switch to send mirrored traffic into that VLAN, and configuring the destination switch to pull mirrored traffic from the VLAN and deliver it to the local analyser port:
Step 2a — Create the RSPAN VLAN on Both Switches
! ── On BOTH NetsTuts_SW1 and NetsTuts_SW2 ──────────────── SW(config)#vlan 999 SW(config-vlan)#name RSPAN-MIRROR SW(config-vlan)#remote-span SW(config-vlan)#exit
remote-span command marks VLAN 999 as an RSPAN VLAN.
This has two effects: STP is automatically disabled for this VLAN
(mirrored frames should not loop), and the VLAN is prevented from
being assigned to access ports. VLAN 999 must be created and marked
remote-span on every switch the RSPAN traffic traverses,
including intermediate switches. Ensure VLAN 999 is allowed on the
trunk between SW1 and SW2 — check with
trunk port configuration.
Step 2b — Configure the Source Switch (SW1)
! ── On NetsTuts_SW1 — mirror Fa0/1 into RSPAN VLAN 999 ── NetsTuts_SW1(config)#monitor session 1 source interface Fa0/1 both NetsTuts_SW1(config)#monitor session 1 destination remote vlan 999 NetsTuts_SW1(config)#end NetsTuts_SW1#wr
destination remote vlan 999). The switch
encapsulates the mirrored copies in VLAN 999 and floods them out
the trunk toward SW2. No analyser is connected to SW1 in this scenario —
the mirrored traffic travels entirely over the trunk to reach SW2.
Step 2c — Configure the Destination Switch (SW2)
! ── On NetsTuts_SW2 — pull from RSPAN VLAN 999 to Fa0/24 ─ NetsTuts_SW2(config)#monitor session 1 source remote vlan 999 NetsTuts_SW2(config)#monitor session 1 destination interface Fa0/24 NetsTuts_SW2(config)#end NetsTuts_SW2#wr
source remote vlan 999) and the destination is the
local port where Wireshark Laptop B is connected. SW2 extracts
mirrored frames from VLAN 999 arriving on the trunk and delivers
them to Fa0/24. The Wireshark laptop sees all traffic that was
mirrored from Fa0/1 on SW1.
RSPAN — Trunk VLAN Verification
! ── Verify VLAN 999 is allowed on the trunk ────────────── NetsTuts_SW1#show interfaces Gi0/1 trunk Port Mode Encapsulation Status Native vlan Gi0/1 on 802.1q trunking 1 Port Vlans allowed on trunk Gi0/1 1-4094 Port Vlans allowed and active in management domain Gi0/1 1,10,20,999 Port Vlans in spanning tree forwarding state and not pruned Gi0/1 1,10,20
switchport trunk allowed vlan add 999
on both ends of the trunk link.
5. Step 3 — Multiple Sources and Filtering
Multiple Source Ports in One Session
! ── Mirror a range of ports ────────────────────────────── NetsTuts_SW1(config)#monitor session 1 source interface Fa0/1 - 5 both ! ── Add individual ports to an existing session ────────── NetsTuts_SW1(config)#monitor session 1 source interface Fa0/8 rx NetsTuts_SW1(config)#monitor session 1 source interface Gi0/2 tx
monitor session [n] source
commands accumulate — each adds to the session rather than replacing
the previous source. Each source can have its own direction:
Fa0/8 is monitored for received traffic only while Gi0/2 is monitored
for transmitted traffic only, all within session 1.
Remove a Source or Clear a Session
! ── Remove Fa0/2 from session 1 ────────────────────────── NetsTuts_SW1(config)#no monitor session 1 source interface Fa0/2 ! ── Remove the entire session ──────────────────────────── NetsTuts_SW1(config)#no monitor session 1 ! ── Remove all SPAN sessions ───────────────────────────── NetsTuts_SW1(config)#no monitor session all
Filter SPAN Traffic by VLAN (on Trunk Source)
! ── Mirror only VLAN 10 traffic from a trunk source port ─ NetsTuts_SW1(config)#monitor session 1 source interface Gi0/1 both NetsTuts_SW1(config)#monitor session 1 filter vlan 10 NetsTuts_SW1(config)#monitor session 1 destination interface Fa0/10
filter vlan [id] restricts the
mirrored copy to only the specified VLAN — the destination port
receives a subset of the trunk traffic. This is useful for isolating
one tenant's traffic on a shared trunk without capturing everything.
The filter is applied per session and does not affect the trunk itself.
6. Verification
show monitor session 1
NetsTuts_SW1#show monitor session 1
Session 1
---------
Type : Local Session
Source Ports :
Both : Fa0/1,Fa0/2
Destination Ports : Fa0/10
Encapsulation : Native
Ingress : Disabled
show monitor session 1 — RSPAN Output (SW1)
NetsTuts_SW1#show monitor session 1
Session 1
---------
Type : Remote Source Session
Source Ports :
Both : Fa0/1
Dest RSPAN VLAN : 999
show monitor session 1 — RSPAN Output (SW2)
NetsTuts_SW2#show monitor session 1
Session 1
---------
Type : Remote Destination Session
Source RSPAN VLAN : 999
Destination Ports : Fa0/24
Encapsulation : Native
Ingress : Disabled
show monitor — All Sessions
NetsTuts_SW1#show monitor
Session 1
---------
Type : Local Session
Source Ports :
Both : Fa0/1,Fa0/2
Destination Ports : Fa0/10
Encapsulation : Native
Ingress : Disabled
Session 2
---------
Type : Local Session
Source Ports :
RX Only : Fa0/3
Destination Ports : Fa0/10
Encapsulation : Native
Ingress : Disabled
Verification Command Summary
| Command | What It Shows | Primary Use |
|---|---|---|
show monitor |
All active SPAN and RSPAN sessions — sources, destinations, direction, type | Full audit of all mirroring sessions on the switch |
show monitor session [n] |
Details of one session — source ports, destination, encapsulation, ingress state | Verify a specific session is configured correctly |
show vlan id 999 |
RSPAN VLAN status — confirms "remote-span" flag is set | Verify RSPAN VLAN is correctly marked on both switches |
show interfaces [int] trunk |
VLANs allowed and active on trunk — confirm RSPAN VLAN is present | Verify RSPAN VLAN is carried across the trunk between source and destination switches |
show running-config | section monitor |
All monitor session commands in the running config | Full configuration audit — confirm session commands were saved |
show vlan brief |
VLAN database — all VLANs with ports assigned | Confirm RSPAN VLAN exists and no access ports are assigned to it |
7. Troubleshooting SPAN & RSPAN Issues
| Problem | Symptom | Cause | Fix |
|---|---|---|---|
| Wireshark sees no traffic | SPAN session is configured but the analyser captures nothing | NIC is not in promiscuous mode; destination port is also configured as a source; wrong session number; session not saved | Enable promiscuous mode in Wireshark. Verify with show monitor session [n] — confirm source and destination are correct. Check show running-config | section monitor and save with wr |
| SPAN destination port loses connectivity | A device connected to the SPAN destination port cannot send or receive normal traffic | Expected behaviour — SPAN destination ports exit STP and stop forwarding normal frames. They only forward mirrored copies | Move production devices off the destination port. If the analyser also needs network access, enable ingress: monitor session [n] destination interface [port] ingress vlan [id] |
| RSPAN — no traffic at destination switch | Wireshark on SW2 Fa0/24 sees nothing — session is configured correctly on both switches | RSPAN VLAN not allowed on trunk; RSPAN VLAN not marked remote-span on one switch; VLAN not active on both switches |
Run show interfaces Gi0/1 trunk on both switches — confirm VLAN 999 is in "allowed and active." Run show vlan id 999 — confirm "remote-span" flag. Add VLAN to trunk: switchport trunk allowed vlan add 999 |
| Cannot configure second SPAN session | Error when adding a second monitor session — IOS rejects the command |
Platform limit reached — Catalyst 2960 supports only 2 local SPAN sessions simultaneously | Remove an existing session with no monitor session [n] before creating a new one. Check platform datasheet for session limits |
| Mirrored traffic is missing VLAN tags | Wireshark shows untagged frames — expected 802.1Q tags are missing | Default SPAN encapsulation strips 802.1Q tags — "Native" encapsulation removes tags from mirrored copies | Use monitor session [n] destination interface [port] encapsulation replicate to preserve original 802.1Q tags in the mirrored copy. Useful when mirroring trunk ports and needing VLAN information in the capture |
| RSPAN VLAN assigned to access port | IOS rejects switchport access vlan 999 with an error |
Correct behaviour — RSPAN VLANs cannot be assigned to access ports. The remote-span flag prevents this |
Use a different VLAN for access ports. Reserve the RSPAN VLAN exclusively for mirrored traffic — no normal hosts should ever connect to it |
Key Points & Exam Tips
- SPAN mirrors traffic from source ports to a destination port on the same switch. The destination port exits STP and stops carrying normal traffic — connect only an analyser (e.g. Wireshark).
- Direction keywords:
rx(ingress/received),tx(egress/transmitted),both(default — all traffic). Use direction filtering to reduce capture volume on high-speed links. - RSPAN extends mirroring across switches using a dedicated RSPAN VLAN (
remote-spanflag). The VLAN must be created and marked on every switch in the path, and must be allowed on all trunk links between them. - On the source switch, the RSPAN destination is a VLAN:
destination remote vlan [id]. On the destination switch, the RSPAN source is the same VLAN:source remote vlan [id]. - STP is automatically disabled on RSPAN VLANs — this is by design and correct. It will not appear in the STP forwarding state output.
- By default, SPAN destination ports have ingress disabled — the analyser cannot send frames into the switch. Add
ingress vlan [id]to the destination command if the monitoring host needs network access. - Use
encapsulation replicateon the destination to preserve 802.1Q tags in the mirrored copy — needed when the source is a trunk port and VLAN information must be visible in the capture. - Use
filter vlan [id]to restrict mirroring on a trunk source port to only the specified VLAN — reduces capture volume and isolates one VLAN's traffic. show monitor session [n]is the primary verification command — check type (local vs remote), source ports, destination, and ingress state.- On the CCNA exam: know the difference between local SPAN and RSPAN, RSPAN VLAN requirements (
remote-spanon all switches, allowed on all trunks, no access ports), and themonitor sessioncommand syntax for source and destination.