Click to See Complete Forum and Search --> : IPTABLES? what the....


mentalfloss
01-13-2002, 05:50 AM
I am running mandrake 8.1

I got this iptables setup in in a file located in /etc/configsys/iptables works fine except for somethings like --dport give my a bad argument.

but it works fine if I input directly

so, built this little script but it doesn't want to take that either. gives me bad argument DROP and ECCEPT

#!/bin/sh

echo "setting Iptable rules!"
# Clear tables
iptables=/sbin/iptables
$iptables -F
$iptables -t nat -F

# FILTER

$iptables -A INPUT -p tcp -i eth1 -j DROP
$iptables -A INPUT -p icmp -i eth1 -j DROP
$iptables -A INPUT -p udp -i eth1 -j DROP
#iptables -A INPUT -p tcp --dport 80 -j ACCEPT
#iptables -A INPUT -p tcp --dport 22 -j ACCEPT
#iptables -A INPUT -p tcp --dport 21 -j ACCEPT
$iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
$iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
$iptables -P OUTPUT ACCEPT

# NAT
$itpables -t nat -A POSTROUTING -o eth1 -j MASQUERADE


what the heck am I doing wrong.

jumpedintothefire
01-13-2002, 11:11 AM
#iptables -A INPUT -p tcp --dport 80 -j ACCEPT

Think you need to state an ip address to use --dport

try:

iptables -A INPUT -p tcp -d xxx.xxx.xxx.xxx --dport 80 -j ACCEPT