All of lore.kernel.org
 help / color / mirror / Atom feed
From: Athan <netfilter@miggy.org>
To: Katriel Traum <katriel@traum.org.il>
Cc: Athan <netfilter@miggy.org>, netfilter@lists.netfilter.org
Subject: Re: DNAT/MASQ Precedence
Date: Fri, 31 Jan 2003 11:19:49 +0000	[thread overview]
Message-ID: <20030131111949.GV11221@miggy.org> (raw)
In-Reply-To: <200301311314.06777.katriel@traum.org.il>

[-- Attachment #1: Type: text/plain, Size: 1554 bytes --]

On Fri, Jan 31, 2003 at 01:14:06PM +0000, Katriel Traum wrote:
> Okay, sounds good, so say I want to save me a 2000 SNAT ports (I don't think 
> I'll have 2000 sockets open at the same time)
> here's the ruleset I should use:
> 
> iptables -A PREROUTING -i $INET_IF -p tcp --dport ! 60000:62000 -j DNAT \
> - --to-destination $DMZ_IP
> iptables -A PREROUTING -i $INET_IF -p udp --dport ! 60000:62000 -j DNAT \
> - --to-destination $DMZ_IP
> 
> iptables -A POSTROUTING -o $INET_IF -i $LAN_IF -j SNAT --to-source \
>  $INET_IP:60000-62000

   Looks good at first glance here.

> as for ICMP, I didn't quite understand you. can you elaborate?

  For TCP to operate correctly you *NEED* some ICMP working.  ICMP isn't
just for ping!  There are things like network, host and port
unreachable.  There's also things like Path MTU discovery which involves
an ICMP message being sent back if a packet is too big for part of the
route and has the Do not Fragment (DF) flag set.
  Basically not allowing ICMP in a blind fashion is NOT the way to do
things.  You probably just need to make sure you have the proper FORWARD
rules (filter chain, it's the default so no -t) to allow both
ESTABLISHED and RELATED.  You can find these in any mention of SNAT in
docs/howtos.

HTH,

-Ath
-- 
- Athanasius = Athanasius(at)miggy.org / http://www.miggy.org/
                  Finger athan(at)fysh.org for PGP key
	   "And it's me who is my enemy. Me who beats me up.
Me who makes the monsters. Me who strips my confidence." Paula Cole - ME

[-- Attachment #2: Type: application/pgp-signature, Size: 240 bytes --]

  reply	other threads:[~2003-01-31 11:19 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
2003-01-31 10:14     ` Athan
2003-01-31 13:14       ` Katriel Traum
2003-01-31 11:19         ` Athan [this message]
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=20030131111949.GV11221@miggy.org \
    --to=netfilter@miggy.org \
    --cc=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.