Forrest logo
tool overview
On this page you find all important commands for the CLI tool tcpdump. If the command you are looking for is missing please ask our AI.

tcpdump

Tcpdump is a popular command line tool used for network packet analysis and troubleshooting. It allows users to capture and examine network traffic in real-time. Here are some key points about tcpdump:

  1. Tcpdump is available on various operating systems, including Linux, macOS, and Windows.
  2. It operates by capturing packets from a network interface or reading packets from a previously saved capture file.
  3. Tcpdump uses the libpcap library to capture and process network packets.
  4. It supports a wide range of protocols, including TCP, UDP, ICMP, IP, HTTP, FTP, SSH, DNS, and many more.
  5. Tcpdump provides detailed information about captured packets, including source and destination IP addresses, port numbers, packet lengths, protocol flags, and payload data.
  6. It allows users to apply filters to capture specific types of traffic based on various criteria, such as source/destination IP addresses, port numbers, protocols, packet sizes, and more.
  7. Tcpdump can be run with numerous options, allowing users to control the level of packet detail, output format, and other functionalities.
  8. The captured packets can be displayed on the terminal or saved to a file for later analysis.
  9. Tcpdump also supports packet visualization using Wireshark, a popular GUI-based packet analysis tool.
  10. It is widely used by network administrators, security professionals, and system troubleshooters to diagnose network-related issues, monitor network activity, analyze security incidents, and perform traffic analysis.

List of commands for tcpdump:

  • tcpdump:tldr:3594a tcpdump: Read from a given dump file.
    $ tcpdump -r ${dumpfile-pcap}
    try on your machine
    explain this command
  • tcpdump:tldr:52c23 tcpdump: Capture all traffic except traffic over port 22 and save to a dump file.
    $ tcpdump -w ${dumpfile-pcap} port not ${22}
    try on your machine
    explain this command
  • tcpdump:tldr:571f3 tcpdump: Capture the traffic of a specific interface.
    $ tcpdump -i ${eth0}
    try on your machine
    explain this command
  • tcpdump:tldr:72d9b tcpdump: Capture the traffic from a specific interface, source, destination and destination port.
    $ tcpdump -i ${eth0} src ${192-168-1-1} and dst ${192-168-1-2} and dst port ${80}
    try on your machine
    explain this command
  • tcpdump:tldr:85192 tcpdump: Capture the traffic from or to a host.
    $ tcpdump host ${www-example-com}
    try on your machine
    explain this command
  • tcpdump:tldr:98770 tcpdump: List available network interfaces.
    $ tcpdump -D
    try on your machine
    explain this command
  • tcpdump:tldr:b9a9f tcpdump: Capture the traffic of a network.
    $ tcpdump net ${192-168-1-0-24}
    try on your machine
    explain this command
  • tcpdump:tldr:dfe6a tcpdump: Capture all TCP traffic showing contents (ASCII) in console.
    $ tcpdump -A tcp
    try on your machine
    explain this command
tool overview