首页/网络/网络设备配置速查/思科 SPAN 与 EPC:本地镜像抓包
设备排障72 条

思科 SPAN 与 EPC:本地镜像抓包

思科本地抓包两条路:传统 SPAN 把流量镜像到抓包机,或 EPC(Embedded Packet Capture)在设备内录包导出 pcap。

网络设备配置速查网络更新于 2026-10-12
场景思科设备抓包定位
适用Cisco IOS/IOS-XE
命令族monitor session / monitor capture

思科 IOS

思科 IOS
monitor session 1 source interface GigabitEthernet0/1 both
monitor session 1 destination interface GigabitEthernet0/2
show monitor session all

华为 VRP

华为 VRP
observe-port 1 interface GigabitEthernet0/0/2
interface GigabitEthernet0/0/1
 port-mirroring to observe-port 1 both

H3C Comware

H3C Comware
mirroring-group 1 local
mirroring-group 1 mirroring-port GigabitEthernet1/0/1 both
mirroring-group 1 monitor-port GigabitEthernet1/0/2
display mirroring-group all
差异:思科 monitor session(source/destination 两步);华为 observe-port 先定义观察口再在接口下 port-mirroring;H3C mirroring-group 三步——三厂镜像思路一致、语法完全不同。

易错点

  • source 是被镜像口、destination 是抓包机接口,方向和角色别接反;高流量时镜像口可能过载丢包,只镜像需要的方向

数据来源与参考

  • Cisco SPAN 配置文档
  • 华为端口镜像配置
  • H3C 镜像组配置

相关工具

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