RSPAN的配置方针

来源:百度文库 编辑:神马文学网 时间:2024/04/27 12:09:28
下面是配置RSPAN的配置方针:
由于RSPAN必须借助RSPAN VLAN才能实现,因此,应该在网络中为RSPAN VLAN预留少量VLAN,并且不要将端口指定至这些VLAN。
可以一个输出ACL应用到SRPAN通信,从而选择性地过滤或监控指定的数据包。在RSPAN源交换机上的RSPAN VLAN中应用这些ACL。
对RSPAN配置而言,源端口和目的端口可以跨越网络中的多个交换机。
RSPAN不支持BPDU包监控或其他二层交换机协议。
RSPAN VLAN只能在中继端口而不是访问端口配置。避免RSPAN VLAN中不必要的通信,确保所有涉及到的交换机都能支持VLAN远程SPAN功能。
RSPAN VLAN上的所有访问端口(包括语音VLAN端口)都被设置为非活动状态。
当源中继端口有激活的RSPAN VLAN时,RSPAN VLAN被包含作为源的基于端口的RSPAN会话中。RSPAN VLAN也可以成为在SPAN会话中的源。
只要符合以下的情况,就可以将VLAN配置为RSPAN VLAN:所有交换机中同一RSPAN VLAN应用于一个RSPAN会话;所有参与的交换机都支持RSPAN。
配置RSPAN源或目的会话之前,先配置一个RSPAN VLAN。
如果启用VTP和VTP修剪,SRPAN通信就会在汇聚端口被剪除。
2. 配置一个VLAN作为RSPAN VLAN
在配置RSPAN之前,应当先创建一个新的VLAN作为RSPAN VLAN,并且必须在所有参与到RSPAN的交换机上创建RSPAN VLAN。如果RSPAN VLAN-ID在正常范围内(低于1005)并且VTP在网络中是启用的,可以在一个交换机上创建RSPAN VLAN,这样,在VTP(VLAN Trunk Protocol,VLAN中继协议)域中,就可以创建多个RSPAN VLAN到其他交换机。
第一步:进入全局配置模式。
Switch # configure terminal
第二步:输入一个VLAN号创建一个VLAN,或者输入一个已存在的VLAN号,并且进入VLAN配置模式。
Switch (config) # vlan vlan-id
第三步:配置VLAN作为RSPAN VLAN。
Switch (config) # remote-span
第四步:返回特权EXEC模式。
Switch (config) # end
第五步:保存配置。
Switch# copy running-config startup-config
从一个VLAN中移除RSPAN特性,并且将其转为标准VLAN,使用“no remote-span”VLAN配置指令。
示例,创建RSPAN VLAN 901。 Switch (config) # vlan 901
Switch (config) # remote span
Switch (config) # end
3. 创建RSPAN源会话
借助以下操作,可以创建一个RSPAN源会话。
第一步:进入全局配置模式。
Switch# configure terminal
第二步:为会话移除所有存在的RSPAN配置。
Switch (config) # no monitor session {session_number |all |local | remote}
第三步:指定RSPAN会话和源端口(被监视端口)。
Switch (config) # monitor session session_number source {interface interface-id | vlan vlan-id} [,|-] [both |rx |tx]
第四步:指定RSPAN会话和目的RSPAN VLAN。
Switch (config) # monitor session session_number destination remote vlan vlan-id
第五步:返回特权EXEC模式。
Switch (config) # end
第六步:校验配置。
Switch # show monitor [session session_number]
Switch # show running-config
第七步:保存配置。
Switch # copy running-config startup-config
删除一个SPAN会话,使用“no monitor session session_number”全局配置命令。移除一个源端口或者来自SPAN会话的VLAN,使用“no monitor session session_number source {interface interface-id |vlan vlan-id}”全局配置命令。从会话里移除RSPAN VLAN,使用“no monitor session session_number destination remote vlan vlan-id”。
示例:为会话1移除所有存在在RSPAN配置,配置RSPAN 会话1去检测多源接口,配置目的端口作为RSPAN VLAN 901。
Switch (config) # no monitor session 1
Switch (config) # monitor session 1 source interface
gigabitethernet1/0/1 tx
Switch (config) # monitor session 1 source interface
gigabitethernet1/0/2 rx
Switch (config) # monitor session 1 source interface
port-channel 2
Switch (config) # monior session 1 destination remote
vlan 901\\
Switch (config) # end
4. 创建RSPAN目的会话
在其他交换机或交换机堆栈上配置RSPAN目的会话,也就是说,不能在源对话交换机或交换机堆栈上配置目的会话。在特权EXEC模式下开始,执行下述操作可以在交换机上定义RSPAN VLAN,创建一个RSPAN目的会话并指定源RSPAN VLAN和目的端口。
第一步:进入全局配置模式。
Switch # configure terminal
第二步:输入在源交换机上创建的RSPAN VLAN的VLAN号,并且进入VLAN配置模式。
Switch (config) # vlan vlan-id
第三步:定义VLAN作为RSPAN VLAN。
Switch (config) # remote-span
第四步:返回全局配置模式。
Switch (config?-if) # exit
第五步:为会话移除所有存在的RSPAN配置。
Switch (config) # no monitor session {session_number |all |local|remote}
第六步:指定RSPAN会话和源RSPAN VLAN。
Switch (config) # monitor session session_number source remote vlan vlam-id
第七步:指定RSPAN会话和目的接口。
Switch (config) # monitor session session_number destination interface interace-id
第八步:返回特权EXEC模式。
Switch (config) # end
第九步:校验配置。
Switch # show monitor [session session_number]
Switch # show running-config
第十步:保存配置。
Switch # copy running-config startup-config
要删除会话,使用“no monitor session session_number”全局配置命令。移除来自SPAN会话的目的端口,使用“no monitor session session_number destination interface interface-id”全局配置指令。移除来自会话的RSPAN VLAN,使用“no monitor session session_number source remote vlan vlan-id”。
5. 创建RSPAN目的会话并配置流量
在特权EXEC模式下开始,创建一个RSPAN目的会话,指定源RSPAN VLAN和目的端口,并且在目的端口上为一个网络安全设备启用流量控制。
第一步:进入全局配置模式。
Switch # configure terminal
第二步:为会话移除所有存在的SPAN配置。
Switch (config) # no monitor session {session_number |all |local |remote}
第三步:指定RSPAN会话和源RSPAN VLAN。
Switch (config) # monitor session session_number source remote vlan vlan-id
第四步:指定SPAN会话,目的端口,封装包和VLAN封装。
Switch (config) # monitor session session_number destination {interface interface-id [,|-] [ingress {dot1q vlan vlan-id |isl |untagged vlan vlan-id |vlan vlan-id}]}
第五步:返回特权EXEC模式。
Switch (config) # end
第六步:校验配置。
Switch # show monitor [session session_number]
第七步:保存配置。
Switch # copy running-config startup-config
删除一个RSPAN会话,使用“no monitor session session_number”全局配置指认。移除一个来自RSPAN会话的目的端口,使用“no monitor session session_number destination interface interface-id”全局配置命令。
6.指定过滤VLANs
在特权EXEC模式下开始,配置RSPAN源会话来限制RSPAN到指定VLANs的源流量。
第一步:进入全局配置模式。
Switch # configure terminal
第二步:为会话移除所有存在的SPAN配置。
Switch (config) # no monitor session {session_number |all |local | remote}
第三步:指定源端口和SPAN会话。
Switch (config) # monitor session session_number source interface interface-id
第四步:限制SPAN源到指定VLANs的流量。
Switch (config) # monitor session session_number filter vlan vlan-id [,|-]
第五步:指定RSPAN会话和目的远程VLAN(RSPAN VLAN)。
Switch (config) # monitor session session_number destination remote vlan vlan-id
第六步:返回特权EXEC模式。
Switch (config) # end
第七步:校验配置。
Switch # show monitor [session session_number]
Switch # show running-config
第八步:保存配置。
Switch (config) # copy running-config startup-config
检测所有在中继端口上的VLAN,使用“no monitor session session_number filter vlan”全局配置指令。
6.9.6 显示SPAN和RSPAN状态
显示当前SPAN或者RSPAN的配置,使用show monitor用户EXEC指令。也可以使用show running-config特权EXEC指令显示已配置的SPAN或者RSPAN会话。