Re: Packets Counting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



M. A. Imam wrote:

Hi,

How can i count the number of packets on an interface evry 2 or 5 seconds. and i want to count only specific packets like only arriving packets from port 5001

Any ideas...

Muhammad




iptables -L -v will show packet counts and byte counts on rules so, using your specific example and assuming you meant tcp port 5001

First create a matching rule that has no target
#  iptables -I INPUT 1 -p tcp --dport 5001

Then, every x seconds run
iptables -L -v -n
and parse out the counter of interest.

Hope that helps,
SCampbell






[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux