tcpdump
tcpdump is a command-line network traffic analyzer that dumps traffic on a network. It examines various packet types including IPv4, IPv6, TCP, UDP, and others.
Description
tcpdump allows users to dump traffic on a network and print out packet headers on a network interface. It supports filtering packets that match specific expressions, making it useful for tracking network problems, detecting attacks, or monitoring network activities.
The tool handles a wide range of protocols such as ICMPv4, ICMPv6, SNMP, AFS, BGP, RIP, PIM, DVMRP, IGMP, SMB, OSPF, NFS, and many others. This versatility enables detailed inspection of network communications for troubleshooting or security analysis.
tcpdump is lightweight with an installed size of 1.31 MB and depends on libraries like libc6, libpcap0.8t64, libssl3t64, and systemd components.
How It Works
tcpdump uses libpcap to capture packets from network interfaces. It examines IPv4, ICMPv4, IPv6, ICMPv6, UDP, TCP, SNMP, AFS, BGP, RIP, PIM, DVMRP, IGMP, SMB, OSPF, NFS, and other packet types, printing headers or filtering based on expressions. Version details include tcpdump 4.99.6 with libpcap 1.10.6 supporting TPACKET_V3 and OpenSSL 3.5.5.
Installation
sudo apt install tcpdumpFlags
Examples
tcpdump -htcpdump -i interfacetcpdump -r filetcpdump -w filetcpdump -s snaplentcpdump -c counttcpdump expression