Re: measure throughput?

From: Jose Maria Lopez Hernandez (jkerouac_at_bgsec.com)
Date: 03/31/05


Date: Thu, 31 Mar 2005 11:00:26 +0200

linuxnooby wrote:
> Thanks Jose
>
> what does this look like (assuming eth0 is outside interface)??
> also how do i view the counters??
>
>
> iptables -N DOWNLOADS
> iptables -A INPUT -i eth0 -j DOWNLOADS
> iptables -A FORWARD -i eth0 -j DOWNLOADS
> iptables -A DOWNLOADS -j RETURN
>
> iptables -N UPLOADS
> iptables -A OUTPUT -o eth0 -j UPLOADS
> iptables -A FORWARD -0 eth0 -j UPLOADS
> iptables -A UPLOADS -j RETURN

Yes, that's what I do. Then you can use iptables -L UPLOADS -xvn
to get the counters and you can use bash or perl to extract the
counters from the output of iptables.

If you are gonna use a lot of this kind of chains and you want
to check a lot of counters you better use a C program using
libiptc to check the counters, or it will be very slow.

> thanks
> Dave

Regards.

-- 
Jose Maria Lopez Hernandez
Director Tecnico de bgSEC
jkerouac@bgsec.com
bgSEC Seguridad y Consultoria de Sistemas Informaticos
http://www.bgsec.com
ESPAŅA
The only people for me are the mad ones -- the ones who are mad to live,
mad to talk, mad to be saved, desirous of everything at the same time,
the ones who never yawn or say a commonplace thing, but burn, burn, burn
like fabulous yellow Roman candles.
                 -- Jack Kerouac, "On the Road"


Relevant Pages

  • Re: iptables very slow after commit 784544739a25c30637397ace5489eeb6e15d7d49
    ... that the networking people are beign silly, and should not synchronize ... Userspace submits a table, checkentry is ... The fact that `iptables -A` is called a hundred times means you are ... The counters are 64-bit entities, ...
    (Linux-Kernel)
  • Re: iptables very slow after commit 784544739a25c30637397ace5489eeb6e15d7d49
    ... that the networking people are beign silly, and should not synchronize ... Userspace submits a table, checkentry is ... The fact that `iptables -A` is called a hundred times means you are ... The counters are 64-bit entities, ...
    (Linux-Kernel)
  • Re: measure throughput?
    ... iptables -A DOWNLOADS -j RETURN ... You just read the counters for that rule and you are done. ... > the ones who never yawn or say a commonplace thing, but burn, burn, burn ...
    (comp.os.linux.networking)
  • mrtg: my script
    ... this script reads iptables -L counters. ... everytime called shows more values. ... Should i clear counters after every call? ...
    (comp.os.linux.networking)
  • Re: measure throughput?
    ... > counters from the output of iptables. ... > bgSEC Seguridad y Consultoria de Sistemas Informaticos ... > mad to talk, mad to be saved, desirous of everything at the same time, ... > the ones who never yawn or say a commonplace thing, but burn, burn, burn ...
    (comp.os.linux.networking)