「Huawei VRP」- 报文捕获

  CREATED BY JENKINSBOT

问题描述

当设备的业务流量出现异常,比如流量状态与流量模型不符时,可以使用报文捕获功能,抓取业务报文进行分析,以便及时处理非法报文,保证网络数据的正常传输;

解决方案

命令 capture-packet 用来在设备捕获符合设置规则的业务报文,并上送到终端显示,或保存到本地;

# capture-packet { interface interface-type interface-number | acl acl-number } * [ vlan vlan-id | cvlan cvlan-id ] * destination terminal [ car cir car-value | time-out time-out-value | packet-num number | packet-len length ] *
terminal :将捕获的报文发送到终端显示;
file file-name:将捕获的报文保存在指定的文件里,

目前不支持捕获管理接口的报文;
目前只支持捕获接口入方向报文,不支持捕获接口出方向报文;

原理简述

WIP

特性特征

某个时刻只能有一个捕获报文实例,即前一次捕获报文流程没有结束,不能启动下一次捕获报文;

捕获的报文有速率限制,如果有突发流量,超过捕获报文的速率限制,可能会存在丢包现象;

应用场景

问题排查;

配置案例

<R1> system-view
[R1] capture-packet interface gigabitethernet 0/0/0 destination  terminal
Info: Captured packets will be showed on terminal.
[R1]ping 10.0.12.2
[R1]
  Packet: 1
  -------------------------------------------------------
  ff ff ff ff ff ff 00 e0 fc 9f 4b 1d 08 06 00 01 ----------------------------- # 目的 MAC:ffff-ffff-ffff 源 MAC:00e0-fc9f-4b1d 类型:0806,代表 ARP
  08 00 06 04 00 01 00 e0 fc 9f 4b 1d 0a 00 0c 02
  00 00 00 00 00 00 0a 00 0c 02 00 00 00 00 00 00
  00 00 00 00 00 00 00 00 00 00 00 00
  -------------------------------------------------------

  Packet: 2
  -------------------------------------------------------
  ff ff ff ff ff ff 00 e0 fc 9f 4b 1d 08 06 00 01
  08 00 06 04 00 01 00 e0 fc 9f 4b 1d 0a 00 0c 02
  00 00 00 00 00 00 0a 00 0c 02 00 00 00 00 00 00
  00 00 00 00 00 00 00 00 00 00 00 00
  -------------------------------------------------------

针对数据包解码:
旧版本没有 packet-info 命令,需要借助 https://hpd.gasmi.net/ 来解码报文。

参考文献

How to Capture Packets – Huawei