Values taken from ifconfig shows same values as my firewall :)
Why

On 3/1/07, CapSel <[EMAIL PROTECTED]> wrote:

I'm trying to count bandwidth and number of packets on my router with
rules like:

iptables -t mangle -A PREROUTING -i eth0 -j stats
iptables -t mangle -A POSTROUTING -o eth0 -j stats

iptables -t mangle -A stats -p tcp -s $ip -j ACCEPT
iptables -t mangle -A stats -p udp -s $ip -j ACCEPT
iptables -t mangle -A stats -p icmp -s $ip -j ACCEPT

iptables -t mangle -A stats -p tcp -d $ip -j ACCEPT
iptables -t mangle -A stats -p udp -d $ip -j ACCEPT
iptables -t mangle -A stats -p icmp -d $ip -j ACCEPT

Chain stats has policy set to ACCEPT.

My script reads these values every minute and sets them to zero.
The problem is that numbers of packets are more than twice greater than
iptraf shows, but bandwidth seems to be correct. Of course I divide those
numbers by 60 to get value per second.

Why this difference is so big, what could I done wrong?

Reply via email to