Servers tcpdump for Network Troubleshooting

tcpdump for Network Troubleshooting




Juliet Kemp

tcpdump is a packet sniffer — it captures the network packets (traffic) that pass through a machine, enabling you to examine and analyze the traffic afterward. It is capable of becoming very complex, but the basics are pretty straightforward and useful for network troubleshooting.

Tip of the Trade: tcpdump is a packet sniffer that starts off simple and scales in both complexity and power.

To invoke it, you must be root. The absolute basic command is just tcpdump, which captures every package into or out of the system and print a line of text to standard out. This is great if you’re directly logged into a machine, but not so good if you’re using ssh because every time tcpdump prints to stdout, it sends a packet with this information across the sshconnection, producing another packet whose information is printed to stdout, which is then sent across ssh … and so on. So to filter out ssh packets, try:

tcpdump not port 22

The output will start with a precise timestamp, identify the packet as IP or as a type of TCP, and then give source and destination (both with port), followed by some packet information. Check the man page for more detail.

12:28:02.958545 IP client.example.com.59713 > ldap.example.com.ldaps: P
   170:367(197) ack 149 win 60 

There are also options to, among other things: Turn off name resolution; specify a particular network interface; get a sample of packets then exit; capture output to a file; replay information from a file; and do packet match filtering. Check the manpage for further information.

Latest Posts

How to Convert a Physical Computer to a Virtual Machine

Many organizations are implementing virtualization technology into their networks to convert physical computers to virtual machines (VM). This helps reduce overall physical hardware costs,...

HPE ProLiant DL380 Gen10: Rack Server Overview and Insight

The HPE ProLiant DL380 series has consistently been a market leader in the server space. The Gen10 released in 2017 further increased HPE's market...

Best Server Management Software & Tools 2021

Finding the best server management software tools for your organization can have a major impact on the success of your business operations. Manually handling...

IBM AS/400: Lasting the Test of Time

Some server operating systems (OS) were built to survive the test of time – the IBM AS/400 is one such system.  The AS/400 (Application System/400)...

What is Disaster Recovery?

The modern organization's heavy dependence on using data to drive their business has made having a Disaster Recovery (DR) plan in place a necessity....

Related Stories