Cisco Port Mirroring

Port Mirroring یک ویژگی در دستگاه های شبکه سیسکو است که به شما امکان می دهد ترافیک ارسال و دریافت شده در یک پورت خاص را بر روی یک پورت دیگر آن دستگاه بازتاب دهید. با استفاده از Port Mirroring می توانید تمام ترافیک ارسال و دریافت شده بر روی یک پورت را بررسی و نظارت کنید، بدون اینکه ترافیک واقعی شبکه تحت تأثیر قرار گیرد.

با فعال کردن Port Mirroring، شما می توانید پورت مبدأ (Source Port) را تعیین کنید که ترافیک ارسال و دریافت شده در آن را می خواهید بررسی کنید، و پورت مقصد (Destination Port) را تعیین کنید که تمام ترافیک آن پورت به آنجا بازتاب می شود. این پورت مقصد معمولاً یک دستگاه نظارتی یا یک ابزار تحلیل شبکه می باشد.

استفاده از Port Mirroring می تواند در بسیاری از حالت ها مفید باشد، از جمله:
۱. نظارت و عیب یابی: با استفاده از Port Mirroring، می توانید ترافیک شبکه را بررسی کنید و به مشکلات شبکه، عیب یابی و مشکلات امنیتی پی ببرید.

۲. تجزیه و تحلیل ترافیک: با استفاده از ابزارهای تحلیل شبکه، می توانید ترافیک شبکه را بررسی کنید، الگوهای ترافیک را تحلیل کنید و اطلاعات بیشتری درباره فعالیت های شبکه خود بدست آورید.

۳. امنیت شبکه: با استفاده از Port Mirroring، می توانید ترافیک شبکه را به دستگاه های امنیتی ارسال کنید تا ترافیک را بررسی کرده و تهدیدات امنیتی را تشخیص دهید، مانند شناسایی تهدیدات از نوع حملات DDoS یا شنود داده ها.

برای فعال کردن Port Mirroring در دستگاه های سیسکو، شما باید به تنظیمات پورت مربوطه دسترسی داشته باشید و دستورات مربوطه را پیکربندی کنید. هر دستگاه سیسکو ممکن است دستورات متفاوتی برای فعال کردن Port Mirroring داشته باشد، بنابراین بهتر است به مستندات و راهنمایی های سیسکو مراجعه کنید یا با متخصصان شبکه مشورت کنید تا دستورات دقیق و مورد نیاز برای دستگاه خاص خود را بدست آورید.

Here are the syntaxes for configuring port mirroring on Cisco switches:


1. Local SPAN (Switched Port Analyzer):

```
monitor session <session_number> source interface <source_interface> [both | rx | tx]
monitor session <session_number> destination interface <destination_interface>
```


- ` <session_number>`: The session number for the SPAN session (1-66).
- ` <source_interface>`: The interface you want to monitor.
- `both`: Captures both incoming and outgoing traffic.
- `rx`: Captures only incoming (receive) traffic.
- `tx`: Captures only outgoing (transmit) traffic.
- ` <destination_interface>`: The interface where you want to send the mirrored traffic.


Example:
```
monitor session 1 source interface GigabitEthernet1/0/1 both
monitor session 1 destination interface GigabitEthernet1/0/2
```

2. Remote SPAN (RSPAN):

```
monitor session <session_number> source remote vlan <vlan_number> [both | rx | tx]
monitor session <session_number> destination remote vlan <vlan_number>
```


- ` <session_number>`: The session number for the RSPAN session (1-66).
- ` <vlan_number>`: The VLAN used for RSPAN traffic.
- `both`: Captures both incoming and outgoing traffic.
- `rx`: Captures only incoming (receive) traffic.
- `tx`: Captures only outgoing (transmit) traffic.


Example:
```
monitor session 1 source remote vlan 10 both
monitor session 1 destination remote vlan 20
```

Note: RSPAN requires configuring a VLAN specifically for RSPAN traffic.


3. Encapsulated Remote SPAN (ERSPAN):

```
monitor session <session_number> type erspan-source
monitor session <session_number> source interface <source_interface> [both | rx | tx]
monitor session <session_number> destination interface <destination_interface> [ip <destination_IP_address>] [origin ip-address <source_IP_address>] [vrf <VRF_name>] [mtu <MTU_value>]
```


- ` <session_number>`: The session number for the ERSPAN session (1-66).
- ` <source_interface>`: The interface you want to monitor.
- `both`: Captures both incoming and outgoing traffic.
- `rx`: Captures only incoming (receive) traffic.
- `tx`: Captures only outgoing (transmit) traffic.
- ` <destination_interface>`: The interface where you want to send the mirrored traffic.
- ` <destination_IP_address>`: The IP address of the destination ERSPAN device.
- ` <source_IP_address>`: The source IP address for ERSPAN packets (optional).
- ` <VRF_name>`: The VRF (Virtual Routing and Forwarding) name (optional).
- ` <MTU_value>`: The Maximum Transmission Unit (MTU) value (optional).


Example:
```
monitor session 1 type erspan-source
monitor session 1 source interface GigabitEthernet1/0/1 both
monitor session 1 destination interface GigabitEthernet1/0/2 ip 192.168.1.10 origin ip-address 192.168.1.1 vrf my_vrf mtu 1500
```

These are the basic syntaxes for configuring port mirroring on Cisco switches. Please note that the actual commands may vary depending on the specific model and software version of your Cisco switch.

  1. Entering the English page