I'm trying to build some firewalls on a LM 8.0 box with kernel 2.4.7-12.3 
and iptables 1.2.2.  I'm trying to convert some rules I had on a 
2.2 box written with ipchains, based on what I read in O'Reilly's "Building Internet 
Firewalls".

What I can't fathom is why I can type in some rules at a root prompt, 
but when I put the identical rules in a shell script I get syntax errors!

for example, to open up the HTTP port (where XXX is my IP number) and close everything 
else:

iptables -A INPUT -p tcp -s 0/0 --sport 1024: -d XXX --dport 80 -j ACCEPT

iptables -A OUTPUT -p tcp -s XXX --sport 80 -d 0/0 --dport 1024: --tcp-flags ACK ACK 
-j ACCEPT

iptables -A OUTPUT -p tcp -s XXX --sport 1024: -d 0/0 --dport 80 -j ACCEPT

iptables -A INPUT -p tcp -s 0/0 --sport 80 -d XXX --dport 1024: --tcp-flags ACK ACK -j 
ACCEPT
 
iptables -A INPUT -i lo -j ACCEPT
 
iptables -A INPUT -p tcp -s 0/0 -d XXX -j DROP
When I put those in a bash script, I get errors like:

'ptables v1.2.2: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.

I'm sure it's something obvious, but I can't see it.  Any ideas?

Thanks for any help,

Dan




Make a difference, help support the relief efforts in the U.S.
http://clubs.lycos.com/live/events/september11.asp

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to