TCP Dump beginners guide

Janith malinga
2 min readFeb 7, 2023

--

TCP Dump is a powerful network packet analyzer tool that is used to capture and analyze network packets in real-time. It is widely used for network troubleshooting, security analysis, and performance optimization. In this article, we will discuss the basic commands and usage of TCP Dump.

  1. Capturing Packets: To start capturing packets, use the following command:
tcpdump -i <interface> -w <filename>

where, -i option specifies the network interface to capture packets, and -w option specifies the filename to store the captured packets.

2. Displaying Captured Packets: To display the captured packets on the screen, use the following command:

tcpdump -r <filename>

where, -r option specifies the filename to read the captured packets.

3. Displaying Packets with Filter: To display only specific packets, use the filter option with the following command:

tcpdump host <hostname/ip>

where, host option specifies the hostname or IP address to filter the packets.

4. Saving Filtered Packets: To save the filtered packets to a file, use the following command:

tcpdump host <hostname/ip> -w <filename>

5. Displaying Packets with Protocol Filter: To display only packets of a specific protocol, use the following command:

tcpdump <protocol>

where, protocol can be replaced with icmp, tcp, udp, etc.

6. Displaying Packets with Port Filter: To display only packets on a specific port, use the following command:

tcpdump port <port number>

where, port number is the port number to filter the packets.

7. Displaying Packets with Multiple Filters: To display packets with multiple filters, use the following command:

tcpdump host <hostname/ip> and port <port number>

These are the basic commands and usage of TCP Dump. TCP Dump is a powerful tool and can be used with many other options to capture and analyze network packets. With these basic commands, you can start using TCP Dump for network troubleshooting and performance optimization.

The following blog entry will delve into the usage of tcp dump commands and showcase some advanced techniques.

Introducing myself: I am a security consultant who specializes in safeguarding organizations from cyber threats and maintaining the security, accuracy and accessibility of their information systems.

--

--

Janith malinga
Janith malinga

Written by Janith malinga

Senior Cyber Security Engineer

No responses yet