Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Martin Josefsson <gandalf@wlug.westbo.se>
To: SB CH <chulmin2@hotmail.com>
Cc: Netfilter <netfilter@lists.netfilter.org>
Subject: Re: difference between SNAT and SAME Patch?
Date: 17 Sep 2002 11:26:56 +0200	[thread overview]
Message-ID: <1032254816.30037.7.camel@tux> (raw)
In-Reply-To: <F11056FtZo1P4lvVL5m00009327@hotmail.com>

On Tue, 2002-09-17 at 10:27, SB CH wrote:
> Hello, all.
> 
> what's the difference of the SNAT and SAME patch?
> 
>  ex)
> 1)iptables -t nat -A POSTROUTING -j SNAT --to-source 1.2.3.4-1.2.3.7
> 2)iptables -t nat -A POSTROUTING -j SAME --to 1.2.3.4-1.2.3.7

SNAT will use the currently least used ip in the range for the new
connection. That means that clients can get diffrent ip's for their
connections, even against the same server and some webservers don't like
this, ie. hotmail, banking via internet....

SAME on the other hand doesn't care which ip has the least number of
connections. It will calculate which ip in the range to use for a given
client, that way a client always gets the same ip on all of it's
connections. I wrote this target when users complained about banking via
internet not working via SNAT with multiple ip's.

(SAME uses both the clients ipadress and the ip of the server you are
trying to connect to in the calculation so by default clients will get
diffrent ip's against diffrent servers but always the same ip against
the same server. There is an option to force it to only care about the
clients ip so that they will always get the same ip regardless of which
server they are trying to connect to, that option is called --nodst,
this is how I use it here)

I hope that helps.

-- 
/Martin

Never argue with an idiot. They drag you down to their level, then beat
you with experience.


      reply	other threads:[~2002-09-17  9:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-17  8:27 difference between SNAT and SAME Patch? SB CH
2002-09-17  9:26 ` Martin Josefsson [this message]

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=1032254816.30037.7.camel@tux \
    --to=gandalf@wlug.westbo.se \
    --cc=chulmin2@hotmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox