Book Image

Troubleshooting Ubuntu Server

By : Skanda Bhargav
Book Image

Troubleshooting Ubuntu Server

By: Skanda Bhargav

Overview of this book

Table of Contents (16 chapters)
Troubleshooting Ubuntu Server
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Network sniffing with tcpdump


Network administrators can use sniffers to discover network issues and to monitor the network traffic. This information can be used to identify packets that are having errors, thereby getting to the root of problems and solving it to have an efficient network.

A packet sniffer captures all the data that is being transmitted through a network interface. Let's use tcpdump, which is a command-line tool for network sniffing.

Capturing packets from eth0

The tcpdump command can be used to capture packets from a particular interface. The following command will help us capture the packets on the eth0 interface:

sudo tcpdump –i eth0

I initiated a ping from this machine (192.168.1.100) to another machine (192.168.1.8) in the same network. After running the preceding command, you will see a screen similar to the one in the following screenshot:

Here, we see the ICMP requests and replies. We see the source and destination IPs, ID, sequence, and length of each packet. These...