远程镜像RSPAN的配置

本文介绍了一种使用H3C及Quidway系列交换机实现远程镜像的组网方案,通过设置特定端口为镜像源端口、目的端口及反射端口,并配置VLAN以确保二层互通,最终实现对指定流量的监控。

组网需求:

Switch A为目的交换机,Switch A通过GigabitEthernet 1/1/2和监控设备PC2相连,GigabitEthernet 1/1/2为镜像目的端口,Switch B为中间交换机,Switch A的Trunk端口GigabitEthernet 1/1/1和Switch B的Trunk端口GigabitEthernet 1/1/1相连,Switch B的Trunk端口GigabitEthernet 1/1/2和Switch C的Trunk端口GigabitEthernet 1/1/1相连,Switch C为源交换机,Switch C的端口GigabitEthernet 1/1/2和PC1相连,GigabitEthernet 1/1/2为镜像源端口,定义GigabitEthernet 1/1/3为反射端口。

组网图:

 

配置步骤:

SwitchC的配置:

1.进入系统视图

<SwitchC> system-view

2.创建并进入VLAN10,设置VLAN10为remote-probe vlan

[SwitchC] vlan 10

[SwitchC-vlan10] remote-probe vlan enable

[SwitchC-vlan10] quit

3.进入G1/1/1端口视图

[SwitchC] interface GigabitEthernet 1/1/1

4.设置端口为trunk,并允许vlan10通过

[SwitchC-GigabitEthernet1/1/1] port link-type trunk

[SwitchC-GigabitEthernet1/1/1] port trunk permit vlan 10

[SwitchC-GigabitEthernet1/1/1] quit

5.设置远程源镜像组

[SwitchC] mirroring-group 1 remote-source

6.设置G1/1/2为源端口,并对进方向报文进行监控

[SwitchC] mirroring-group 1 mirroring-port GigabitEthernet 1/1/2 inbound

7.设置G1/1/3为远程反射端口

[SwitchC] mirroring-group 1 reflector-port GigabitEthernet 1/1/3

8.设置镜像组1的remote-probe vlan为10

[SwitchC] mirroring-group 1 remote-probe vlan 10

Switch B的配置:

1.设置vlan10为remote-probe vlan

[SwitchB] vlan 10

[SwitchB-vlan10] remote-probe vlan enable

[SwitchB-vlan10] quit

2.将端口G1/1/1设为trunk口并允许vlan10通过

[SwitchB] interface GigabitEthernet 1/1/1

[SwitchB-GigabitEthernet1/1/1] port link-type trunk

[SwitchB-GigabitEthernet1/1/1] port trunk permit vlan 10

[SwitchB-GigabitEthernet1/1/1] quit

3.将端口G1/1/2设为trunk口并允许vlan10通过

[SwitchB] interface GigabitEthernet 1/1/2

[SwitchB-GigabitEthernet1/1/2] port link-type trunk

[SwitchB-GigabitEthernet1/1/2] port trunk permit vlan 10

Switch A的配置:

1.设置vlan10为remote-probe vlan

[SwitchA] vlan 10

[SwitchA-vlan10] remote-probe vlan enable

[SwitchA-vlan10] quit

2.将端口G1/1/1设为trunk口并允许vlan10通过

[SwitchA] interface GigabitEthernet 1/1/1

[SwitchA-GigabitEthernet1/1/1] port link-type trunk

[SwitchA-GigabitEthernet1/1/1] port trunk permit vlan 10

[SwitchA-GigabitEthernet1/1/1] quit

3.设置远程监控镜像组

[SwitchA] mirroring-group 1 remote-destination

4.设置端口G1/1/2为监控端口

[SwitchA] mirroring-group 1 monitor-port GigabitEthernet 1/1/2

5.设置镜像组1的remote-probe vlan为10

[SwitchA] mirroring-group 1 remote-probe vlan 10

配置关键点:

1.不能将缺省VLAN、管理VLAN设置成Remote-probe vlan;

2.需要通过配置保证Remote-probe VLAN从源交换机到目的交换机的二层互通性;

3.支持远程镜像的设备包括:H3C S3100、H3C S3600-EI、H3C S5600、H3C S5100、Quidway S3900-EI、Quidway S5100和Quidway S5600系列交换机。

 

<think>嗯,用户之前提供了一个关于思科远程端口镜像的详细说明,包括原理、配置方法和应用场景。现在用户的新查询是"我想查找思科远程端口镜像配置方法 请问思科远程端口镜像配置方法",并引用了两个文献。 注意到用户引用的第一个文献是华为交换机的配置案例(使用port-mirroring命令),这与思科设备完全不兼容。第二个文献指向思科Catalyst 6500的官方文档,这是可靠的。 用户明显需要思科专属的配置指南,而我的历史回复中已经包含Catalyst交换机的RSPAN和ERSPAN配置示例。需要特别注意: 1. 必须明确区分华为和思科的配置语法差异 2. 突出思科的关键命令如monitor session和remote-span 3. 强调设备兼容性要求(IOS版本差异) 之前的回复配置示例中,RSPAN部分需要补充三点细节: - RSPAN VLAN必须在所有中间交换机上透传 - 目标端口需关闭交换功能(no switchport) - 源端口方向(inbound/outbound/both)的指定方式 ERSPAN部分则需要强调: - 仅较新设备支持(IOS XE 3.3+/NX-OS 7.1+) - 必须确保路由可达性 - erspan-id两端匹配的校验要点 对于配置验证环节,应该补充两个关键命令的输出解读: 1. show monitor session [id] 的状态字段解析 2. 如何通过SPAN计数器确认镜像流量 考虑到用户可能是网络管理员,在注意事项里增加了两个生产环境实用建议: - 流量限速配置(rate-limit) - ACL过滤非必要流量的技巧 最后生成的验证命令集show monitor session all | include Status|Error特别有用,能快速诊断常见配置错误如VLAN未标记remote-span或GRE隧道建立失败。 </think>以下是思科远程端口镜像RSPAN/ERSPAN)的详细配置方法及注意事项,基于思科官方文档和实践指南整理[^2]: --- ### **一、RSPAN(二层远程镜像配置步骤** 适用于跨交换机但**同二层网络**的场景,需创建专用RSPAN VLAN传输镜像流量。 #### **1. 配置源交换机** ```bash # 创建专用RSPAN VLAN(所有参与交换机需相同配置) SwitchA(config)# vlan 100 SwitchA(config-vlan)# name RSPAN_VLAN SwitchA(config-vlan)# remote-span ! 关键:标记为镜像专用VLAN SwitchA(config-vlan)# exit # 配置镜像会话(复制源端口流量RSPAN VLAN) SwitchA(config)# monitor session 1 source interface GigabitEthernet0/1 ! 源端口 SwitchA(config)# monitor session 1 destination remote vlan 100 ! 发送到VLAN 100 ``` #### **2. 配置目标交换机** ```bash # 同样创建RSPAN VLAN 100 SwitchB(config)# vlan 100 SwitchB(config-vlan)# name RSPAN_VLAN SwitchB(config-vlan)# remote-span SwitchB(config-vlan)# exit # 从RSPAN VLAN接收流量并转发到监控端口 SwitchB(config)# monitor session 1 source remote vlan 100 ! 监听VLAN 100 SwitchB(config)# monitor session 1 destination interface GigabitEthernet0/2 ! 目标端口 ``` #### **3. 验证命令** ```bash SwitchA# show monitor session 1 ! 检查状态应为"Active" SwitchB# show interfaces GigabitEthernet0/2 counters ! 确认流量统计增长 ``` > **关键注意事项**: > - RSPAN VLAN **禁止**承载用户数据,否则导致流量冲突 > - 所有中间交换机需透传VLAN 100(`switchport trunk allowed vlan 100`) > - 目标端口建议配置`switchport mode access`并关闭STP[^2] --- ### **二、ERSPAN(三层远程镜像配置步骤** 适用于**跨三层网络**的场景,通过GRE隧道传输镜像流量。 #### **1. 源交换机配置(发送端)** ```bash SwitchA(config)# monitor session 2 type erspan-source ! 定义ERSPAN源会话 SwitchA(config-mon-erspan-src)# source interface GigabitEthernet0/1 ! 源端口 SwitchA(config-mon-erspan-src)# destination ! 目标设置 SwitchA(config-mon-erspan-dst)# erspan-id 101 ! 会话ID(两端需一致) SwitchA(config-mon-erspan-dst)# ip address 192.168.2.1 ! 目标交换机IP SwitchA(config-mon-erspan-dst)# origin ip address 192.168.1.1 ! 本机IP ``` #### **2. 目标交换机配置(接收端)** ```bash SwitchB(config)# monitor session 2 type erspan-destination ! 定义ERSPAN目标会话 SwitchB(config-mon-erspan-dst)# destination interface GigabitEthernet0/2 ! 监控端口 SwitchB(config-mon-erspan-dst)# source ! 源设置 SwitchB(config-mon-erspan-src)# erspan-id 101 ! 匹配会话ID SwitchB(config-mon-erspan-src)# ip address 192.168.1.1 ! 源交换机IP ``` #### **3. 验证命令** ```bash SwitchA# show monitor erspan all ! 检查隧道状态 SwitchB# show platform hardware qos counters | include Gi0/2 ! 验证接收流量 ``` > **关键注意事项**: > - 确保源/目标IP路由可达(测试`ping 192.168.2.1`) > - 防火墙需放行GRE协议(IP协议号47) > - ERSPAN要求设备支持(Catalyst 9xxx/Nexus系列,IOS-XE 16.6+)[^2] --- ### **三、流量过滤与优化建议** ```bash ! 仅镜像特定流量(如HTTP流量) monitor session 1 filter ip access-group WEB_TRAFFIC ip access-list extended WEB_TRAFFIC permit tcp any any eq 80 ``` ```bash ! 限制镜像带宽(避免拥塞) monitor session 1 rate-limit 100 ! 单位:Mb/s ``` --- ### **四、故障排查** | **现象** | **排查命令** | **解决方案** | |----------------------|---------------------------------------|----------------------------------| | 无镜像流量 | `show monitor session all` | 检查会话状态是否为"Active" | | RSPAN VLAN不通 | `show vlan id 100` | 确认所有交换机配置了`remote-span`| | ERSPAN隧道未建立 | `show monitor erspan statistics` | 检查IP连通性及防火墙规则 | | 目标端口无流量 | `show interface Gi0/2 switchport` | 确认端口未加入其他VLAN | > 注:完整配置指南参考思科官方文档[^2] ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值