How to know traffic to a specific port in linux

uday kiran picture uday kiran · May 10, 2012 · Viewed 28.8k times · Source

I am looking to find the traffic through a specific port for a time frame. For example, traffic through 3306 port for 10 seconds. Is there a way to find this information?

I see that "/sbin/ifconfig eth0 05" can be used to get information on total bytes but I am looking to find information about specific port's traffic.

Thanks in advance,

Answer

Rawkode picture Rawkode · May 10, 2012
tcpdump -i eth0 -s 1500 port 3306