Embedded Packet Capture (EPC)是一个很好的抓包工具,在排障的时候,需要在线抓包的情况下,是一个非常好的选择。

EPC在IOS和IOS-XE都是支持,不过,不同平台下有版本的限制。

1、IOS:需要在12.4(20)T及之后的版本支持

2、IOS-XE:需要在15.2(4)S - 3.7.0 及之后的版本

如下配置示例,简单记录了IOS和IOS-XE的EPC不同配置:

关于IOS的EPC

配置步骤:

1、定义一个“capture buffer”,这是一个临时的buffer,给抓取的数据使用,当定义buffer的时候,有各种参数可以定义,例如:buffer大小(size),最大报文大小(max packet size),capture buffer的模式【这里分为2中,一种是linear(称为“线性模式”吧,当buffer满了,丢弃新的数据包),另一种是circular(称为“循环模式”吧,当buffer满了,丢弃旧的数据包)。】

2、可以定义一个ACL去匹配对应的流量。

3、定义一个“capture point”,定义哪个位置的流量会被抓取,抓取的方向是in,out,还是both,还可以定义是发生在IPv4还是IPv6,或者交换方式是process还是CEF。

4、为“capture point”关联buffer。

5、开启capture,开启之后,就可以抓取报文了。

6、待抓取结束,停止capture。

配置示例:

monitor capture buffer BUF size 2048 max-size 1518 linear <<<<<<定义一个名为BUG的buffer,buffer大小2MB,最大报文1518 Byte,当buffer满了,丢弃抓取的数据包。

ip access-list extended BUF-FILTER <<<<<<定义流量的src&dst地址

  permit ip host 192.168.1.1 host 172.16.1.1

  permit ip host 172.16.1.1 host 192.168.1.1

monitor capture buffer BUF filter access-list BUF-FILTER  <<<<<<关联ACL到BUF

monitor capture point ip cef P fastethernet 0 both <<<<<<定义要抓取的接口,方向,交换方式

monitor capture point associate P BUF <<<<<<定义一个名为“P”的capture point并关联buffer参数

monitor capture point start P  <<<<<<开启monitor capture

....            <<<<<<抓取过程

monitor capture point stop P <<<<<<停止抓取

直接在设备上查看抓取的信息:(但是看到的是16进制的方式)

show monitor capture buffer BUF dump

我们可以通过如下方式去查看:

1、导出为wireshark可读文件(通过FTP/TFTP)。

monitor capture buffer BUF export tftp://10.1.1.1/BUF.pcap

其他:当信息收集完毕之后,删除capture:

no monitor capture point ip cef P fastethernet 0 both

no monitor capture buffer BUF

注意:在IOS 15.0(1)M之前,buffer size被限制为512K,报文大小被限制为1024 Byte。抓取的信息存在DRAM中,不能存到NVRAM中,且重启后消失。另外,可以定义在某接口抓取或者全局抓取。

关于IOS-XE的EPC

配置步骤如下:

1、定义抓取的位置。

2、关联一个过滤信息,这里可以直接指定,也可以跟ACL或者route-map。

3、开启抓取。

...

4、停止抓取。

5、查看抓取的摘要信息或详细信息。

6、可以到处抓取的信息。

7、操作完毕,移除capture。

配置示例:

monitor capture C interface GigabitEthernet 0/0/1 both

monitor capture C match ipv4 protocol tcp any any

monitor capture C start

...

monitor capture C stop

查看抓取的信息:

show monitor capture C buffer brife

show monitor capture C buffer detailed

导出抓取的文件:

monitor capture C export tftp://10.0.0.1/C.pcap

移除capture:

no monitor capture C

注意:capture可以在物理接口,子接口和tunnel接口执行;目前不支持NBAR。

排查IOS-XE的EPC配置,如下debug可以确保正确的设置EPC:

debug epc provision

debug epc capture-point

相关链接1:Embedded Packet Capture Configuration Guide, Cisco IOS Release 15M&T

https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/epc/configuration/15-mt/epc-15-mt-book/nm-packet-capture.html?referring_site=RE&pos=3&page=https://www.cisco.com/c/en/us/support/docs/ios-nx-os-software/ios-embedded-packet-capture/116045-productconfig-epc-00.html

相关链接2:Embedded Packet Capture Configuration Guide, Cisco IOS XE Release 3S

https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/epc/configuration/xe-3s/epc-xe-3s-book.html?referring_site=RE&pos=2&page=https://www.cisco.com/c/en/us/support/docs/ios-nx-os-software/ios-embedded-packet-capture/116045-productconfig-epc-00.html

Embedded Packet Capture (EPC)的更多相关文章

  1. 无Root抓包:Packet Capture 1.2.3

    无Root抓包:Packet Capture 1.2.3 http://www.coolapk.com/apk/app.greyshirts.sslcapture

  2. configure: error: The LBL Packet Capture Library, libpcap, was not found!

    configure: error:  The LBL Packet Capture Library, libpcap, was not found! yum install libpcap*

  3. 手机抓包HTTPS (Fiddler & Packet Capture)

    手机抓包HTTPS (Fiddler & Packet Capture) 以前写了一个小游戏(消灭病毒)的刷金币小脚本,使用需要获取openid ,就需要抓微信的HTTPS包 一直都是用Fid ...

  4. packet Capture 手机抓包工具

    packet Capture packet Capture 是一款免root的app, 运行在安卓平台上,用于捕获http/https网络流量嗅探的应用程序 特点: 捕获网络数据包,并记录太慢,使用中 ...

  5. packet capture

    1.下载地址:https://www.coolapk.com/apk/app.greyshirts.sslcapture

  6. Cisco IOS Debug Command Reference Command E through H

    debug eap through debug he-module subslot periodic debug eap : to display information about Extensib ...

  7. ISR4K-IOS XE EPC

    1.该操作在ISR4K的平台操作,简单的执行了一个控制层面的抓包 配置命令: R01#monitor capture A control-plane both R01#monitor capture ...

  8. LTE Module User Documentation(翻译8)——核心网(EPC)

    LTE用户文档 (如有不当的地方,欢迎指正!) 14 Evolved Packet Core (EPC)   我们现在讲解如何编写一个仿真程序——除了 LTE 无线接入网外,还允许仿真 EPC. EP ...

  9. [转]Getting a Packet Trace

    src:https://developer.apple.com/library/mac/qa/qa1176/_index.html Technical Q&A QA1176 Getting a ...

随机推荐

  1. Atcoder Beginner Contest 155D(二分,尺取法,细节模拟)

    二分,尺取法,细节模拟,尤其是要注意a[i]被计算到和a[i]成对的a[j]里时 #define HAVE_STRUCT_TIMESPEC #include<bits/stdc++.h> ...

  2. Ehab and a Special Coloring Problem

    You're given an integer nn. For every integer ii from 22 to nn, assign a positive integer aiai such ...

  3. setInterval 和 setTimeout 定时器

    前端定时器 setInterval 和 setTimeout setInterval 循环执行 循环执行就是设置一个时间间隔,每过一段时间都会执行一次这个方法,直到这个定时器被销毁掉. 用法是setI ...

  4. Unity相机跟随

    固定相机跟随 这种相机有一个参考对象,它会保持与该参考对象固定的位置,跟随改参考对象发生移动 using UnityEngine; using System.Collections; public c ...

  5. js实现图片轮播图

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...

  6. code ELIFECYCLE 报错处理

    npm ERR! code ELIFECYCLEnpm ERR! errno 1npm ERR! m-kbs-vip@1.2.12 toserver: `tua -p toserver`npm ERR ...

  7. bootstrap的网格控制

    <div class="container-fluid row m-0 p-0"> <div class="col-2 border"> ...

  8. vue中的回到顶部

    <template> <div class="main"> <div class="content">灰色部分是内容部分&l ...

  9. 脚手架搭建的react中使用bootstrap

    1.在react的index.html文件中加个jQuery的引入 <script src="http://cdn.bootcss.com/jquery/3.3.1/jquery.mi ...

  10. Python格式化字符串知多少

    字符串格式化相当于字符串模板.也就是说,如果一个字符串有一部分是固定的,而另一部分是动态变化的,那么就可以将固定的部分做成模板,然后那些动态变化的部分使用字符串格式化操作符(%) 替换.如一句问候语: ...