LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-15-2003, 10:11 AM   #1
ribbones
LQ Newbie
 
Registered: Sep 2003
Posts: 9

Rep: Reputation: 0
Question 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
 
Old 09-15-2003, 10:32 AM   #2
ribbones
LQ Newbie
 
Registered: Sep 2003
Posts: 9

Original Poster
Rep: Reputation: 0
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
An error occured getting IPtables status from the command /etc/rc.d/init.d/iptables s CrazyMAzeY Linux - Newbie 10 08-12-2010 06:25 AM
Iptables - Couldn't load target `ACCPET':/lib/iptables/libipt_ACCPET.so: z00t Linux - Security 3 01-26-2004 03:24 AM
IPtables Log Analyzer from http://www.gege.org/iptables/ brainlego Linux - Software 0 08-11-2003 07:08 AM
iptables book wich one can you pll recomment to be an iptables expert? linuxownt Linux - General 2 06-26-2003 05:38 PM
My iptables script is /etc/sysconfig/iptables. How do i make this baby execute on boo ForumKid Linux - General 3 01-22-2002 08:36 AM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration