Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Roy Sigurd Karlsbakk <roy@karlsbakk.net>
To: Brad Morgan <B-Morgan@concentric.net>,
	Steve Mickeler <steve@neptune.ca>,
	Chris Poupart <cpoupart@canada.com>
Cc: netfilter@lists.netfilter.org
Subject: Re: Single IP firewall help...
Date: Fri, 13 Sep 2002 11:05:55 +0200	[thread overview]
Message-ID: <200209131105.55867.roy@karlsbakk.net> (raw)
In-Reply-To: <NABBJOOEOFODEALNMJAJGEFMGLAA.B-Morgan@concentric.net>

ok.

I beleive this should look like this.

                +--------+
         off.ip |        | priv.ip
INTERNET -------+ fw+web +--------- LAN
           eth1 |        | eth0
                +--------+

given your internal IP is 192.168.0.0/16, I'd do it like this


iptables -A INPUT -i eth0 -s 192.168.144.0/16 -j ACCEPT
iptables -A INPUT -i eth1 -d ! 192.168.144.0/16 -p tcp -m multiport --dports \
	22,80,443 -j ACCEPT
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
(some -j DROP/REJECT lines here to filter out what you don't want to log)
iptables -A INPUT -j LOG
iptables -P INPUT DROP

then

iptables -A POSTROUTING -t nat -s 192.168.0.0/16 \
	-d ! 192.168.0.0/16 -o eth1 -j MASQUERADE


perhaps add some logging in case someone tries to forward through it...

any comments?

roy
-- 
Roy Sigurd Karlsbakk, Datavaktmester
ProntoTV AS - http://www.pronto.tv/
Tel: +47 9801 3356

Computers are like air conditioners.
They stop working when you open Windows.



  reply	other threads:[~2002-09-13  9:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-12 15:43 Single IP firewall help Chris Poupart
2002-09-12 16:31 ` Steve Mickeler
2002-09-12 18:24   ` Brad Morgan
2002-09-13  9:05     ` Roy Sigurd Karlsbakk [this message]
2002-09-12 17:26 ` Maciej Soltysiak
2002-09-12 17:34   ` Chris Poupart
2002-09-12 19:06     ` Maciej Soltysiak

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=200209131105.55867.roy@karlsbakk.net \
    --to=roy@karlsbakk.net \
    --cc=B-Morgan@concentric.net \
    --cc=cpoupart@canada.com \
    --cc=netfilter@lists.netfilter.org \
    --cc=steve@neptune.ca \
    /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