[lvs-users] problem with setting up a balancer with targets in same subn

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: [lvs-users] problem with setting up a balancer with targets in same subnet as its front
From: dpecka <dpecka@xxxxxxxxxxxxxxx>
Date: Wed, 17 Feb 2010 10:24:25 +0100
hi ip_vs* developers ..

i am new to this mailinglist and i'd just like to say first, that is awesome project ..
but back to business now.

i am setting up a load balancer for some services and have no problem
with configuration when balancing between two different subnets,
but i am utterly unable to set it up if want to balance in just one
subnet ..

my common sense says to me, that for one subnet i should use a SNAT, but
it completely omits a snat POSTROUTING rules and balanced
packets come to the targets with original client ip address ..

i have following configuration:

# ipvsadm
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP rr persistent 360
  ->          Masq    1      0          0
  ->          Masq    1      0          0
TCP rr persistent 360
  ->           Masq    1      0          1

^^ ldap works for me fine. Weird is, that i am using -m (masquerade)
method even i have completely no masquerade for *:ldap service .. 
its's not working with default gateway method .. but it don't hurt since
it works fine for me ..

*:http service simply does not work with snat with this rule:
iptables -t nat -I POSTROUTING -p tcp -d --dport 80 -j
SNAT --to-source

which can be listed using this:
# iptables -t nat -L | sed '/POSTROU/,/^$/!d'
target     prot opt source               destination
SNAT       tcp  --  anywhere          tcp
dpt:http to:

.. but anyway this rule is completely ommited and snoop on target server
# snoop -d vnet1 port 80
Using device vnet1 (promiscuous mode) -> HTTP C port=51620 -> HTTP R port=51620 -> HTTP C port=51620

.. which indicates, that target server tries to reply to client without
using snat on balancer .. 

any help or suggestion will be very appreciated .. thanks and regards
ave, daniel

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>