LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-29-2004, 12:44 PM   #1
iqbal
LQ Newbie
 
Registered: Jul 2004
Location: U.K.
Distribution: Fedora
Posts: 15

Rep: Reputation: 0
check my iptables


Hi,

Can someone check my iptables file. My fedora box is connected to broadband. Two more PCs are connected to Linux forming a small network. I can use internet from Linux but cannot use from other two windows PC. I guess something wrong with my iptables. If I use iptables -F, I can use internet from every PC. Below is my iptables file.

Thanks,

Iqbal

# Generated by iptables-save v1.2.8 on Fri Jul 9 18:08:07 2004
*nat
:PREROUTING ACCEPT [54:4675]
:POSTROUTING ACCEPT [1:241]
:OUTPUT ACCEPT [1:241]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Fri Jul 9 18:08:07 2004
# Generated by iptables-save v1.2.8 on Fri Jul 9 18:08:07 2004
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [57:4346]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A FORWARD -s 192.168.0.0/255.255.255.0 -j ACCEPT
-A FORWARD -d 192.168.0.0/255.255.255.0 -j ACCEPT
-A FORWARD -s ! 192.168.0.0/255.255.255.0 -j DROP
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -i eth0 -j ACCEPT
#-A RH-Firewall-1-INPUT -p icmp -m icmp -j ACCEPT
#-A RH-Firewall-1-INPUT -p icmp -m icmp anywhere -j ACCEPT
-A RH-Firewall-1-INPUT -p esp -j ACCEPT
-A RH-Firewall-1-INPUT -p ah -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Completed on Fri Jul 9 18:08:07 2004
 
Old 08-29-2004, 02:21 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Insufficient input :)

What's the set-up, is the linux-box equipped with two
NIC's, what is the broadband modem attached to,
how do the other machines talk to the modem?

Did you set-up a route on the Linux-box?

Thing is, if the linux-box is set-up as the router,
and you flush all rules the other shouldn't be able
to connect to the net either (unless you had more
than one non-private address [which you don't
appear to have]).


Cheers,
Tink

P.S.: Moved to networking
 
Old 08-29-2004, 03:32 PM   #3
iqbal
LQ Newbie
 
Registered: Jul 2004
Location: U.K.
Distribution: Fedora
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks for the response. Linux box has two nics, eth0, eth1. Broadband modem is attached to eth0. The setup is like

linux eth1 - 192.168.0.1
WS1 - 192.168.0.2
WS2 - 192.168.0.4

Internet sharing works fine when iptables are flushed.

I am not sure if I have set-up the linux box as router. (not sure how). I can remember that forwarding=yes (or 1) is set in one file (can't remember).
Hope this will give you some clue.

Thanks,

Iqbal
 
Old 08-29-2004, 03:53 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Internet sharing works fine when iptables are flushed.
Very odd :) ... it shouldn't.

Is the IP on eth0 static, too?

have a look here
http://easyfwgen.morizot.net/gen/index.php
 
Old 08-30-2004, 03:13 AM   #5
iqbal
LQ Newbie
 
Registered: Jul 2004
Location: U.K.
Distribution: Fedora
Posts: 15

Original Poster
Rep: Reputation: 0
ip on eth0 is not static. It is dynamic provided by isp.

I checked the link you gave but the generated lists/syntax are different from my one.
 
Old 08-30-2004, 03:22 AM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Do they work, though? :)
 
Old 08-30-2004, 05:34 AM   #7
iqbal
LQ Newbie
 
Registered: Jul 2004
Location: U.K.
Distribution: Fedora
Posts: 15

Original Poster
Rep: Reputation: 0
They work fine when I use iptables -F. Normally I can access internet only from linux box not from other PCs. I suspect something wrong in my iptables
 
Old 08-30-2004, 06:53 AM   #8
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
visit www.iptables-script.dk and generate a script for yourself.

u can add the followings into script if some services works on your gateway linux.
iptables -A INPUT -s 127.0.0.1 -j ACCPET
iptables -A INPUT -d 127.0.0.1 -j ACCPET
 
  


Reply



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
Can someone check my Iptables script fotoguy Linux - Security 2 01-25-2005 12:32 AM
How can I check for iptables? imsam Linux - Newbie 5 11-02-2004 03:55 PM
iptables won't let packets in - check please? Simon Bridge Linux - Security 3 01-26-2004 01:49 PM
iptables won't let packets in - check please? Simon Bridge Linux - Security 1 01-23-2004 09:26 PM
IPTables Sanity Check Crashed_Again Linux - Networking 3 03-06-2003 08:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:27 AM.

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
Open Source Consulting | Domain Registration