LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: Load balancing of two or more NIC's

To: "Bruno L. F. Cabral" <bruno@xxxxxxxxxxxxxxx>
Subject: Re: Load balancing of two or more NIC's
Cc: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
From: Horms <horms@xxxxxxxxxxxx>
Date: Wed, 4 Oct 2000 12:31:47 -0400
On Wed, Oct 04, 2000 at 02:01:01PM -0200, Bruno L. F. Cabral wrote:
> Hi there
> 
> I have a little different balance question. let's suppose that I 
> have a LVS-NAT diretor with two VIPs on distinct IP subnet's
> 
> how could I make connections made on each VIP goes to the
> correct network from which it came from?
> 
> i.e.
>                  +---+
> -- LAN1 --+ VIP1 |   |
>                  |LVS| --+ internal LAN
> -- LAN2 --+ VIP2 |   |
>                  +---+
> 
> VIP1 -> 64.x.x.10, default gateway 64.x.x.1
> VIP2 -> 200.y.y.5, default gateway 200.y.y.30
> 
> impossible?

I'm not sure I fully understand the question.

You have two networks, 64.x.x/8 and 100.y.y/24 for arguments sake.
The LVS host is connected to both of these networks and
has a VIP on each.

What I don't understand is where the internal LAN comes into
the equation.

Also, do the do LAN1 and LAN2 have their own external connectivity
though 64.x.x.1 and 200.y.y.30 respectively which is
separaate from the LVS host?


If you want LVS to direct traffic to different virtual services
based on the _source_ address of the request this can be done
using fwmark.


# Mark traffic destined for either VIP from a host in LAN1 with fwmark 1
ipchains -A input -d VIP1 -s LAN1 -m 1
ipchains -A input -d VIP2 -s LAN1 -m 1

# Mark traffic destined for either VIP from a host in LAN2 with fwmark 2
ipchains -A input -d VIP1 -s LAN2 -m 2
ipchains -A input -d VIP2 -s LAN2 -m 2

# Set up a virtual service for fwmark 1
ipvsadm -A -f 1
ipvsadm -a -f 1 -r 64.x.x.a
ipvsadm -a -f 1 -r 64.x.x.b

# Set up a virtual service for fwmark 2
ipvsadm -A -f 2
ipvsadm -a -f 2 -r 200.x.x.a
ipvsadm -a -f 2 -r 200.x.x.b


-- 
Horms


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