RSPAN(Remote Switched Port Analyzer,远程交换端口分析),即远程端口镜像,突破了被镜像端口和镜像端口必须在同一台交换机上的限制,使被镜像端口和镜像端口可以跨越网络中的多个设备,从而方便网管人员对远程交换机设备进行管理。

实现了RSPAN功能的交换机分为三种:
  a.源交换机:被监测的端口所在的交换机,负责将需要镜像的流量在Remote-probe VLAN上做二层转发,转发给中间交换机或目的交换机。

   b.中间交换机:网络中处于源交换机和目的交换机之间的交换机,通过Remote-probe VLAN把镜像流量传输给下一个中间交换机或目的交换机。如果源交换机与目的交换机直接相连,则不存在中间交换机。
  c.目的交换机:远程镜像目的端口所在的交换机,将从Remote-probe VLAN接收到的镜像流量通过镜像目的端口转发给监控设备。

 

为了实现远程端口镜像功能,需要定义一个特殊的VLAN,称之为Remote-probe VLAN。所有被镜像的报文通过该VLAN从源交换机传递到目的交换机的镜像端口,实现在目的交换机上对源交换机的远程端口的报文进行监控的功能。Remote-probe VLAN具有以下特点:

建议将该VLAN中的设备互连端口都配置为Trunk端口;
不能将缺省VLAN、管理VLAN设置成Remote-probe VLAN;
需要通过配置保证Remote-probe VLAN从源交换机到目的交换机的二层互通性;
交换机作为中间设备或者目的设备的时候,不能支持双向(both)镜像。

案例一:本地端口镜像

如图所示,PC1的ip 地址为 192.168.1.1 ,PC2的ip 地址为 192.168.1.2 。管理员通过该交换机来监控pc1 和pc2之间的通信。

拓扑图:

clip_image002

配置步骤:

[SW3]mirroring-group 1 local ## 创建本地端口镜像组 1

[SW3]interface Ethernet 1/0/5

[SW3-Ethernet1/0/5]mirroring-group 1 monitor-port ##定义当前端口为镜像组1的监控端口(目的端口)

[SW3]interface Ethernet 1/0/1

[SW3-Ethernet1/0/1]mirroring-group 1 mirroring-port both ##配置镜像源端口,同时指定被监控报文的方向

[SW3]interface Ethernet 1/0/2

[SW3-Ethernet1/0/2]mirroring-group 1 mirroring-port both ##配置镜像源端口,同时指定被监控报文的方向

sniffer配置:

clip_image004

clip_image005

clip_image006

clip_image007

clip_image008

clip_image009

clip_image011

测试结果:

clip_image013

 

案例二:

如图所示,三台交换机SW4 SW3,SW6 分别为目的交换机,中间交换机,源交换机。

管理员在交换机SW4上监控远端的交换机SW6 上连接的两个用户之间的通信。

拓扑图:

clip_image002[4]

配置步骤:

目的交换机上SW4 :

[SW4]vlan 10 ##创建Remote-probe VLAN,并进入VLAN视图

[SW4-vlan10]remote-probe vlan enable ##定义当前VLAN为Remote-probe VLAN

[SW4]interface Ethernet 1/0/1

[SW4-Ethernet1/0/1]port link-type trunk ##配置当前端口类型为Trunk

[SW4-Ethernet1/0/1]port trunk permit vlan 10 ##配置TRUNK端口允许Remote-probe VLAN的报文通过

[SW4]mirroring-group 1 remote-destination ## 配置远程目的镜像组

[SW4]mirroring-group 1 monitor-port Ethernet 1/0/5 ##配置远程镜像目的端口

[SW4]mirroring-group 1 remote-probe vlan 10 ##配置远程目的镜像组的remote-probe VLAN

中间交换机SW3:

[SW3]vlan 10 ##创建Remote-probe VLAN,并进入VLAN视图

[SW3-vlan10]remote-probe vlan enable ##定义当前VLAN为Remote-probe VLAN

[SW3]interface Ethernet 1/0/2

[SW3-Ethernet1/0/2]port link-type trunk ##配置当前端口类型为Trunk

[SW3-Ethernet1/0/2]port trunk permit vlan 10 ##配置TRUNK端口允许Remote-probe VLAN的报文通过

[SW3-Ethernet1/0/2]interface Ethernet 1/0/1

[SW3-Ethernet1/0/1]port link-type trunk ##配置当前端口类型为Trunk

[SW3-Ethernet1/0/1]port trunk permit vlan 10 ##配置TRUNK端口允许Remote-probe VLAN的报文通过

源交换机 SW6

[SW6]vlan 10 ##创建Remote-probe VLAN,并进入VLAN视图

[SW6-vlan10]remote-probe vlan enable ##定义当前VLAN为Remote-probe VLAN

[SW6]interface Ethernet 1/0/2

[SW6-Ethernet1/0/2]port link-type trunk ##配置当前端口类型为Trunk

[SW6-Ethernet1/0/2]port trunk permit vlan all ##配置TRUNK端口允许Remote-probe VLAN的报文通过

[SW6]mirroring-group 1 remote-source ##配置远程源镜像组1

[SW6]mirroring-group 1 mirroring-port Ethernet 1/0/3 inbound ##配置远程镜像源端口,监控报文方向为进入方向

[SW6]mirroring-group 1 mirroring-port Ethernet 1/0/4 outbound ####配置远程镜像源端口,监控报文方向为出方向

[SW6]mirroring-group 1 reflector-port Ethernet 1/0/5 ##配置远程反射端口

[SW6]mirroring-group 1 remote-probe vlan 10 ##配置远程源镜像组的remote-probe VLAN

 

sniffer配置:

clip_image004[4]

clip_image005[4]

clip_image006[4]

clip_image007[4]

clip_image008[4]

clip_image009[4]

clip_image011[4]

clip_image013[4]