Networking/Computing Tips/Tricks

One of the utilities that is included in your Wireshark distribution is a command line tool called 'mergecap'.  We use this tool to merge multiple captures generated, let's say, from a ring buffer capture (you can see how to do ring buffer captures using T-Shark here).

Alright, so let's say you have a ring buffer capture, as I do:


There are two options for merging these files:

  1. Open the oldest one in the Wireshark GUI, and then methodically use the File> Merge option for the rest of the files (in order).  Wireshark will merge them.
  2. Use the 'mergecap' command line tool.

This article shows how to use the mergecap tool using Windows, but you should be able to follow the exact step by step on Linux and MAC.

Begin by opening the Command Line (or terminal) window, and change directory to the C:/Program Files/Wireshark> directory as shown:


From this location you can view the mergecap help by typing "mergecap -h":


There are several options for concatenation, truncation, etc.  We will keep it simple and merge the files that were part of the ring buffer shown above.

To make my command easier, I renamed the filenames to ring2 - ring11:



Our command is: 'mergecap -w c:\mycaptures\mergedfile.pcap c:\mycaptures\ring2.pcap c:\mycaptures\ring3.pcap c:\mycaptures\ring4.pcap c:\mycaptures\ring5.pcap c:\mycaptures\ring6.pcap c:\mycaptures\ring7.pcap c:\mycaptures\ring8.pcap c:\mycaptures\ring9.pcap c:\mycaptures\ring10.pcap c:\mycaptures\ring11.pcap'


My system completed the task almost instantaneously.  If you are working with larger files, this will not be the case, but it will still be lightning fast.  You can add the '-v' verbose switch if you want to see things are hapenning.

OK - let's see the results!  First we see the newly created file:


Now this file can be openned in the Wireshark GUI.

You can see more information here:

Happy packet sniffing.

Comments powered by CComment

Find by Tag

4G Networks 5G Networks 6LoWLAN 6LoWPAN 802.11 802.11ah 802.11ax 802.11ay 802.11az Addressing Analysis Ansible Architecture ARP AToM Baseline BGP Bloom's Taxonomy Broadband Cable cat CellStream Cellular Central Office Cheat Sheet Chrome Cisco Cloud CMD Coloring Rules Computer Consulting Customer Support Data Center Data Networking DHCPv6 DNS Docker Documentation Dublin-Traceroute dumpcap ECMP Ethernet Ethics Field Operations Fragmentation G-MPLS GeoIP Git GNS3 Google GQUIC Hands-On History Home Network ICMP ICMPv6 IEEE 802.11p IEEE 802.15.4 Interface Control Internet IoT IPsec IPv4 IPv6 IRINN IS-IS L2VPN L3VPN LDP Linux LLN LoL M-BGP MAC Macro Microsoft mininet Monitoring MPLS mtr MTU Multicast Name Resolution Netcat Netmiko NetMon netsh Networking Network Science nmap Npcap NSE Observations Online School OpenFlow OSPF OSPFv2 OSPFv3 OSX OTT Paris-Traceroute Parrot PIM PMTU Policy POTS POTS to Pipes PPP Profile Programming Project Management PW3E Python QoS QUIC Remote Desktop Requirements Resume RIP Routing RPL RSVP Rural SDN Security Service Provider Small Business SONET Speed SS7 SSH SSL Subnetting SYSCTL T-Shark TCP TCP/IP Telco Telecom 101 Telecommunications Telephone termshark Testing TLS Tools Traceroute Traffic Engineering Training Travel Tunnel Ubuntu Utility Video Virtualbox Virtualization VoIP VRF VXLAN WEP Wi-Fi Wi-Fi 4 Wi-Fi 5 Wi-Fi 6 Windows Winpcap Wireless Wireless 5G Wireshark Wireshark Tip WLAN WPA2 Writing Zenmap ZigBee

Twitter Feed