Linux Netfilter discussions
 help / color / mirror / Atom feed
* Connection Stats per interface using iptables
@ 2007-11-05  8:09 Shyam Prasad
  2007-11-05 15:32 ` Grant Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Shyam Prasad @ 2007-11-05  8:09 UTC (permalink / raw)
  To: netfilter

Hi All,

I need to get statistics like 
Total outgoing connections
Total incomming connections
Total Connections dropped 
Total TCP ,UDP data
and other protocol stats on "PER INTERFACE" basis.

Is there a way to directly fetch these stats using
iptables rule or i
 have to create separate chains for each interface
,redirect the traffic
 to these interface specific chains and then calculate
the stats.

netstat -s gives me some info but it is the total info
on all
 interfaces but not on per interface basis...any
pointers ???

Regards,
Shyam.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Connection Stats per interface using iptables
  2007-11-05  8:09 Connection Stats per interface using iptables Shyam Prasad
@ 2007-11-05 15:32 ` Grant Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Grant Taylor @ 2007-11-05 15:32 UTC (permalink / raw)
  To: Mail List - Netfilter

On 11/05/07 02:09, Shyam Prasad wrote:
> Is there a way to directly fetch these stats using iptables rule or i 
> have to create separate chains for each interface ,redirect the 
> traffic to these interface specific chains and then calculate the 
> stats.

Yes you can use IPTables to gather this information for you.  IPTables 
its self does not keep track of this information, but you could easily 
write rules to act act as counters that you would then later check the 
number of packets they have matched.  You just need to add some rules to 
IPTables to match the input and / or the output interface and / or any 
other protocol information.

Depending on how many rules you are going to write, you may want to look 
at optimizing the rules a bit by creating a user defined chain for each 
interface.  With user defined chains you will not have to have packets 
traverse rules that they will never match.



Grant. . . .

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-11-05 15:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-05  8:09 Connection Stats per interface using iptables Shyam Prasad
2007-11-05 15:32 ` Grant Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox