How to monitor/capture packets on Linux



Question: How do I monitor all traffic on a Linux host, or for a particular port?

Answer: You can use the application tcpdump, here are some examples:

Monitor a particular interface:

tcpdump -i eth0

Monitor a particular port:

tcpdump -i eth0 ‘port 9996’


 


 


Categories