Sometimes it is necessary to inspect network traffic between two systems to debug transports or to see the network conditions that cause a problem. In these cases, it is possible that you will be asked by the Support representative to capture traffic between your Mule server and the external system for review.
To capture traffic between Mule and a different system, you might need to install and run a piece of software on the same computer that's running Mule. Once the capture files have been created, you should compress (zip) the capture files before attaching them to your support case.
Please, follow the instructions for the platform on which Mule is running.
Note: in all cases it is recommended to compress capture files with gzip after finishing the capture.
The software for packet capture is called tcpdump. You can install it through your system's package manager.
You can use it to capture all the traffic through a network interface to a file:
sudo tcpdump -i <interface> -s0 -vv -w <capture_file>
Examples:
$ sudo tcpdump -i eth0 -s0 -vv -w capture.cap
To finish the capture press Control-C.
$ sudo tcpdump -i eth0 -s0 -vv -w /tmp/capture.cap -n host 192.168.1.121
$ sudo tcpdump -i eth0 -s0 -vv -w capture.cap -n port 80
$ sudo tcpdump -i eth0 -s0 -vv -w capture.cap -n 'host 192.168.1.121 and port 80'
$ nohup sudo tcpdump -i eth0 -s0 -vv -C 256 -W 10 -w capture.pcap -n 'host <IP> and port <port>' > tcpdump.out 2>&1 &
$ nohup sudo tcpdump -i eth0 -s0 -vv -C 256 -W 10 -w capture.pcap -n 'host <IP> and port <port>' &
$ nohup sudo tcpdump -i any -s0 -vv -C 256 -W 10 -w capture.pcap -Z <username> -n 'host <IP> and port <port>' &
$ sudo tcpdump -i eth0 -s0 -vv -G 3600 -w 'capture-%y_%m_%d_%H_%M_%S'.pcap -Z root
(-G is seconds between rotation, -Z is root user and this flag resolves permission denied error while creating new files)
$ sudo tcpdump -i any -s0 -vv -C 10 -W 50 -w capture.pcap
(-C is size of capture file, -W is number of rollover files)
NOTE: For unattended captures we strongly recommend to set maximum file size and a number of rollover files
$ sudo tcpdump -i eth0 -s0 -vv -C 10 -W 5 -w capture.cap -n host 192.168.1.1 > out.txt 2>&1
$ sudo tcpdump -i any host www.google.com -s 64
For more complex filters please refer to tcpdump documentation.
TcpDump is installed by default with MacOS 10.4 and greater. You can use it in the same way as in other Unixes:
sudo tcpdump -i <interface> -s0 -vv -w <capture_file>
Example:
$ sudo tcpdump -i eth0 -s0 -vv -w capture.cap
If you prefer using a graphical interface, you can use Wireshark (link).
Here is a simple guide from the official website to getting started on the packet capture.
As mentioned in the following link:
"The Wireshark installer includes Npcap which is required for packet capture."
https://www.wireshark.org/docs/wsug_html_chunked/ChBuildInstallWinInstall.html#:~:text=The%20Wireshark%20installer%20includes%20Npcap,download.html%20and%20execute%20it.
According to https://npcap.com/:
"Npcap is the Nmap Project's packet capture (and sending) library for Microsoft Windows."
"Npcap began in 2013 as some improvements to the (now discontinued) WinPcap library, but has been largely rewritten since then with hundreds of releases improving Npcap's speed, portability, security, and efficiency."
You will need to download two installers. One is a special driver which allows the capture of network traffic using WinPCap. Once you have installed WinPcap, download WinDump.
Copy windump.exe to your Windows directory so that it is in the path. Once you have installed windump, open a command window and use the same syntax as before:
windump -s0 -vv -w capture-file.cap
WinDump will automatically capture traffic on the first network interface it finds. If you need to select a different interface, use "windump -D" to see all your system's network adapters and then use the name with the "-i" switch.
Example:
c:\> windump -i \Device\NPF_{B1CCEB2C-5112-4650-BD1C-D29C4E8CF844} -s0 -vv -w capture.cap
In all cases, you can interrupt the capture with Control-C.
001115091

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.