All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: IPTables counters
@ 2002-07-09 21:55 George Vieira
  0 siblings, 0 replies; 3+ messages in thread
From: George Vieira @ 2002-07-09 21:55 UTC (permalink / raw)
  To: 'Dotan Lior', 'netfilter@lists.samba.org'

[-- Attachment #1: Type: text/plain, Size: 1540 bytes --]

What I do is put the rule you want to count in the FORWARD chain... even
better use my counting method to be more accurate..
 
$IPTABLES -N COUNT
$IPTABLES -I INPUT 1 -j COUNT
$IPTABLES -I OUTPUT 1 -j COUNT
$IPTABLES -I FORWARD 1 -j COUNT
 
then add all you counters you require into the COUNT chain.. this is what
I'm currently doing for my scripts.. Also I'm rewriting my script to only
flush all chains BUT my counters so I don't lose them when I rerun my
firewall.. still in testing.......

thanks,
George Vieira
Systems Manager
Citadel Computer Systems P/L
http://www.citadelcomputer.com.au <http://www.citadelcomputer.com.au/> 

-----Original Message-----
From: Dotan Lior [mailto:Lior.Dotan@innowave-ws.com]
Sent: Tuesday, 09 July 2002 11:41 PM
To: 'netfilter@lists.samba.org'
Subject: IPTables counters



Hello, 

I have a simple setup. A linux RH7.3 box doing NAT and connected to the
internet with one windows2000 client sitting behind it. I've set up iptables
to NAT the windows internal address to a legal IP address.

So far it works well, However when I inspect the NAT table with "iptables -L
-t nat -v -n -x", 
the bytes counter shows extremely low values. I've transfer a 200Kb file via
FTP on the windows 
client, but the counter was less than 100 bytes. It seems as if only the
first packet of a connection 
is listed. 
Is there a way to see the real bytes count? Also I would to know the number
of bytes that traveled 
on both ways (from the client and to the client), is that also possible
using iptables? 

Thanks. 


[-- Attachment #2: Type: text/html, Size: 3400 bytes --]

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

* Re: IPTables counters
  2002-07-09 13:41 Dotan Lior
@ 2002-07-09 14:03 ` Antony Stone
  0 siblings, 0 replies; 3+ messages in thread
From: Antony Stone @ 2002-07-09 14:03 UTC (permalink / raw)
  To: 'netfilter@lists.samba.org'

On Tuesday 09 July 2002 2:41 pm, Dotan Lior wrote:

> Hello,
>
> So far it works well, However when I inspect the NAT table with "iptables
> -L -t nat -v -n -x", the bytes counter shows extremely low values. I've
> transfer a 200Kb file via FTP on the windows client, but the counter was
> less than 100 bytes. It seems as if only the first packet of a connection
> is listed.

That is correct.   Only the first packet goes through the listed NAT rules - 
the others go directly via the connection tracking table and not through the 
rules (for efficiency).

> Is there a way to see the real bytes count? Also I would to know the number
> of bytes that traveled on both ways (from the client and to the client), is
> that also possible using iptables?

Yes, simply look at the filter table (ie the default one) instead of the NAT 
table.

*All* packets pass through your filtering rules (that's why you need the 
rules for ESTABLISHED and RELATED packets), so just use

iptables -L -n -v -x without the -t nat option.

Remember you can create rules without targets if you want to see the 
packet/byte counters for them without doing anything else:

eg iptables -A FORWARD -i eth0
iptables -A FORWARD -i eth1

 

Antony.


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

* IPTables counters
@ 2002-07-09 13:41 Dotan Lior
  2002-07-09 14:03 ` Antony Stone
  0 siblings, 1 reply; 3+ messages in thread
From: Dotan Lior @ 2002-07-09 13:41 UTC (permalink / raw)
  To: 'netfilter@lists.samba.org'

[-- Attachment #1: Type: text/plain, Size: 717 bytes --]

Hello,

I have a simple setup. A linux RH7.3 box doing NAT and connected to the
internet with one windows2000 client sitting behind it. I've set up iptables
to NAT the windows internal address to a legal IP address.
So far it works well, However when I inspect the NAT table with "iptables -L
-t nat -v -n -x", 
the bytes counter shows extremely low values. I've transfer a 200Kb file via
FTP on the windows
client, but the counter was less than 100 bytes. It seems as if only the
first packet of a connection
is listed.
Is there a way to see the real bytes count? Also I would to know the number
of bytes that traveled
on both ways (from the client and to the client), is that also possible
using iptables?

Thanks.

[-- Attachment #2: Type: text/html, Size: 1384 bytes --]

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

end of thread, other threads:[~2002-07-09 21:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-09 21:55 IPTables counters George Vieira
  -- strict thread matches above, loose matches on Subject: below --
2002-07-09 13:41 Dotan Lior
2002-07-09 14:03 ` Antony Stone

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.