~/Capture Network Traffic with tcpdump
Sep 15, 2021
The tcpdump tool is a simple way to capture network packets on Unix-like systems. It provides a command line interface to monitor and analyze network traffic for troubleshooting or security purposes.
Install tcpdump using your package manager. For Ubuntu, run:
To capture all network traffic on interface eth0 and write it to a file:
|
|
Listen only for traffic on a specific port, such as HTTP on port 80:
|
|
Display only IP traffic:
|
|
Read and analyze captured data from a file:
|
|
For more filter examples and usage details, see the official documentation.
You need root privileges to use tcpdump on most systems.
Always respect privacy and legal guidelines when capturing network data.