Skip to contentSkip to conversation

load balancing?

DISCUSSION Jean-Yves Simon 2 participants 2 messages Jun 14, 2003

lore
Share & tools
lore
#0 lore raw

Hello,

I'm curious if load balancing can be done with iptables, like for example forwarding incoming web requests to one of the multiple web servers behind the firewall.

Or is a third party software needed?

Maybe it is this planned for the future (pkttables or don't know what name it will have)?

Signature · 1 line
Jean-Yves Simon <[email protected]>
#1 lore raw
Quoted 7 lines · Jean-Yves Simon

Hello,

I'm curious if load balancing can be done with iptables, like for example forwarding incoming web requests to one of the multiple web servers behind the firewall.

Or is a third party software needed?

If all you need is to distribute requests evenly across a range of IPs you can use the rule:

iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to 10.10.10.1-10.10.10.16

This example would attempt to distribute incoming HTTP requests evenly across the specified range of 16 IPs.

j