锐捷S12010交换机上配置多对多镜像口(RSPAN)案例

一般常见的镜像口配置为一对一或多对一,即多个口的流量镜像至一个口上,如下图所示,服务器及楼层的端口为源端口,连接监控设备的端口为目标端口。

mirror001

 

但目前随着一个网络中的监控设备类型越来越多,如入侵防御系统、上网行为管理、身份准入系统等,都需要使用到镜像口的功能,都需要将局域网中的流量镜像一份给它,设备才能起作用。

本案例,即会在一个局域网中配置多个目标镜像口,使多个设备都能发挥作用。

1、案例拓扑图

mirror002

2、案例及拓扑说明

案例中的交换机为锐捷S12010,如下图所示,将楼层网络及服务器网络(端口1/0/21-24)的流量都镜像至身份准入、上网行为管理、入侵检测(端口g1/0/11-13)上。这里,将会用到一个自环口,需在交换机上挑选一个未用的端口。

3、配置步骤

(1)创建Remote VLAN

RuiJie_S12010#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
RuiJie_S12010(config)#vlan 2001
RuiJie_S12010(config-vlan)#remote-span
RuiJie_S12010(config-vlan)#end

(2)配置RSPAN

在锐捷S12010上配置RSPAN的源端口,配置g1/0/21-24口为源端口,镜像又向数据流

RuiJie_S12010(config)#monitor session 1 remote-source
RuiJie_S12010(config)#monitor session 1 source interface gigabitEthernet 1/0/21 both
RuiJie_S12010(config)#monitor session 1 source interface gigabitEthernet 1/0/22 both
RuiJie_S12010(config)#monitor session 1 source interface gigabitEthernet 1/0/23 both
RuiJie_S12010(config)#monitor session 1 source interface gigabitEthernet 1/0/24 both

指定自环端口interface gig1/0/10为镜像的目的端口:

RuiJie_S12010(config)#monitor session 1 destination remote vlan 2001 interface gigabitEthernet 1/0/10

将端口inter gig1/0/10配置为自环口:

RuiJie_S12010(config)#interface gigabitEthernet 1/0/10
RuiJie_S12010(config-if-GigabitEthernet 1/0/10#switchport access vlan 2001
RuiJie_S12010(config-if-GigabitEthernet 1/0/10)#mac-loopback                //自环口会不要再做其他配置,也不要连接线缆。
RuiJie_S12010(config-if-GigabitEthernet 1/0/10)#end
RuiJie_S12010# clear mac-address-table dynamic interface gigabitEthernet 1/0/10    //配置完成后清下自环口的mac地址表

(3)将目标端口g1/0/11-13加入Remote VLAN中

将身份准入、上网行为管理及入侵检测设备的三个端口gig1/0/11-13三个端口加入Remote VLAN 2001中,这样,自环端口g1/0/10上里的流量也会泛到这三个端口上:

RuiJie_S12010(config)#interface range gig 1/0/11-13
RuiJie_S12010(config-if-range)#switchport access vlan 2001
RuiJie_S12010(config-if-range)#end
RuiJie_S12010#wr

(4)TRUNK口裁剪VLAN 2001

如果S12010上面开启了生成树协议,同时有其他trunk口,由于RSPAN的镜像目的口有MAC-loopback功能,会导致流量在remote-vlan中打环,所以需要在所有trunk口上做vlan修剪,本例中remove vlan 2001,配置示例如下:

interface gig1/0/1
switchport mode trunk
switchport trunk allowed vlan remove 2001
description server-zone

Leave a Reply