2024年4月17日发(作者:)

CISCO交换机端口镜像配置[]

CISCO交换机端口镜像配置

先解释一下端口镜像:端口镜像简单的说,就是把交换机一个(数个)端口(源端

口)的流量完全拷贝一份,从另外一个端口(目的端口)发 出去,以便网络管理人员从

目的端口通过分析源端口的流量来找出网络存在问题的原因。

cisco的端口镜像叫做SWITCHED PORT ANALYZER,简称SPAN(仅在IOS系统

中,下同),因此,端口镜像仅适用于以太网交换端口。Cisco的SPAN 分成三种,

SPAN、RSPAN和VSPAN,简单的说,SPAN是指源和目的端口都在同一台机器上、

RSPAN指目的和源不在同一交换机上,VSPAN可以镜像 整个或数个VLAN到一个目的

端口。

配置方法:

1. SPAN

(1) 创建SPAN源端口

monitor session session_number source interface interface-id [, | -] [both | rx |

tx] monitor session 1 source interface Gi1/0/3 - 23 monitor session 2 source

interface Gi1/0/24

**session_number,SPAN会话号,我记得3550支持的最多本地SPAN是2个,即

1或者2。

**interface-id [, | -]源端口接口号,即被镜像的端口,交换机会把这个端口的流量拷

贝一份,可以输入多个端口,多个用“,”隔开,

比如我的3750G 设置:先查询镜像端口:

>show interface

GigabitEthernet1/0/1 is down, line protocol is down (monitoring)

Hardware is Gigabit Ethernet, address is 001b.53d1.f681 (bia 001b.53d1.f681)

MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec,

reliability 255/255, txload 1/255, rxload 1/255

Encapsulation ARPA, loopback not set

Keepalive set (10 sec)

Auto-duplex, Auto-speed, media type is 10/100/1000BaseTX

input flow-control is off, output flow-control is unsupported

ARP type: ARPA, ARP Timeout 04:00:00

Last input never, output 01:24:41, output hang never