This program allows you to dump the traffic on a network. tcpdump is able to
examine IPv4, ICMPv4, IPv6, ICMPv6, UDP, TCP, SNMP, AFS BGP, RIP, PIM, DVMRP,
IGMP, SMB, OSPF, NFS and many other packet types.
It can be used to print out the headers of packets on a network interface,
filter packets that match a certain expression. You can use this tool to track
down network problems, to detect attacks or to monitor network activities.
This snap is not maintained by https://www.tcpdump.org/ and instead packages
the deb of tcpdump from the Ubuntu archive as a snap. Please see the developer
website (below) for details.
$ sudo tcpdump
tcpdump will drop privileges to the snap_daemon user and group by default. To write out captures, the /var/snap/tcpdump/common/captures directory is created with snap_daemon ownership. Eg:
For versions of Ubuntu between 14.04 LTS (Trusty Tahr) and 15.10 (Wily Werewolf), as well as Ubuntu flavours that don’t include snap by default, snap can be installed from the Ubuntu Software Centre by searching for snapd.
Alternatively, snapd can be installed from the command line:
sudo apt update
sudo apt install snapd
Either log out and back in again, or restart your system, to ensure snap’s paths are updated correctly.
To install tcpdump, simply use the following command: