# Any built-in function for dump switch traffic as .pcap file?

**URL:** <https://forum.p4.org/t/any-built-in-function-for-dump-switch-traffic-as-pcap-file/1184>\
**Category:** Getting Started with P4\
**Created:** [May 6, 2024, 1:11pm UTC](https://forum.p4.org/t/any-built-in-function-for-dump-switch-traffic-as-pcap-file/1184 "2024-05-06T13:11:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![p4newbee](https://avatars.discourse-cdn.com/v4/letter/p/7ea924/32.png) [@p4newbee](https://forum.p4.org/u/p4newbee)\
**Post date:** [May 6, 2024, 1:11pm UTC](https://forum.p4.org/t/any-built-in-function-for-dump-switch-traffic-as-pcap-file/1184/1 "2024-05-06T13:11:19Z")

</div>

The bmv2 + mininet setup in [p4lang/tutorials](https://github.com/p4lang/tutorials) repo can preserve the`.pcap` files of ingress/egress traffic on each port of the switch and host. How can I achieve the same within [this](https://github.com/jafingerhut/p4-guide/) repo?

One workaround seems to be manually run the `tcpdump` for capturing traffic on the veth.

Thanks!
