Wireshark is a free and open-source packet analyzer. It is used for network troubleshooting, analysis, software and communications protocol development, and education.
Install the package for the Wireshark GUI or for just the
Capturing as normal user
Do not run Wireshark as root, it is insecure. Wireshark has implemented privilege separation.
/usr/bin/dumpcap can only be executed by root and members of the
Therefore to use Wireshark as a normal user you just have to add your user to the
wireshark user group:
# gpasswd -a username wireshark
Re-login to apply the change.
A few capturing techniques
Filtering TCP packets
If you want to see all the current TCP packets, type
tcp into the "Filter" bar or in the CLI, enter:
$ tshark -f "tcp"
Filtering UDP packets
If you want to see all the current UDP packets, type
udp into the "Filter" bar or in the CLI, enter:
$ tshark -f "udp"
Filter packets to a specific IP address
- If you would like to see all the traffic going to a specific address, enter display filter
ip.dst == 18.104.22.168, replacing
22.214.171.124with the IP address the outgoing traffic is being sent to.
- If you would like to see all the incoming traffic for a specific address, enter display filter
ip.src == 126.96.36.199, replacing
188.8.131.52with the IP address the incoming traffic is being sent to.
- If you would like to see all the incoming and outgoing traffic for a specific address, enter display filter
ip.addr == 184.108.40.206, replacing
220.127.116.11with the relevant IP address.
Exclude packets from a specific IP address
ip.addr != 18.104.22.168
Filter packets to LAN
To only see LAN traffic, no internet traffic run
ip.src==192.168.0.0/16 and ip.dst==192.168.0.0/16
Filter packets by port
See all traffic on 2 ports or more: