锐捷:锐捷交换机端口镜像完整配置(本地 SPAN + 远程 RSPAN)
锐捷:锐捷交换机端口镜像完整配置(本地 SPAN + 远程 RSPAN)
锐捷交换机端口镜像完整配置(本地 SPAN + 远程 RSPAN)
一、基础概念
本地镜像(SPAN):源口、监控目的口在同一台交换机,最常用(抓包、旁路审计)
远程镜像(RSPAN):源交换机复制流量打上专属 RSPAN VLAN,跨交换机送到远端监控口
流量方向关键字
both:双向收发(推荐,默认)
rx:仅入站(下联设备发往交换机)
tx:仅出站(交换机发往下联设备)
重要限制
一个session镜像组只能 1 个目的端口,可多个源端口
11.X 新版本交换机配置目的口必须加switch,否则监控口无法上网通信
源端口不能同时作为其他镜像组的源 / 目的口
二、本地镜像(多对一,单交换机,最常用)
场景:监控 Gi0/1、Gi0/2 全部流量到 Gi0/24(接电脑 / 审计设备)
Ruijie>enable
Ruijie#configure terminal
# 配置多个被监控源端口,双向流量
monitor session 1 source interface GigabitEthernet 0/1 both
monitor session 1 source interface GigabitEthernet 0/2 both
# 配置监控目的端口,加switch保证监控主机正常上网(11.X必加)
monitor session 1 destination interface GigabitEthernet 0/24 switch
end
write memory # 保存配置
简化批量源端口写法
monitor session 1 source interface range GigabitEthernet 0/1-5 both
仅单向监控示例(只抓入口流量)
monitor session 1 source interface Gi0/1 rx
monitor session 1 destination interface Gi0/24 switch
三、查看 / 删除镜像配置
查看当前镜像
show monitor
show running-config | include monitor
删除整个镜像组
no monitor session 1 source interface Gi0/1
四、远程镜像 RSPAN(跨交换机监控流量)
组网说明
源交换机:产生镜像流量,打 RSPAN VLAN 标签
中间交换机:透传 RSPAN VLAN trunk
目的交换机:剥离标签,本地输出到监控电脑
1)源交换机配置
enable
conf t
# 创建专属远程镜像VLAN,必须加remote-span
vlan 99
remote-span
exit
# 定义本设备为RSPAN源设备
monitor session 1 remote-source
# 被监控端口
monitor session 1 source interface Gi0/1 both
# 镜像流量从Gi0/23 trunk口发出,封装VLAN99
monitor session 1 destination remote vlan 99 interface Gi0/23 switch
# 上联口放通RSPAN VLAN
interface Gi0/23
switchport mode trunk
switchport trunk allowed vlan add 99
2)中间透传交换机(仅透传 VLAN)
conf t
interface range Gi0/1-2
switchport mode trunk
switchport trunk allowed vlan add 99
3)远端监控交换机配置
conf t
vlan 99
remote-span
exit
# 定义为RSPAN接收端
monitor session 1 remote-destination
# 接收远程VLAN99流量,本地输出到Gi0/24监控口
monitor session 1 source remote vlan 99
monitor session 1 destination interface Gi0/24 switch
# 上联trunk口放通RSPAN VLAN
interface Gi0/1
switchport mode trunk
switchport trunk allowed vlan add 99
五、单台交换机一对多监控(多台电脑同时抓包,RSPAN 本地用法)
单交换机实现1 个源口、多个监控口,用 RSPAN 反射口实现
conf t
# 新建远程镜像VLAN
vlan 100
remote-span
exit
# 开启远程源镜像
monitor session 1 remote-source
# 被监控业务口
monitor session 1 source interface Gi0/1 both
# 配置未使用端口Gi0/2作为反射环回口
monitor session 1 destination remote vlan 100 interface Gi0/2 switch
# 反射口配置MAC自环,不要插网线
interface Gi0/2
switchport access vlan 100
mac-loopback
exit
# 多台监控电脑端口加入RSPAN VLAN100
interface range Gi0/21-22
switchport access vlan 100
七、常见坑与注意事项
11.X 版本报错:目的端口不加switch会提示配置失败,监控主机无法通信
监控目的端口不能做 trunk / 聚合 / ACL/802.1X,仅普通 access 口
镜像仅复制流量,不影响原端口业务转发
带宽瓶颈:如果源口总流量大于目的口带宽,会丢包,建议同速率端口镜像
RSPAN VLAN 禁止配置三层 SVI 接口,否则镜像异常
反射口(一对多镜像)必须闲置,不接任何网线,配置mac-loopback
2、本资源基本为原创,部分来源其他付费资源平台或互联网收集,如有侵权请联系及时处理。
3、本站大部分文章的截图来源实验测试环境,请不要在生产环境中随意模仿,以免带来灾难性后果。
转载请保留出处: www.zh-cjh.com珠海陈坚浩博客 » 锐捷:锐捷交换机端口镜像完整配置(本地 SPAN + 远程 RSPAN)
作者: cjh
| 手机扫一扫,手机上查看此文章: |
一切源于价值!
其他 模板文件不存在: ./template/plugins/comment/pc/index.htm