首页/网络/网络设备配置速查/远程端口镜像(跨设备抓包)
接口与链路73 条

远程端口镜像(跨设备抓包)

被测设备与抓包点不在同一台时用远程镜像:把镜像流量打上专用 VLAN 穿过网络送到观察设备;三厂机制名不同(华为观察口跨设备 / Cisco RSPAN / H3C 远程镜像)。

网络设备配置速查网络更新于 2026-10-12
场景核心交换机抓包、跨机房取证
适用支持远程镜像的交换机
命令族observe-port(跨设备)/ RSPAN / remote mirroring

华为 VRP

华为 VRP
# 源设备:定义远程观察口(VLAN 方式)
[Huawei] observe-port 1 interface GigabitEthernet 0/0/24 vlan 999
[Huawei-GigabitEthernet0/0/1] mirror to observe-port 1 both
# 中间设备:Trunk 放通 VLAN 999;目的设备在 VLAN 999 内接观察口

思科 IOS

思科 IOS
# 源设备
SW-A(config)# vlan 999
SW-A(config)# monitor session 1 source interface Gi1/0/1 both
SW-A(config)# monitor session 1 destination remote vlan 999
# 目的设备
SW-B(config)# monitor session 1 source remote vlan 999
SW-B(config)# monitor session 1 destination interface Gi1/0/24

H3C Comware

H3C Comware
# 源设备(远程镜像组,VLAN 承载)
[H3C] mirroring-group 1 remote-source
[H3C] mirroring-group 1 mirroring-port GigabitEthernet 1/0/1 both
[H3C] mirroring-group 1 remote-probe vlan 999   ! 形态随版本有差异
RSPAN 类方案的公共要素:专用镜像 VLAN(全路径放通、非用户 VLAN)+ 源设备打标 + 目的设备解封装到观察口。华为用 observe-port ... vlan,思科 monitor session destination remote vlan,H3C 用 remote-source/remote-destination 组。

易错点

  • 承载 VLAN 未在全路径放通是远程镜像不通的第一原因
  • 镜像 VLAN 混入业务 VLAN 会污染转发与 MAC 学习,务必使用独立 VLAN

数据来源与参考

  • Cisco RSPAN 配置指南
  • 华为跨设备镜像配置
  • H3C Comware 7 远程镜像

相关工具

​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌