Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
From: "gaston" <gaston@steel.com.ar>
To: lartc@vger.kernel.org
Subject: [LARTC] Ip traffic accounting and HTB
Date: Wed, 10 Sep 2003 15:05:30 +0000	[thread overview]
Message-ID: <marc-lartc-106321599216295@msgid-missing> (raw)
In-Reply-To: <marc-lartc-106321889022216@msgid-missing>

Hi, I'm using HTB for bandwidth control, but i'm still not sure how to
account the traffic. My config is the following: eth0 goes to internet and
eth1 to the clients(I'm shaping both ifaces). I want to log ip traffic
from and to the clients. Since htb shapes outgoing traffic I'm not sure
how to make the iptables script.

This is the script:

${IPTABLES} -N ZORBCOUNTIN
  ${IPTABLES} -A ZORBCOUNTIN    
  ${IPTABLES} -N ZORBCOUNTOUT
  ${IPTABLES} -A ZORBCOUNTOUT
  ${IPTABLES} -I INPUT  -i $IFACE -j ZORBCOUNTIN  
  ${IPTABLES} -I OUTPUT -o $IFACE -j ZORBCOUNTOUT    
  ${IPTABLES} -N ZORBCOUNT
  ${IPTABLES} -I FORWARD -s $NET -o $IFACE -j ZORBCOUNT
  ${IPTABLES} -I FORWARD -d $NET -i $IFACE -j ZORBCOUNT  		    
  
grep "^" $IPS | while read IP;
	do
     ${IPTABLES} -A ZORBCOUNT -s $IP
     ${IPTABLES} -A ZORBCOUNT -d $IP
    done;
  ${IPTABLES} -A ZORBCOUNT -s $NET
  ${IPTABLES} -A ZORBCOUNT -d $NET







Does iptables count the shaped traffic or the whole traffic without shaping?
which interface should i use in the iptables script, eth0 or eth1 ? 

Thank you.

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

      reply	other threads:[~2003-09-10 15:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-10 15:04 [LARTC] Ip traffic accounting and HTB gaston
2003-09-10 15:05 ` gaston [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-lartc-106321599216295@msgid-missing \
    --to=gaston@steel.com.ar \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox