Linux Netfilter discussions
 help / color / mirror / Atom feed
* load balancing over a very large number of outgoing addresses?
@ 2007-07-27  1:27 Chris Kanich
  2007-07-31 15:01 ` Grant Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Kanich @ 2007-07-27  1:27 UTC (permalink / raw)
  To: netfilter

Hi,
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.

I have come across this how-to:
http://lartc.org/howto/lartc.rpdb.multiple-links.html

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.

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

Many thanks,
Chris Kanich


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

* Re: load balancing over a very large number of outgoing addresses?
  2007-07-27  1:27 load balancing over a very large number of outgoing addresses? Chris Kanich
@ 2007-07-31 15:01 ` Grant Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Grant Taylor @ 2007-07-31 15:01 UTC (permalink / raw)
  To: Mail List - Netfilter

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. . . .


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

end of thread, other threads:[~2007-07-31 15:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox