All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Newkirk <netfilter@newkirk.us>
To: Chris Barnes <runtimeerror@bigpond.com>,
	Netfilter <netfilter@lists.netfilter.org>
Subject: Re: newbie problem
Date: Mon, 17 Feb 2003 03:09:16 -0500	[thread overview]
Message-ID: <200302170309.16516.netfilter@newkirk.us> (raw)
In-Reply-To: <1045467799.20801.22.camel@billybob.back2front.homelinux.org>

On Monday 17 February 2003 02:43 am, Chris Barnes wrote:
> hi people i'm new to the list.
>
> anyway, I have a very simple firewall on a web server. I want to deny
> access to everything except the web server (port 80)
>
> i have set the poilcy on all chains to drop and i have added a rule to
> the input chain which says
>
> iptables -A INPUT -p tcp --sport 80 -j ACCEPT

> iptables -A OUTPUT -p tcp -j ACCEPT

> what am i doing wrong or what is a better way to do this?
>
> thanks heaps for your help.

You have to accept connections TO port 80, not FROM port 80...

Try these:

iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

They will allow clients to connect and retrieve http documents, as well 
as allowing the very useful ICMP controls like source_quench 
fragmentation control and such that really make web browsing work 
properly, but no other communication in OR out is allowed by these 
rules.  (assuming DROP policy on OUTPUT)  Add appropriate ACCEPT rules 
to OUTPUT if the server needs to initiate connections for some reason.

j



  reply	other threads:[~2003-02-17  8:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-17  7:43 newbie problem Chris Barnes
2003-02-17  8:09 ` Joel Newkirk [this message]
2003-02-17 10:31   ` Chris Barnes
2003-02-17  8:25 ` Ralf Spenneberg
2003-02-20 11:39   ` Eric Constantineau
2003-02-17  9:00 ` Ralf Spenneberg
     [not found] ` <1045470029.2231.54.camel@kermit.spenneberg.de>
     [not found]   ` <1045477595.21053.2.camel@billybob.back2front.homelinux.org>
2003-02-17 10:27     ` Ralf Spenneberg
  -- strict thread matches above, loose matches on Subject: below --
2007-07-28  7:20 Newbie problem Insitu
2007-07-28  8:01 ` Junio C Hamano
2007-07-28  8:50   ` Insitu
2003-02-17  8:49 newbie problem Eugene Joubert
2003-02-17 10:48 ` Chris Barnes
2002-04-25 17:19 Newbie problem Ed Vance
2002-04-25 17:37 ` Bahadir Karuv
2002-04-25 16:53 Ed Vance
2002-04-25 17:12 ` Bahadir Karuv
2002-04-25 15:58 Bahadir Karuv
2001-07-24 21:17 Frank Akujobi
2001-07-24 21:34 ` Joel Jaeggli
2001-07-24 21:36 ` Stephen M. Williams
2001-07-24 21:36 ` Paul G. Allen

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=200302170309.16516.netfilter@newkirk.us \
    --to=netfilter@newkirk.us \
    --cc=netfilter@lists.netfilter.org \
    --cc=runtimeerror@bigpond.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.