Understanding SPAN and RSPAN Configurations
Understanding SPAN and RSPAN Configurations
Key restrictions of SPAN and RSPAN include: source interfaces can be of any type, but mixing interfaces and VLANs in a single session is not allowed; configuring a trunk as a source will duplicate traffic from all VLANs unless filtered; destination ports lose their configuration and are dedicated to forwarding received SPAN traffic; interfaces can become overloaded if the source is an entire VLAN and the destination link's bandwidth is insufficient. Also, specific Layer 2 frames such as CDP, VTP, and spanning-tree BPDUs are not copied by default but can be configured to do so .
Ensuring that trunks between switches allow the RSPAN VLAN is crucial because RSPAN uses a specific VLAN to transport mirrored traffic from the source to the destination switch. If the trunk ports do not permit the RSPAN VLAN, then the mirrored traffic cannot traverse between the switches, which would cause failure in traffic monitoring. This setup is essential to maintain the continuity of the RSPAN session across multiple switches .
Once a destination port is assigned for SPAN or RSPAN traffic, it loses its previous configuration and is dedicated solely to receiving mirrored traffic. By default, the port will not accept any incoming traffic, but this can be adjusted if needed. Care should be taken because dedicating a port for SPAN/RSPAN can inadvertently disrupt network operations if the port was previously in use. Additionally, the bandwidth and performance of the destination port should be considered to ensure it can handle the mirrored traffic load .
Filter criteria can be applied to SPAN sessions when configuring by VLAN by specifying the VLAN IDs that you wish to monitor. This is accomplished by using a filter command with a specified range of VLANs. For example, to monitor only the traffic from VLANs 1 to 100, the command is: Switch(config)#monitor session 1 filter vlan 1 - 100. This setup helps prevent unnecessary traffic from being mirrored and enhances the focus on the VLANs of interest .
SPAN and RSPAN can be employed for several practical applications in a networked environment. They can be used for network traffic analysis by directing copied traffic to a monitoring tool like Wireshark. They help redirect traffic to an Intrusion Detection System (IDS) or Intrusion Prevention System (IPS) for security analysis. Additionally, SPAN and RSPAN are useful in monitoring and recording VoIP calls by copying call data from a VLAN. These capabilities assist in network troubleshooting, performance analysis, and security monitoring .
The primary distinction between SPAN (Switch Port Analyzer) and RSPAN (Remote Switch Port Analyzer) is their operational environment: SPAN is used to copy traffic to a destination interface on the same switch, while RSPAN allows for traffic to be copied across multiple switches. SPAN is useful for directly monitoring traffic on a single switch where the source and destination ports exist on the same device. In contrast, RSPAN extends this capability by utilizing a dedicated VLAN to transmit copied traffic across multiple switches, allowing the monitoring of traffic between different parts of a network .
To configure a VLAN specifically for RSPAN traffic monitoring, follow these steps: (1) Create the desired VLAN on both the source and destination switches; (2) Designate the VLAN as an RSPAN VLAN by entering the 'remote-span' command in VLAN configuration mode; (3) Ensure that all trunk links between the switches are configured to allow the passage of the RSPAN VLAN traffic by configuring them as trunk ports ('switchport trunk encapsulation dot1q' and 'switchport mode trunk'); (4) Configure monitor sessions on the switches, specifying the RSPAN VLAN as the destination on the source switch and as the source on the destination switch .
Verifying a SPAN or RSPAN session configuration involves using the 'show monitor session' command. This command displays detailed information about each session configured on the switch, including the session type (local or remote), source ports, destination ports, source VLANs for RSPAN, and the ingress or egress encapsulation settings. For example, the output will show session information under headers like 'Source Ports', 'Destination Ports', and 'Dest RSPAN VLAN', indicating the current status and configuration status of each monitoring session .
In RSPAN configuration, VLANs are used as a medium to transport mirrored traffic between switches. First, an RSPAN VLAN must be created and designated for remote span use (using the 'remote-span' command). This VLAN is then configured on both the source and destination switches to carry RSPAN traffic. The link between the switches should be configured as a trunk to allow the RSPAN VLAN to pass through. After this setup, the source switch is configured to select the source interface and specify the RSPAN VLAN as the destination, while the destination switch uses the RSPAN VLAN as the source and specifies the interface where the traffic should be forwarded .
To configure a SPAN session to monitor traffic in only one direction, you need to specify either 'rx' or 'tx' when configuring the source interface. 'Rx' specifies that only received traffic should be monitored, and 'tx' specifies that only transmitted traffic should be monitored. For example, to monitor only the traffic being received, the command would be: Switch(config)#monitor session 1 source interface fa0/1 rx .