Skip to contentSkip to conversation

Ip traffic accounting and HTB

LARTC gaston 1 participant 2 messages Sep 10, 2003

lore
Share & tools
lore

gaston

author
#0 lore raw

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 / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

author
#1 lore raw

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 / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/