Tcpdump Best Practices

List of interfaces on which tcpdump can listen:

[crayon-6684caa82e868576733967/]
Listen on interface eth0:
[crayon-6684caa82e872760694180/]
Listen on any available interface :
[crayon-6684caa82e874225773492/]
Be verbose while capturing packets:
[crayon-6684caa82e876993606673/]
More verbose while capturing packets:
[crayon-6684caa82e878225847775/]
Very verbose while capturing packets:
[crayon-6684caa82e87a065790490/]
Verbose and print the data of each packet in both hex and ASCII, excluding the link level header:
[crayon-6684caa82e87d007990505/]
Verbose and print the data of each packet in both hex and ASCII, also including the link level header:
[crayon-6684caa82e87f260994081/]
Less verbose (than the default) while capturing packets:
[crayon-6684caa82e881789547165/]
Limit the capture to 100 packets:
[crayon-6684caa82e883187911466/]
Record the packet capture to a file called capture.cap:
[crayon-6684caa82e885361013584/]
Record the packet capture to a file called capture.cap but display on-screen how many packets have been captured in real-time:
[crayon-6684caa82e887676946490/]
Display the packets of a file called capture.cap:
[crayon-6684caa82e889337517844/]
Display the packets using maximum detail of a file called capture.cap:
[crayon-6684caa82e88b599733213/]
Display IP addresses and port numbers instead of domain and service names when capturing packets
[crayon-6684caa82e88d954412469/]
Capture any packets where the destination host is 192.168.5.1. Display IP addresses and port numbers:
[crayon-6684caa82e88f538516314/]
Capture any packets where the source host is 192.168.5.1. Display IP addresses and port numbers:
[crayon-6684caa82e891509069456/]
Capture any packets where the source or destination host is 192.168.5.1. Display IP addresses and port numbers:
[crayon-6684caa82e893607935739/]
Capture any packets where the destination network is 192.168.5.0/24. Display IP addresses and port numbers:
[crayon-6684caa82e895408694779/]
Capture any packets where the source network is 192.168.1.0/24. Display IP addresses and port numbers:
[crayon-6684caa82e897204443632/]
Capture any packets where the source or destination network is 192.168.5.0/24. Display IP addresses and port numbers:
[crayon-6684caa82e899653073410/]
Capture any packets where the destination port is 23. Display IP addresses and port numbers:
[crayon-6684caa82e89b885706288/]
Capture any packets where the destination port is is between 1 and 1023 inclusive. Display IP addresses and port numbers:
[crayon-6684caa82e89d671489887/]
Capture only TCP packets where the destination port is is between 1 and 1023 inclusive. Display IP addresses and port numbers:
[crayon-6684caa82e8a0373388168/]
Capture only UDP packets where the destination port is is between 1 and 1023 inclusive. Display IP addresses and port numbers:
[crayon-6684caa82e8a2812174630/]
Capture any packets with destination IP 192.168.1.1 and destination port 23. Display IP addresses and port numbers:
[crayon-6684caa82e8a4722492385/]
Capture any packets with destination IP 192.168.5.1 and destination port 80 or 443. Display IP addresses and port numbers:
[crayon-6684caa82e8a6672748607/]
Capture any ICMP packets:
[crayon-6684caa82e8a8938660801/]
Capture any ARP packets:
[crayon-6684caa82e8aa702578225/]
Capture either ICMP or ARP packets:
[crayon-6684caa82e8ac479084081/]
Capture any packets that are broadcast or multicast:
[crayon-6684caa82e8ae644254224/]
Capture 500 bytes of data for each packet rather than the default of 68 bytes:
[crayon-6684caa82e8b0536428416/]
Capture all bytes of data within the packet:
[crayon-6684caa82e8b2974078035/]