Encapsulated Remote SPAN (ERSPAN) is the most advanced form of traffic mirroring that you need to understand for the CCNP ENCOR exam.
With Local SPAN, everything happens on a single switch.
With RSPAN, traffic can travel across switches using a dedicated VLAN.
Figure 1 - ERSPAN Topology
But what if the traffic collector is located in a different IP network?
This is where ERSPAN becomes useful.Why ERSPAN Is Needed
ERSPAN allows you to capture traffic on one device and send it to a traffic collector located in another network.
This situation is common in large enterprise environments where:
The source traffic is in a remote site
The traffic collector is centralized in a data center
Layer 2 connectivity is not available between the two

Figure 2 – ERSPAN traffic overview
Unlike RSPAN, ERSPAN does not rely on a VLAN.
Instead, it uses Layer 3 routing.Answer the question below
At which layer does ERSPAN operate?
How ERSPAN Works
To make this possible, the source switch encapsulates the mirrored traffic inside a GRE tunnel.
The original Layer 2 frame is wrapped inside:
A GRE header
An outer IP header
This allows the mirrored traffic to be routed across Layer 3 networks.

Figure 3 – ERSPAN GRE encapsulation
Once encapsulated, the GRE packet is forwarded through the IP network like any other routed packet.
As long as IP connectivity exists between the source and the destination, ERSPAN traffic can reach the traffic collector.
Figure 4 – ERSPAN GRE transport
Answer the question below
Which protocol encapsulates ERSPAN traffic?
To configure ERSPAN, you must complete two major parts:
Configure the ERSPAN source (SW1)
Configure the ERSPAN destination (SW2)
Before creating the ERSPAN session, you must define an origin IP address.

Figure 5 - ERSPAN Topology Configuration
Step 1 – Configure the ERSPAN Origin IP (SW1)
Before creating the ERSPAN session, you must configure an origin IP address.
This IP address will be used as the source IP address of the GRE tunnel that transports the mirrored traffic.
The best practice is to use a Loopback interface, because it remains up as long as the device is operational.SW1# conf t Enter configuration commands, one per line. End with CNTL/Z. SW1(config)# int lo1 *Feb 9 09:43:06.008: %LINK-3-UPDOWN: Interface Loopback1, changed state to up *Feb 9 09:43:07.007: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up SW1(config-if)# ip address 10.1.1.1 255.255.255.0 SW1(config-if)# exitAt this point, SW1 has a stable IP address that will be used as the GRE tunnel source.
Step 2 – Create the ERSPAN Source Session (SW1)
Now create the ERSPAN source session on SW1.
SW1(config)# monitor session 1 type erspan-source SW1(config-mon-erspan-src)# source interface g0/0Here you are telling the switch:
Create ERSPAN session 1
Mirror traffic from interface G0/0
In this example, you are capturing all traffic from GigabitEthernet0/0.
Step 3 – Configure ERSPAN Destination Parameters (SW1)
Now you must define where the mirrored traffic will be sent.
Enter destination configuration mode:SW1(config-mon-erspan-src)# destination SW1(config-mon-erspan-src-dst)# ip address 10.2.2.100 SW1(config-mon-erspan-src-dst)# erspan-id 10 SW1(config-mon-erspan-src-dst)# origin ip address 10.1.1.1 SW1(config-mon-erspan-src-dst)# exitHere you are configuring:
The destination IP address (the device that will receive the GRE traffic)
The ERSPAN ID, which uniquely identifies the session
The origin IP address, used as the source IP of the GRE tunnel
âš The ERSPAN ID must match on both switches.
Step 4 – Enable the ERSPAN Source Session (SW1)
By default, the ERSPAN session is administratively down.
You must enable it manually:SW1(config-mon-erspan-src)# no shutdown SW1(config-mon-erspan-src)# endFrom this point forward, SW1 captures traffic on G0/0 and sends it encapsulated in GRE toward SW2.
Step 5 – Create the ERSPAN Destination Session (SW2)
Now move to the destination switch (SW2).
Create the ERSPAN destination session:SW2(config)# monitor session 1 type erspan-destination SW2(config-mon-erspan-dst)# destination interface g0/2Here you define the interface where the decapsulated traffic will be forwarded (toward the traffic collector).
Step 6 – Define ERSPAN Source Parameters (SW2)
Now you must tell SW2 where the ERSPAN traffic is coming from.
SW2(config-mon-erspan-dst)# source SW2(config-mon-erspan-dst-src)# ip address 10.2.2.100 SW2(config-mon-erspan-dst-src)# erspan-id 10 SW2(config-mon-erspan-dst-src)# exitHere you configure:
The IP address on which SW2 receives ERSPAN traffic
The ERSPAN ID (must match SW1)
If the ERSPAN ID does not match, the traffic will be discarded.
Step 7 – Enable the ERSPAN Destination Session (SW2)
Finally, enable the destination session:
SW2(config-mon-erspan-dst)# no shutdown SW2(config-mon-erspan-dst)# endAt this stage, your ERSPAN configuration is fully operational.
Traffic captured on SW1 is:
Mirrored
Encapsulated in GRE
Routed across the IP network
Decapsulated on SW2
Forwarded to the traffic collector
Answer the question below
Which interface type is recommended for the ERSPAN origin IP?
Answer the question below
Collector 10.60.60.60 sits behind SW4 (source ip 10.50.50.5): which outer destination IP does SW3 use?
Once the configuration is complete, you should always verify that the ERSPAN session is active on both switches.
Because ERSPAN involves a source and a destination device, you must check both sides.Verify the ERSPAN Source Session (SW1)
Start by verifying the ERSPAN source session on SW1:
SW1# show monitor session erspan-source session Type : ERSPAN Source Session Status : Admin Enabled Source Ports : Both : Gi0/0 Destination IP Address : 10.2.2.100 Destination ERSPAN ID : 10 Origin IP Address : 10.1.1.1 IPv6 Flow Label : NoneLet’s analyze what you should check:
Type : ERSPAN Source Session
This confirms that the session is configured as an ERSPAN source.Status : Admin Enabled
This means the session is active. If it is disabled, no traffic will be sent.Source Ports : Gi0/0
This confirms that traffic from interface G0/0 is being mirrored.Destination IP Address : 10.2.2.100
This is the IP address where the GRE-encapsulated traffic is sent.Destination ERSPAN ID : 10
This must match the ERSPAN ID configured on the destination switch.Origin IP Address : 10.1.1.1
This is the source IP address of the GRE tunnel.
If all these values are correct, SW1 is properly configured as the ERSPAN source.
Verify the ERSPAN Destination Session (SW2)
Now move to SW2 and verify the destination session:
SW2# show monitor session erspan-destination session Type : ERSPAN Destination Session Status : Admin Enabled Destination Ports : Gi0/2 Source IP Address : 10.2.2.100 Source ERSPAN ID : 10Here is what you should confirm:
Type : ERSPAN Destination Session
This confirms that SW2 is acting as the ERSPAN destination.Status : Admin Enabled
The session is active.Destination Ports : Gi0/2
This is the interface where the decapsulated traffic is forwarded (toward the traffic collector).Source ERSPAN ID : 10
This must match the ERSPAN ID configured on SW1.
If the ERSPAN ID does not match, the traffic will be discarded.
What You Should Always Verify
When checking ERSPAN, make sure:
The session is Admin Enabled on both switches
The ERSPAN ID matches on both sides
The destination IP address is reachable
IP connectivity exists between the two devices
If one of these conditions is not met, the mirrored traffic will not reach the traffic collector.
Answer the question below
What must match on both switches for ERSPAN to work?