Re: [lvs-users] Loadbalacing (DR) without assigning the VIP to loadbalan

To: " users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [lvs-users] Loadbalacing (DR) without assigning the VIP to loadbalancer
From: Graeme Fowler <graeme@xxxxxxxxxxx>
Date: Wed, 22 Dec 2010 15:44:25 +0000
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 -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 80 {
    weight 100
      connect_port 80
      connect_timeout 5



Please read the documentation before posting - it's available at: mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
or go to

<Prev in Thread] Current Thread [Next in Thread>