LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   iptables help (https://www.linuxquestions.org/questions/linux-newbie-8/iptables-help-92988/)

ribbones 09-15-2003 10:11 AM

iptables help
 
Hi !

When i run "iptables -L" it doesn't show all rules.
It stopps just before this rule is suppose come up

"/sbin/iptables -A INPUT -s 192.168.0.0/24 -d 192.168.0.0/24 -i eth0 -p tcp --dport 137:139 -j ACCEPT"

So it doesn't show my output and forward rules. I have to break (or what do you call CTRL+C) to come to the shell agian.
If i remove this line every thing works fine.

My Script

#! /bin/bash
/sbin/iptables -F
/sbin/iptables -X
/sbin/iptables -P INPUT DROP
/sbin/iptables -P OUTPUT ACCEPT
/sbin/iptables -P FORWARD DROP
/sbin/iptables -A INPUT -i eth0 -p tcp --dport 22:22 -j ACCEPT
/sbin/iptables -A INPUT -i eth0 -p tcp --dport 20:21 -j ACCEPT
/sbin/iptables -A INPUT -i eth0 -p tcp --dport 80:80 -j ACCEPT
/sbin/iptables -A INPUT -s 192.168.0.0/24 -d 192.168.0.0/24 -i eth0 -p tcp --dport 137:139 -j ACCEPT

ribbones 09-15-2003 10:32 AM

I made some changes so it works now ..
thanks anyway !

(The changes if anyone cares)

#! /bin/bash
iptables -F
iptables -X
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
iptables -A OUTPUT -m state --state NEW -j ACCEPT
iptables -A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 20:21 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 22:22 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 80:80 -j ACCEPT
iptables -A INPUT -s 192.168.0.0/24 -d 192.168.0.0/24 -i eth0 -p tcp --dport 137:139 -j ACCEPT


All times are GMT -5. The time now is 09:59 PM.