TCP Dump and Features

TCPDUMP is often very helpful tool to analyse incoming/outgoing traffic on servers and it is mainly installed on many of our customers. Some basic usage examples are given below:

  • tcpdump -vvv -i any -s 0 -w /tmp/dump.cap host 91.202.39.1      //sniffs all incoming and outgoing packets from/to host 91.202.39.1
  • tcpdump -vvv -i any -s 0 -w /tmp/dump.cap host 91.202.39.1 and port 8080 //sniffs all incoming and outgoing packets from/to host 91.202.39.1 from port 8080
  • tcpdump -vvv -i any -s 0 -w /tmp/dump.cap dst host 91.202.39.1 //sniffs all outgoing packets to destination host 91.202.39.1
  • tcpdump -vvv -i any -s 0 -w /tmp/dump.cap src host 91.202.39.1 //sniff all incoming packets from source host 91.202.39.1
  • tcpdump -vvv -i eth0 -s 0 -w /tmp/dump.cap host 91.202.39.1 and port 8080 //sniffs all incoming and outgoing packets from/to host 91.202.39.1 from port 8080 on eth0 interface
  • -i parameter is used for selecting interface. -vvv parameter is used for full protocol decode. -w parameter is used for saving into file.
  • Output file can be taken to local PC and investigated via using wireshark tool.

Synchronize the system clock to Network Time Protocol (NTP) under Fedora or Red Hat Linux

The Network Time Protocol daemon (ntpd) program is a Linux operating system daemon. It sets and maintains the system time of day in synchronism with time servers (Mills).

You need to configure ntpd via /etc/ntp.conf configuration file. The file is well documented and you easily configure it.

Install ntpd

If ntpd is not installed use any one of the following command to install ntpd:

# yum install ntpOR# up2date ntp

Configuration

You should at least set following parameter in /etc/ntp.conf config file:

server <Time Server Name or IP Address>

For example, open /etc/ntp.conf file using vi text editor:

# vi /etc/ntp.conf

Locate server parameter and set it as follows:

server pool.ntp.org

Save the file and restart the ntpd service:

# /etc/init.d/ntpd start

You can synchronize the system clock to an NTP server immediately with following command:

# ntpdate pool.ntp.org

Output:

5 May 14:36:01 ntpdate[5257]: adjust time server 61.206.115.3 offset -0.343242 sec