netfilter.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pascal Hambourg <pascal@plouf.fr.eu.org>
To: James Lamanna <james@warp2biz.com>
Cc: "netfilter@vger.kernel.org" <netfilter@vger.kernel.org>
Subject: Re: Disable port translation in SNAT
Date: Thu, 24 Jul 2014 20:43:03 +0200	[thread overview]
Message-ID: <53D153B7.6000302@plouf.fr.eu.org> (raw)
In-Reply-To: <2F6A61C9-C112-4C17-9BE7-9B6438B19893@warp2biz.com>

Hello,

James Lamanna a écrit :
> Hi,
> Is there a way to disable port translation during SNAT so that traffic
> originates from the same external port as it did internally?

When possible this is already the default when you don't specify a port
range nor --random. From the man page :

--to-source  ipaddr[-ipaddr][:port-port]
     which  can  specify a single new source IP address, an inclusive
     range of IP addresses, and optionally, a port  range  (which  is
     only  valid if the rule also specifies -p tcp or -p udp).	 If no
     port range is specified, then source ports  below	 512  will  be
     mapped  to  other	 ports	below  512: those between 512 and 1023
     inclusive will be mapped to ports below 1024,  and  other	 ports
     will  be mapped to 1024 or above. Where possible, no port alter-
     ation will occur.

Sometimes the source port must be translated in order to avoid a
conflict with an existing connection to the same destination which
already uses that source port.

  reply	other threads:[~2014-07-24 18:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-24 12:13 Disable port translation in SNAT James Lamanna
2014-07-24 18:43 ` Pascal Hambourg [this message]
2014-07-24 19:09   ` James Lamanna
2014-07-27  7:53     ` 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=53D153B7.6000302@plouf.fr.eu.org \
    --to=pascal@plouf.fr.eu.org \
    --cc=james@warp2biz.com \
    --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;
as well as URLs for NNTP newsgroup(s).