LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: LVS-NAT and multiple gateways on real servers

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: LVS-NAT and multiple gateways on real servers
From: Neil Prockter <prockter@xxxxxxxxx>
Date: Fri, 9 Jul 2004 09:57:26 +0100
Hello

If I understand you right then
http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.LVS-NAT.html#NAT_default_gw

Should help

It describes how not to have the director as the default gateway which might
suit you better anyway?

This has the advantage that traffic generate on the real server (say from a
dns or ntp client) will not go via the director


But to have it the way you've outlined then on the real server

echo 22 maintain >> /etc/iproute2/rt_tables
ip route add default 10.60.24.1 table maintain
ip rule add from 10.60.25.127 table maintain

in my, albeit limited, understanding this says

use maintain as a name for routing table 22
traffic using the table maintain uses a default route of 10.60.24.1
traffic from ip 10.60.25.127 should use table maintain

most importantly for you this includes replies to the traffic that came to
10.60.25.127

So that should take care of it?

I see no reason why you could not skip the name to number entry and just add

ip route add default 10.60.24.1 table 22
ip rule add from 10.60.25.127 table 22

to /etc/rc.local so it gets set again after reboot

btw. 22 could be any unused number between 1 and 252

I'd recommend going the way the faq suggests as should you have trouble
with this routing you'd have a broken (but fixable) server with maintaince
access is imo better than a working server with no maintaince access.
additionally dns request etc will not need to go via the director

Neil
On Thursday 08 Jul 2004 18:49, Farrell, Doug wrote:
> Hi all,
>
> I'm using the RedHat Piranha version of LVS and have successfully
> configured an LVS-NAT configuration with two backend real servers. These
> servers host two web sites and appear as two VIP's on the load balancer.
> This is a test site for a possible production deployment, so I'm still
> experimenting. I'd like to gain direct access to the backend servers via
> our corporate network, bug can't seem to figure out a configuration that
> will make this work.
>
> Director
> eth0    IP : 10.60.25.125       gateway=10.60.24.1
> eth0:1 VIP : 10.60.25.131
> eth1    IP : 192.168.1.101
> eth1:1 VIP : 192.168.1.103
>
>
> Real Server 1
> eth0    IP : 192.168.1.104      gateway=192.168.1.103
> eth1    IP : 10.60.25.127
>
>
> With this setup if I have Real Server 1's gateway set to 192.168.1.103 and
> have eth1 disabled, the system works fine. However, what I'd like to do is
> enable eth1, physically connected to the 10.60.25.* network and have it use
> the 10.60.24.1 gateway directly. Every configuration of the
> /etc/sysconfig/network-scripts/ifcfg-eth* files I've tried fails. Usually
> what happens is I can ssh to Real Server 1 on 10.60.25.127, but the
> Director no long provides the load balanced service and I can't reach the
> real servers through it anymore.
>
> Anyone have any ideas or suggestions about how to make this work?
>
> Thanks
> Doug Farrell
> Scholastic, Inc.
> _______________________________________________
> LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
> Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
> or go to http://www.in-addr.de/mailman/listinfo/lvs-users
<Prev in Thread] Current Thread [Next in Thread>