netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Josefsson <gandalf@mjufs.se>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: netdev@vger.kernel.org, bugme-daemon@bugzilla.kernel.org,
	berni@birkenwald.de, kaber@trash.net,
	netfilter-devel@vger.kernel.org
Subject: Re: [Bugme-new] [Bug 12954] New: SAMEIP --nodst functionality gone missing
Date: Wed, 8 Apr 2009 10:03:38 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.62.0904080941370.10428@wlug.westbo.se> (raw)
In-Reply-To: <20090407143509.05ab3b28.akpm@linux-foundation.org>

On Tue, 7 Apr 2009, Andrew Morton wrote:

>> Back in the days of 2.6.18 there was the SAME target which allowed, with the
>> option '--nodst' to SNAT internal hosts to the same address of a whole SNAT
>> range regardless of the destination address.
>>
>> In cb76c6a597350534d211ba79d92da1f9771f8226 the SAME target was removed from
>> the kernel sources due to being obsolete, since the same functionality was now
>> in nf_nat. Shortly after that a discussion Patrick McHardy proposed a patch to
>> mimic the behaviour of SAME with --nodst in nf_nat by dropping the destination
>> IP from the jhash. The patch was dropped shortly after because it apparently
>> showed some uneven distribution.
>>
>> The whole thread can be read at
>> http://thread.gmane.org/gmane.comp.security.firewalls.netfilter.devel/23275/focus=27670
>> .
>>
>> This thread went dead, I tried to revive it but did not get an answer. We're
>> getting hit by this regression because we are currently NATing some thousand IP
>> addresses (student dorms) to an external /28. It works fine with our old
>> 2.6.18+SAME setup, but tests with 2.6.25+SNAT showed massive issues with
>> connections from the same internal address to different destinations getting
>> NATed to different addresses in the pool. Which breaks, for example, ICQ quite
>> badly.

Problems like these were the reason why I wrote the SAME target in the 
first place. I NAT'ed a few hundred students behind a small range of 
ipaddresses and with normal SNAT they had extreme problems with ICQ and 
online banking sites which require you to have the same source ip even if 
you move between servers (diffrent destinations) etc.

After I wrote SAME I didn't get a single complaint.

One bonus feature that many students really liked was that they always 
had the same external ipaddress as long as they had the same internal 
ipaddress and the external range of ipaddresses remained the same.

This feature isn't as important as having the same source ip for all 
current sessions when using online banking services etc.

I didn't think anyone was still using SAME... guess I was wrong.

The uneven distribution of the patch in question can't be worse than the 
SAME distributions which, iirc, just does something like:

first_ip_in_snat_range + (client_ip % num_ips_in_snat_range)

And given many clients behind the SNAT the distribution should be quite 
even.


Patrick, how about making the ipaddress selection based on only client 
ipaddress behaviour selectable with an SNAT parameter if the problem with 
the patch is that the distribution can be uneven for a small number of 
clients?

/Martin

       reply	other threads:[~2009-04-08  8:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-12954-10286@http.bugzilla.kernel.org/>
     [not found] ` <20090407143509.05ab3b28.akpm@linux-foundation.org>
2009-04-08  8:03   ` Martin Josefsson [this message]
2009-04-08 15:32     ` [Bugme-new] [Bug 12954] New: SAMEIP --nodst functionality gone missing Patrick McHardy
2009-04-15 11:53       ` Patrick McHardy
2009-04-15 12:10         ` Jan Engelhardt
2009-04-15 12:13           ` Patrick McHardy
2009-04-15 12:21             ` Jan Engelhardt
2009-04-15 12:35               ` Patrick McHardy
2009-04-17 16:16                 ` 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=Pine.LNX.4.62.0904080941370.10428@wlug.westbo.se \
    --to=gandalf@mjufs.se \
    --cc=akpm@linux-foundation.org \
    --cc=berni@birkenwald.de \
    --cc=bugme-daemon@bugzilla.kernel.org \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --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 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).