Configure ERSPAN Example
Network Requirements
- PC1 and PC2 are connected with Device1 and communicate with each other in VLAN2.
- PC3 communicates with Device via IP Network.
- Configure ERSPAN on Device; the source IP address is 192.168.1.1/24; the destination IP address is 192.168.1.100/24; PC3 monitors the packets received and sent by port gigabitethernet0/1 of Device.
Network Topology
Figure 5-3 Networking of configuring the ERSPAN
Configuration Steps
Step 1: Configure VLAN, port link type and interface address.
#Create VLAN2 and VLAN3 on Device.
Device#configure terminal
Device(config)#vlan 2-3
|
#Configure the link type of port gigabitethernet0/1 and gigabitethernet0/2 on Device as Access, permitting the services of VLAN2 to pass.
Device(config)#interface gigabitethernet 0/1-0/2
Device(config-if-range)#switchport mode access
Device(config-if-range)#switchport access vlan 2
Device(config-if-range)#exit
|
#Configure the link type of port gigabitethernet0/3 on Device as Access, permitting the services of VLAN3 to pass.
Device(config)#interface gigabitethernet 0/3
Device(config-if-gigabitethernet0/3)#switchport mode access
Device(config-if-gigabitethernet0/3)#switchport access vlan 3
Device(config-if-gigabitethernet0/3)#exit
|
#Configure the interface IP address on Device.
Device(config)#interface vlan 3
Device(config-if-vlan3)#ip address 192.168.1.1 255.255.255.0
Device(config-if-vlan3)#exit
|
Step 2: Configure ERSPAN on Device.
#Configure ERSPAN on Device, the mirror source session port is gigabitethernet0/1, the source IP address of the destination session is 192.168.1.1, and the destination IP address is 192.168.1.100.
Device(config)#monitor session 1 source interface gigabitethernet 0/1 both
Device(config)#monitor session 1 destination type erspan-source source-ip 192.168.1.1 destination-ip 192.168.1.100 vlan 3
|
#View the ERSPAN session information on Device.
Device#show monitor session all
Session 1
Type : ERSPAN Source Session
Destination Interface : gigabitethernet0/3
Source IP Address: 192.168.1.1
Destination IP Address: 192.168.1.100
Source Mac Address: 0001.7a54.5c94
Next Hop Mac Address: 0000.1100.0001
Erspan L2 Vlan:3
Source Interface(both): gi0/1
Step 3: Check the result.
#When PC1 and PC2 communicate with each other, the packets sent and received by port gigabitethernet0/1 can be got on PC3.