Embedded Packet Capture (EPC)
Cisco Embedded Packet Capture (EPC) is a built-in IOS-XE feature that lets routers capture live traffic passing through their interfaces. It’s especially useful for debugging and protocol analysis without requiring external devices or taps.
Captures are stored in DRAM and are cleared on reload unless exported.
Use Cases
Section titled “Use Cases”- Troubleshooting NAT, routing, or ACL behavior
- Capturing malformed packets
- Verifying protocol behavior (DHCP, HSRP, etc.)
- Capturing traffic during flaps or intermittent failures
Capture Workflow
Section titled “Capture Workflow”- Create a capture buffer
- (Optional) Apply a filter using an ACL
- Create a capture point (interface + direction)
- Start the capture
- Stop and view/export the capture
Step 1: Create a Capture Buffer
Section titled “Step 1: Create a Capture Buffer”monitor capture MYCAP buffer circular size 100size: Total buffer size in MBcircular: Continues capturing and overwrites oldest data- Use
linearinstead ofcircularif you want capturing to stop when the buffer is full
Step 2: Filter with Match or ACL
Section titled “Step 2: Filter with Match or ACL”ip access-list extended PACKET_FILTER permit ip host 192.168.12.1 host 192.168.23.3
monitor capture MYCAP access-list PACKET_FILTER
...or...
monitor capture MYCAP match anyStep 3: Create a Capture Point
Section titled “Step 3: Create a Capture Point”monitor capture MYCAP interface FastEthernet0/1 bothboth: Capture ingress and egress- Other options:
in,out
Step 4: Start and Stop the Capture
Section titled “Step 4: Start and Stop the Capture”monitor capture MYCAP start...monitor capture MYCAP stopStep 5: View or Export
Section titled “Step 5: View or Export”View packets directly on the router:
show monitor capture MYCAP buffershow monitor capture MYCAP buffer briefshow monitor capture MYCAP buffer dumpExport to a TFTP server for Wireshark analysis:
monitor capture MYCAP export tftp://10.100.2.120/capture.pcapOptional Combination
Section titled “Optional Combination”monitor capture MYCAP buffer size 100 circular interface G1 both match any start- EPC captures are volatile; they are lost on reload.
- Only one capture per interface/direction is supported at a time.
- You must have CEF enabled on the target interfaces.
- Capture can be done using L2, IP, or ACL filters.