> For the complete documentation index, see [llms.txt](https://hamidsec.gitbook.io/cisco/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hamidsec.gitbook.io/cisco/span-rspan.md).

# SPAN-RSPAN

## 1-SPAN(Switched Port Analyzer Network)

To sniff or to analyse traffic on specific port or Vlan you can use SPAN. As it is shown in Figure 1, we want to have traffic of FastEthernet0/1 on port FastEthernet0/10. So, simple we can define monitor session for interface  FastEthernet0/1 as a source and  FastEthernet0/10 as a destination.

![Figure 1: SPAN](/files/-LBqUSs9Bxf9AfytJqwj)

```
SW# conf t
SW(config)#monitor session 1 source int fa0/1
SW(config)#monitor session 1 destination int fa0/10
```

{% hint style="info" %}
You can define a receive, transmit or both in monitor session:

&#x20;SW(config)#monitor session 1 source int fa0/1  rx | tx | both
{% endhint %}

## 2- RSPAN(Remotely Switched Port Analyzer Network)

This is exactly the same scenario of SPAN, but here we remotely monitor a port in switch. First, you have to define separate Vlan between two switches. Then, you can specify source and destination.

![](/files/-LBqUicqHjOmJ5v9r7DD)

```
SW1# conf t
SW1(config)#vlan 20
SW1(config)#remote-span
SW1(config)#exit

SW1(config)#monitor session 1 source int fa0/1
SW1(config)#monitor session 1 destination remote-vlan 20
```

```
SW1# conf t
SW1(config)#monitor session 1 source remote-vlan 20
SW1(config)#monitor session 1 destination int fa0/10
```

## 3- show command

```
SW# show monitor session 1 detail
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hamidsec.gitbook.io/cisco/span-rspan.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
