All of lore.kernel.org
 help / color / mirror / Atom feed
* using iptables for poor-man's load balancing?
@ 2003-02-18 21:53 Ian Douglas
  2003-02-18 22:02 ` Ian Douglas
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Ian Douglas @ 2003-02-18 21:53 UTC (permalink / raw)
  To: netfilter

We currently have two machines (soon to be 4) that we'd like to balance our web
traffic to. Say for argument's sake that our public IP is 1.2.3.4 and our
internal LAN machines are:
  192.168.1.1
  192.168.1.12
  192.168.1.16
  192.168.1.17

Just curious if the following rules would work to round-robin the connections:

/sbin/iptables -t nat -A PREROUTING -p udp -d 1.2.3.4 --dport 80  -j DNAT \
   --to-destination 192.168.1.1:80 \
   --to-destination 192.168.1.12:80 \
   --to-destination 192.168.1.16:80 \
   --to-destination 192.168.1.17:80
/sbin/iptables -t nat -A PREROUTING -p udp -d 1.2.3.4 --dport 433  -j DNAT \
   --to-destination 192.168.1.1:80 \
   --to-destination 192.168.1.12:80 \
   --to-destination 192.168.1.16:80 \
   --to-destination 192.168.1.17:80

??

Thanks for any feedback or suggestions.

Ian



^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: using iptables for poor-man's load balancing?
@ 2003-02-18 22:10 Andrej Ricnik
  2003-02-19 18:47 ` Ian Douglas
  0 siblings, 1 reply; 12+ messages in thread
From: Andrej Ricnik @ 2003-02-18 22:10 UTC (permalink / raw)
  To: netfilter



>Just curious if the following rules would work to round-robin the 
>connections:
To my understanding it's not robin-go-round but distributing
new requests to the currently least used IP (the one with the
smallest number of active connections), which should pretty
much do what you want, anyway.


Cheers,
Tink

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCM/IT/O d-(++)@ a C+(+++)@ UL++>+++ P+>+++ L++ E+@ W+@ N+ o? K? w---@(+) 
O+++(+)@ M-@ V? PS+ PE- Y+ PGP++ t- 5- X- R-(*) tv-@ b+ DI++ D-- G++ !e* 
h--- r++ z?
------END GEEK CODE BLOCK------


_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail



^ permalink raw reply	[flat|nested] 12+ messages in thread
[parent not found: <20030219232644.14732.18331.Mailman@kashyyyk>]

end of thread, other threads:[~2003-02-21  8:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-18 21:53 using iptables for poor-man's load balancing? Ian Douglas
2003-02-18 22:02 ` Ian Douglas
2003-02-19 23:17 ` Ian Douglas
2003-02-20  0:12   ` Joel Newkirk
2003-02-20  0:30     ` Joel Newkirk
2003-02-20  0:55       ` Ian Douglas
2003-02-20  4:24         ` Joel Newkirk
2003-02-21  8:48 ` Fabrice MARIE
  -- strict thread matches above, loose matches on Subject: below --
2003-02-18 22:10 Andrej Ricnik
2003-02-19 18:47 ` Ian Douglas
     [not found] <20030219232644.14732.18331.Mailman@kashyyyk>
2003-02-20  3:00 ` mpboden
2003-02-20  3:39   ` SBlaze

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.