Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Chris Wilson <chris@netservers.co.uk>
To: Glenn Hancock <ghancock@softeksoftware.com>
Cc: netfilter@lists.netfilter.org
Subject: Re: iptables question
Date: Thu, 14 Aug 2003 11:17:31 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.44.0308141100450.31438-100000@localhost> (raw)
In-Reply-To: <1060807798.4082.8.camel@localhost.localdomain>

Hi Glenn,

> I have my rules setup the way I would guess they should be based on 5
> tutorials, 1 book and the man pages.  However, I still can't seem to get
> the thing to do what I want.  Could someone please help me?
> 
> I will make this very simple:
> 1)  I want to allow all incoming requests to port 80
> 2) I want to allow all outgoing requests .... period.
> 
> I want to drop all other incoming requests not addressed to port 80.

Did you see Rob Sterenborg's response to your previous post? The ruleset 
which you sent didn't appear to be complete. You also don't mention if the 
machine you're running the firewall on is the same one that's running the 
web server, and that you're trying to make outgoing requests from. 
Assuming that it is, the following rules should work:

  iptables -F
  iptables -P INPUT DROP
  iptables -P OUTPUT ACCEPT
  iptables -P FORWARD DROP
  iptables -A INPUT -m state --state established -j ACCEPT
  iptables -A INPUT -i lo -j ACCEPT
  iptables -A INPUT -p tcp --dport 80 -j ACCEPT

If, on the other hand, you have another network behind your Linux box, and 
machines on that network need to get through the Linux box to the 
Internet, then you will need the following additional rules:

  iptables -A FORWARD -i <internal-interface> -o <external-interface> \
	-j ACCEPT
  iptables -A FORWARD -m state --state established -j ACCEPT

and if the internal machines have private IP addresses:

  iptables -t nat -A POSTROUTING -o <external-interface> -j MASQUERADE

By the way, I don't like my first impression of your challenge-response
spam filter. You might want to try SpamAssassin, it's much less intrusive 
to people trying to e-mail you.

Cheers, Chris.
-- 
   ___ __     _
 / __// / ,__(_)_  | Chris Wilson -- UNIX Firewall Lead Developer |
/ (_ / ,\/ _/ /_ \ | NetServers.co.uk http://www.netservers.co.uk |
\ _//_/_/_//_/___/ | 21 Signet Court, Cambridge, UK. 01223 576516 |





  reply	other threads:[~2003-08-14 10:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-13 20:49 iptables question Glenn Hancock
2003-08-14 10:17 ` Chris Wilson [this message]
2003-08-14  6:53   ` Glenn Hancock
2003-08-14 10:23 ` Ralf Spenneberg
  -- strict thread matches above, loose matches on Subject: below --
2008-03-11 14:20 bossk
2008-03-11 18:46 ` Jan Engelhardt
2008-03-11 19:13   ` Justin Piszcz
2005-02-10 15:04 shardul Adhikari
2004-02-17 15:52 John Black
2004-02-17 16:40 ` Antony Stone
2003-09-08 16:43 iptables Question Elitesyntax
2003-02-03  6:47 IpTables question Curca Claudiu
2003-02-06  5:28 ` Joel Newkirk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.44.0308141100450.31438-100000@localhost \
    --to=chris@netservers.co.uk \
    --cc=ghancock@softeksoftware.com \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox