Jump to content

Packet Capture on IOS Gateways

From wiki.oeser.name
  • limtit the captured traffic:
ip access-list extended BUF-FILTER
   permit ip host 192.168.1.1 host 172.16.1.1
   permit ip host 172.16.1.1 host 192.168.1.1
  • create the capture buffer:
monitor capture buffer BUF size 2048 max-size 1518
monitor capture buffer BUF filter access-list BUF-FILTER
  • create the capture point:
"ip process-switched" works bether for packets destinated to the router or created on the router. "IP cef" works for routed traffic. You can define multiple capture points associated with the same buffer.
monitor capture point ip process-switched POINT gi 0/0 both
monitor capture point associate POINT BUF
monitor capture point start POINT
  • Make some noice and verfify the buffer state:
show monitor capture buffer BUF parameters
Capture buffer BUF (linear buffer)
Buffer Size : 1048576 bytes, Max Element Size : 300 bytes, Packets : 4
Allow-nth-pak : 0, Duration : 0 (seconds), Max packets : 0, pps : 0
Associated Capture Points:
Name : BUF, Status : Inactive
Name : BUF2, Status : Active
  • collect the data:
monitor capture point stop POINT
monitor capture buffer BUF export tftp://10.1.1.1/BUF.pcap
  • before the next try:
monitor capture buffer BUF clear