Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Rob Sterenborg" <rob@sterenborg.info>
To: 'Jorge Bastos' <mysql.jorge@decimal.pt>,
	'Christoph Paasch' <christoph.paasch@gmail.com>
Cc: netfilter@vger.kernel.org
Subject: RE: Question about nat filtering with FORWARD
Date: Wed, 24 Jun 2009 13:56:00 +0200	[thread overview]
Message-ID: <004e01c9f4c2$bf788830$3e699890$@info> (raw)
In-Reply-To: <1872.192.168.1.3.1245842645.squirrel@webmail.decimal.pt>

>> On Wed June 24 2009 wrote Rob Sterenborg:
>>> $ipt -P FORWARD DROP
>>> $ipt -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
>>> $ipt -A FORWARD -m state --state NEW -p tcp --dport 22 -j ACCEPT
>>> 
>> Watch out, that with these rules, you will allow any traffic to
>> pass, that has destination port 22. Thus, the outside can contact
>> you to port 22. And the inside can contact any host on the Internet
>> on port 22.

Yes, I didn't say the ruleset was perfect; it's just a starting point..
;-)

> No good then, i just want to allow traffic for ports defined by me,
> for the NAT'd machines.

So create more restrictive rules. Use -s and/or -d, etc. Think about
what you specifically want to allow and drop (or reject) everything
else. Your posts only mention port 22 so that's what my example does.

> Can you guys help on this? Sorry but i really have no idea, with
> the PREROUTING it was easy for me.

We don't know what you really want; there are no details so it's
impossible to say what exactly you should do. If you tell us what you
want you'll probably get a more detailed answer.

However, this is quite basic stuff which really is covered in the
IPTables Tutorial.


-- Rob



  parent reply	other threads:[~2009-06-24 11:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-24 10:04 Question about nat filtering with FORWARD Jorge Bastos
2009-06-24 10:22 ` Oskar Berggren
2009-06-24 10:39   ` Jorge Bastos
2009-06-24 10:54     ` Rob Sterenborg
2009-06-24 11:20       ` Christoph Paasch
2009-06-24 11:24         ` Jorge Bastos
2009-06-24 11:47           ` Christoph Paasch
2009-06-24 15:06             ` Jorge Bastos
2009-06-24 15:26               ` Richard Horton
2009-06-24 15:45                 ` Jorge Bastos
2009-06-24 16:00                   ` Oskar Berggren
2009-06-24 18:10                   ` Jorge Dávila
2009-06-24 19:40                     ` Jorge Bastos
2009-06-24 20:35                       ` lists
2009-06-24 11:56           ` Rob Sterenborg [this message]
2009-06-25 10:13       ` Pascal Hambourg
2009-06-25 10:18         ` Pascal Hambourg

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='004e01c9f4c2$bf788830$3e699890$@info' \
    --to=rob@sterenborg.info \
    --cc=christoph.paasch@gmail.com \
    --cc=mysql.jorge@decimal.pt \
    --cc=netfilter@vger.kernel.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