All of lore.kernel.org
 help / color / mirror / Atom feed
From: Katriel Traum <katriel@traum.org.il>
To: netfilter@lists.netfilter.org
Subject: Re: DNAT/MASQ Precedence
Date: Fri, 31 Jan 2003 09:58:35 +0000	[thread overview]
Message-ID: <200301310958.38656.katriel@traum.org.il> (raw)
In-Reply-To: <20030130193408.GR11221@miggy.org>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 30 January 2003 19:34, Athan wrote:
> On Thu, Jan 30, 2003 at 07:31:38PM +0000, Katriel Traum wrote:
> > I want to redirect _all_ traffic into the DMZ (is that even possible?)
> > and in the same time MASQ the LAN. The question is will they collide? If
> > I use a ruleset such as:
> > iptables -A PREROUTING -i $INET_IF -j DNAT --to-destination $DMZ_IP
> > iptables -A POSTROUTING -o $INET_IF -j MASQUERADE
> > (yes, there's only one computer in the DMZ)
> >
> > Will I get return traffic into my lan? won't it be DNATed into the DMZ?
>
>   You need at least one public IP that is *NOT* in the DMZ.  Then change
> the DMZ rule to exclude on this:
>
> iptables -A PREROUTING -i $INET_IF -d ! <not-DMZ IP> -j DNAT
> --to-destination $DMZ_IP

Well, the problem is I have 1 public IP via a cable modem.
So I ask again, if I DNAT everything into the DMZ lan, and try to MASQ my 
private lan, will I even get return traffic?


>
> This IP would also be the IP on the outgoing interface of the firewall.
> So should automatically get used for MASQUERADE.  If it's all static,
> then just use SNAT instead of MASQUERADE and you can specify the IP to
> be sure of it:
>
> iptables -A POSTROUTING -o $INET_IF -s <LAN network> -j SNAT --to-source
> <not DMZ IP>
>
> Note the '-s' bit on that rule so you only SNAT traffic coming from the
> LAN, and not that from the DMZ.
>
>   I'm sure others will correct me if anything in this is wrong ;).
>
> -Ath

- -- 
+katriel                                                כתריאל+
pgp key: traum.org.il/gpg.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+OkjODWy+Hv/461sRAvv4AKCFs+zLCmzRs6lgjQtNV9T9IrZGJgCcD5bg
41rSU533ygx88Bjz40TlwXU=
=rV9v
-----END PGP SIGNATURE-----



  reply	other threads:[~2003-01-31  9:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-30 19:31 DNAT/MASQ Precedence Katriel Traum
2003-01-30 19:34 ` Athan
2003-01-31  9:58   ` Katriel Traum [this message]
2003-01-31 10:14     ` Athan
2003-01-31 13:14       ` Katriel Traum
2003-01-31 11:19         ` Athan
2003-01-31 13:41           ` Katriel Traum
2003-01-31 12:18             ` Athan

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=200301310958.38656.katriel@traum.org.il \
    --to=katriel@traum.org.il \
    --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 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.