All of lore.kernel.org
 help / color / mirror / Atom feed
* RFC: SAME removal and NAT IP selection
@ 2008-02-21 12:41 Patrick McHardy
  2008-02-22 16:19 ` Patrick McHardy
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick McHardy @ 2008-02-21 12:41 UTC (permalink / raw)
  To: Netfilter Development Mailinglist

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?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-22 16:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-21 12:41 RFC: SAME removal and NAT IP selection Patrick McHardy
2008-02-22 16:19 ` Patrick McHardy

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.