On Tue, 11 Nov 2008, Pieter Temmerman wrote:
> I have a director running on CentOS 5.2 (184.108.40.206.13.el5) which has the
> vs functionality already compiled into the kernel, so I can perfectly
> load the VS modules.
> I'm trying to load balance two Apache servers here. This setup was
> perfectly working (using direct routing), until I had to change the
> listen port of the Apache servers, instead of port 80, it now uses port
> 81. As from what I've read in the documentation, I cannot have the VIP
> port be specified as 80, and have the RIP port specified as 81, while
> still using direct routing as forwarding method.
I use exact same thing with LVS-DR. One web server instance listens on port
81, another one on port 82 etc. The real server redirects VIP1:80 to localhost
port 81, VIP2:80 to localhost port 82.
iptables -t nat -A PREROUTING -i bond0 -p tcp -d $VIP1 --dport 80 -j REDIRECT
iptables -t nat -A PREROUTING -i bond0 -p tcp -d $VIP2 --dport 80 -j REDIRECT