ERSPAN Source Switch Configuration Commands
Use these commands to configure the switch as an Encapsulated Remote Port Analyzer (ERSPAN) source switch.
The Encapsulated Remote Port Analyzer (ERSPAN) feature allows port-mirroring collection points to be located anywhere across a routed network. This is achieved by encapsulating L2 mirrored packets using generic routing encapsulation (GRE) with IP delivery. After a packet is encapsulated, it can be forwarded throughout the L3-routed network.
ERSPAN uses a GRE tunnel to carry traffic between switches. ERSPAN consists of an ERSPAN source session, an ERSPAN destination session, and routable ERSPAN GRE-encapsulated traffic. All participating switches must be connected at Layer 3, and the network path must support the size of the ERSPAN traffic for the egress mirroring session.
To configure the source ERSPAN session, specify the following parameters at the source switch:
- Source ports (that is, the traffic on the source port is mirrored)
- ERSPAN destination IPv4 address
- ERSPAN origin IPv4 address
- ERSPAN session ID
- Egress (Tx) or ingress (Rx) traffic flow
monitor session type erspan-source
M4250
M4350
This command specifies an ERSPAN source session ID, and the CLI enters ERSPAN Source Session Config mode. The session-id can be from 1 to 4.
| Format | monitor session session-id type erspan-source |
| Mode | Global Config |
no monitor session type erspan-source
This command removes an ERSPAN source session ID. The session-id can be from 1 to 4.
| Format | no monitor session session-id type erspan-source |
| Mode | Global Config |
source interface (ERSPAN Source Session Config)
M4250
M4350
This command adds a source interface for an ERSPAN mirroring session. To specify an actual interface or port, do the following:
- For an M4250 series switch, use the argument slot/port.
- For an M4350 series switch, use the argument unit/slot/port, as shown in the command description and format.
Use the source interface {unit/slot/port | cpu | lag lag-group-id | vlan vlan-id} parameters to specify the interface to monitor.
Use rx to monitor only ingress packets or use tx to monitor only egress packets. If you do not specify an rx or tx option, the destination port monitors both ingress and egress packets.
| Format | source {interface {unit/slot/port | cpu | lag lag-group-id} | vlan vlan-id} [rx | tx] |
| Mode | ERSPAN Source Session Config mode |
no source interface (ERSPAN Source Session Config)
This command removes a source interface for an ERSPAN mirroring session.
| Format | no source {interface {unit/slot/port | cpu | lag lag-group-id} | vlan} |
| Mode | ERSPAN Source Session Config mode |
destination (ERSPAN Source Session Config)
M4250
M4350
From the ERSPAN Source Session Config mode, this command lets the CLI enter ERSPAN Source Session Destination Config mode.
From this mode, you can specify the ERSPAN monitoring ID, IP settings, and origin settings for the ERSPAN destination.
| Format | destination |
| Mode | ERSPAN Source Session Config |
no destination (ERSPAN Source Session Config)
This command removes an ERSPAN source session destination configuration.
| Format | no destination |
| Mode | ERSPAN Source Session Config |
ip address (ERSPAN Source Session Destination Config)
M4250
M4350
This command adds the destination IP address to an ERSPAN session. The IP address is the address of the monitoring station on which the GRE traffic is recorded or decoded.
| Format | ip address ip-address |
| Mode | ERSPAN Source Session Destination Config |
no ip address (ERSPAN Source Session Destination Config)
This command removes the destination IP address from an ERSPAN session.
| Format | no ip address |
| Mode | ERSPAN Source Session Destination Config |
erspan-id (ERSPAN Source Session Destination Config)
M4250
M4350
This command adds the flow ID number that is used by the source and destination sessions to identify the ERSPAN traffic. The ID number is from 1 to 1023.
| Format | erspan-id erspan-id |
| Mode | ERSPAN Source Session Destination Config |
no erspan-id (ERSPAN Source Session Destination Config)
This command removes the flow ID number that is used by the source and destination sessions to identify the ERSPAN traffic.
| Format | no erspan-id |
| Mode | ERSPAN Source Session Destination Config |
origin ip-address (ERSPAN Source Session Destination Config)
M4250
M4350
This command adds the IP address that is used as the source of the ERSPAN traffic.
| Format | origin ip-address ip-address |
| Mode | ERSPAN Source Session Destination Config |
no origin ip-address (ERSPAN Source Session Destination Config)
This command removes the IP address that is used as the source of the ERSPAN traffic.
| Format | no origin ip-address |
| Mode | ERSPAN Source Session Destination Config |
ip ttl (ERSPAN Source Session Destination Config)
M4250
M4350
This command configures the IP time-to-live (TTL) value for the packets in the ERSPAN traffic. The range for the ttl-value argument is from 1 to 255.
| Default | 64 |
| Format | ip ttl ttl-value |
| Mode | ERSPAN Source Session Destination Config |
no ip ttl (ERSPAN Source Session Destination Config)
This command removes the TTL value for the packets in the ERSPAN traffic.
| Format | no ip ttl |
| Mode | ERSPAN Source Session Destination Config |
ip dscp (ERSPAN Source Session Destination Config)
M4250
M4350
This command configures the IP DSCP value for the packets in the ERSPAN traffic. The range for the dscp-value argument is from 0 to 63.
| Format | ip dscp dscp-value |
| Mode | ERSPAN Source Session Destination Config |
no ip dscp (ERSPAN Source Session Destination Config)
This command removes the IP DSCP value for the packets in the ERSPAN traffic.
| Format | no ip dscp |
| Mode | ERSPAN Source Session Destination Config |
ip prec (ERSPAN Source Session Destination Config)
M4250
M4350
This command configures the IP precedence value for the packets in the ERSPAN traffic. The range for the precedence-value argument is from 0 to 7.
| Default | 0 |
| Format | ip prec precedence-value |
| Mode | ERSPAN Source Session Destination Config |
no ip prec (ERSPAN Source Session Destination Config)
This command removes the IP DSCP value for the packets in the ERSPAN traffic.
| Format | no ip prec |
| Mode | ERSPAN Source Session Destination Config |