[prev in list] [next in list] [prev in thread] [next in thread] 

List:       netfilter
Subject:    Re: Querry about contrack
From:       Athan <netfilter () miggy ! org>
Date:       2003-01-30 20:59:50
[Download RAW message or body]


On Thu, Jan 30, 2003 at 11:48:47AM -0800, Dhirendra Pal Singh wrote:
> Is it possible to find
> 
> A) number of packets recived and send,
> B) no of connections existing
> on the basis of port no.  ???
> 
> Does contrack keeps a track of it.. or something else...
> I think somwehere in /proc contrack keeps a list of the active 
> connections.. but I need the info to analyse it in my piece of c code.

   A simple "cat /proc/net/ip_conntrack | wc -l" will tell you how many
connections are currently being tracked.  This does include possibly
failed connections as well though ([UNREPLIED]), so some use of grep or
perl on the output is probably a good idea.

   As for the packets received/sent, you'd have to either set up
accounting targets per port (ick), or simply LOG every such packet and
then count the matching lines in the syslog file(s).  Ugh.

  Maybe ULOG or similar can be of help with this.


-Ath
-- 
- Athanasius = Athanasius(at)miggy.org / http://www.miggy.org/
                  Finger athan(at)fysh.org for PGP key
	   "And it's me who is my enemy. Me who beats me up.
Me who makes the monsters. Me who strips my confidence." Paula Cole - ME

[Attachment #3 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic