From: Patrick McHardy <kaber@trash.net>
To: Netfilter Development Mailinglist <netfilter-devel@vger.kernel.org>
Subject: RFC: SAME removal and NAT IP selection
Date: Thu, 21 Feb 2008 13:41:43 +0100 [thread overview]
Message-ID: <47BD7187.7000403@trash.net> (raw)
As soon as we've removed the SAME target, I got some complaints
from users that not only need persistent IPs when talking to the
same destination, but for all destinations, which NAT currently
doesn't provide.
I don't want to resurrect the SAME target because of the 32/64bit
compat problems it had, it would be better to handle this in the
NAT core. The IP is currently determined by hashing the source and
destinations IPs and mapping the hash to the NAT range:
minip = ntohl(range->min_ip);
maxip = ntohl(range->max_ip);
j = jhash_2words((__force u32)tuple->src.u3.ip,
(__force u32)tuple->dst.u3.ip, 0);
j = ((u64)j * (maxip - minip + 1)) >> 32;
*var_ipp = htonl(minip + j);
We have two options:
- add a flag to the NAT range to ignore the destination
IP for SNAT
- always ignore the destination IP for SNAT
I personally prefer the second option since it results in more
consistency and avoids adding new a option. I'm can't think
of a reason why we would need to include the destination for
SNAT, using jhash should result in good distribution anyway,
but I might be missing something.
Any opinions?
next reply other threads:[~2008-02-21 12:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-21 12:41 Patrick McHardy [this message]
2008-02-22 16:19 ` RFC: SAME removal and NAT IP selection Patrick McHardy
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=47BD7187.7000403@trash.net \
--to=kaber@trash.net \
--cc=netfilter-devel@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 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.