#!/bin/bash
iptables -t mangle -D FORWARD -i eth0 -j STAT >/dev/null 2>&1
iptables -t mangle -D FORWARD -o eth0 -j STAT >/dev/null 2>&1
iptables -t mangle -D INPUT -i eth0 -j STAT >/dev/null 2>&1
iptables -t mangle -D INPUT -o eth0 -j STAT >/dev/null 2>&1
iptables -t mangle -D OUTPUT -i eth0 -j STAT >/dev/null 2>&1
iptables -t mangle -D OUTPUT -o eth0 -j STAT >/dev/null 2>&1
iptables -t mangle -F STAT >/dev/null 2>&1
iptables -t mangle -X STAT >/dev/null 2>&1
iptables -t mangle -N STAT
iptables -t mangle -I FORWARD -o eth0 -j STAT
iptables -t mangle -I FORWARD -i eth0 -j STAT
iptables -t mangle -I INPUT -o eth0 -j STAT
iptables -t mangle -I INPUT -i eth0 -j STAT
iptables -t mangle -I OUTPUT -o eth0 -j STAT
iptables -t mangle -I OUTPUT -i eth0 -j STAT
iptables -t mangle -A STAT -d 192.168.0.2
iptables -t mangle -A STAT -s 192.168.0.2
iptables -t mangle -A STAT -d 192.168.0.3
iptables -t mangle -A STAT -s 192.168.0.3
tak powinno to wygladac aby wspolpracowalo ze squidem.
jednak owe bałwan jestem sa zle ulozone !!! autor stats nie bardzo wiedzial co robi.
na forum jest skrypt zamieszczony przeze mnie, wyciagajacy wszystkie ip z pliku hosts i dla tych ip zliczane sa statsy - jest to lepsze rozwiazanie, uwzgledniajace rowniez squida.
http://forum.freesco.pl/viewtopic.php?p=75703#75703
a to wsadz sobie gdzie indziej:)
iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 80 -j REDIRECT --to-port 3128