Koozali.org: home of the SME Server

Help iptables...

Treco

Help iptables...
« on: January 28, 2003, 03:59:59 PM »
What i made wrong?
I need to put a counter traffic ip, i had used in php and perl and the script that adds ipchais to the iptables does not result ...
the proggy that im using for that is BW ACCT v0.9.4
the script is:

#!/bin/sh
EXTERNAL_INTERFACE="eth0"
IPTABLES="/sbin/iptables"
INTERNAL_HOSTS="
192.168.100.70
192.168.100.71
192.168.100.72
192.168.100.73
192.168.100.74
192.168.100.75
192.168.100.76
192.168.100.77
192.168.100.78
192.168.100.79
192.168.100.80
192.168.100.81
192.168.100.82
192.168.100.83
192.168.100.84
192.168.100.85
"

for HOST in $INTERNAL_HOSTS; do

 echo "Creating Chain for $HOST"
 $IPTABLES -N $HOST

 # incoming jump rule
 $IPTABLES -A FORWARD -o $EXTERNAL_INTERFACE -d $HOST -j $HOST

 # outgoing jump rule
 $IPTABLES -A FORWARD -i $EXTERNAL_INTERFACE -s $HOST -j $HOST

 # incoming accounting chain
 $IPTABLES -A $HOST -o $EXTERNAL_INTERFACE -d $HOST

 # outgoing accounting chain
 $IPTABLES -A $HOST -i $EXTERNAL_INTERFACE -s $HOST

done;


its adds at iptables but it doesnt work...
what im doing wrong??
i have to delete any rule?
how i make then???

my config is: 2 ethernets ... eth0 home lan ... eth1 internet

THX

Joey P

Re: Help iptables...
« Reply #1 on: January 29, 2003, 10:48:54 AM »
maybe it's because your external and internal interface
is inverted?


#!/bin/sh
EXTERNAL_INTERFACE="eth0"

my config is: 2 ethernets ... eth0 home lan ... eth1 internet


TRY:
#!/bin/sh
EXTERNAL_INTERFACE="eth1"