LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] ipvs or apache/mod_proxy/mod_balancer

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [lvs-users] ipvs or apache/mod_proxy/mod_balancer
From: Olaf Krische <public@xxxxxxxxxx>
Date: Fri, 3 Jul 2009 11:32:41 -0700 (PDT)
(Seriously, i read the howto. Sorry if it seems i dont.)

I am here:

7.7.2. Realserver's default gw, route to realserver from router

I have the realserver (192.168.2.xx) in the private network. 
My default gateway for this network does NAT only. I can not use it 
to route back to the client. It does not pass "VIP -> CIP"  to the 
next "internet" router.

So an alternative is what i need, which is not covered in the howto:

I can use the second interface (eth1) on the realserver,
setting on it an "internet" IP and changing the default route to the 
"internet" router. Then i have a default route to the client,
which works perfectly.

$ ip route add default via $router dev eth1

But i dont want to do this, since i waste this exact IP plus the realserver
is reachable from the internet.

So i bring up eth1 without IP:

$ ifconfig eth1 0 up

And putting the VIP on lo:0:

$ ifconfig lo:0 $VIP netmask 255.255.255.255 up

And say, that all traffic shall go over eth1 in general:

$ ip route add default dev eth1

This is not enough, since it doesnt know yet,
that the traffic on eth1 shall go to $router.

So i try this by "ip route", which does not work:

$ ip route add default via $router dev eth1

But with the route command it works:

$ route add default gw $router dev eth1

Now i have all what i want!  And it works. I can even ping.

But i am not sure, if that is alright. Not that the router thinks now,
that the VIP belongs to the realserver and does not use the 
LoadBalancer anymore. Mh.

And what is weird now as well, when i watch the routing table,
that there it is written, what the "ip route" actually denied me to do:

$ ip route
...
default via $router dev eth1 
default dev eth1  scope link

But I can remove the rule:

$ ip route del default via $router dev eth1

But i can not add it again with "ip route add", just with "route add" as
before.

# not working:  ip route add default via $router dev eth1
# working:   route add default gw $router dev eth1

Weird, weird, weird.


-- 
View this message in context: 
http://www.nabble.com/ipvs-or-apache-mod_proxy-mod_balancer-tp24184926p24327104.html
Sent from the LVS mailing list archive at Nabble.com.


_______________________________________________
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

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