All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grant Taylor <gtaylor@riverviewtech.net>
To: Mail List - Netfilter <netfilter@lists.netfilter.org>
Subject: Re: load balancing over a very large number of outgoing addresses?
Date: Tue, 31 Jul 2007 10:01:32 -0500	[thread overview]
Message-ID: <46AF4ECC.20305@riverviewtech.net> (raw)
In-Reply-To: <46A94A1F.4000107@cs.ucsd.edu>

On 07/26/07 20:27, Chris Kanich wrote:
> I have recently developed a need to multiplex connections from within a 
> NAT over several (hundred, even thousand if possible) external IPs. I 
> can have all of these IPs routed to a single interface on my NAT box, 
> however I am not exactly sure how to set up a random/round robin load 
> balancing scheme such that outgoing connections from my network each get 
> a random source address from my source address pool.

If I understand what you are wanting to do correctly, that is many to 
many NAT, why not use a range of IP addresses on your SNAT rule?  I.e.:

iptables -t nat -A POSTROUTING -j SNAT --to-source A.B.0.1-A.B.7.255

Would SNAT to an IP in the range of A.B.0.1 through A.B.7.255, thus a 
little over 2000 IPs.

One thing I'm not sure of is how the kernel decides which IP in the 
range to assign, though I bet someone on this mailing list can help 
better answer this.

> However it seems that I cannot scale these routing rules past 255 
> routes, and unlike the example, I am not multiplexing interfaces but 
> only IPs in roughly a contiguous /16 range being routed to this linux 
> machine.

*nod*  I don't think this is what you are wanting to do.

> Any suggestions on how to get this up and running would be greatly 
> appreciated.

See if what I presented above is any where close to what you are wanting 
to do.



Grant. . . .


      reply	other threads:[~2007-07-31 15:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-27  1:27 load balancing over a very large number of outgoing addresses? Chris Kanich
2007-07-31 15:01 ` Grant Taylor [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=46AF4ECC.20305@riverviewtech.net \
    --to=gtaylor@riverviewtech.net \
    --cc=gtaylor+reply@riverviewtech.net \
    --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 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.