On Wed, 2010-12-22 at 15:44 +0100, Ruben Laban wrote:
> I'm trying to do direct-routing loadbalancing of a complete /23
Use fwmarks.
Have an iptables rule (in the 'mangle' table, IIRC) to match on the /23:
iptables -t mangle -A PREROUTING -d 192.168.0.0/16 -p tcp \
-m tcp --dport 80 -j MARK --set-mark 0x1
Then in the IPVS config (however you configure it) match on the mark
value rather than a network prefix.
For keepalived, for example:
# Simple only-local fwmark config
virtual_server fwmark 1 {
delay_loop 10
lb_algo rr
lb_kind DR
persistence_timeout 60
protocol TCP
real_server 127.0.0.1 80 {
weight 100
TCP_CHECK {
connect_port 80
connect_timeout 5
}
}
}
Simples!
Graeme
_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/
LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
or go to http://lists.graemef.net/mailman/listinfo/lvs-users
|