LVS-NAT or direct routing or...?
Kristoffer Egefelt
dr.fersken at gmail.com
Tue May 23 09:17:39 BST 2006
Hello
On 5/22/06, Graeme Fowler <graeme at graemef.net> wrote:
>
> Hi
>
> On 22/05/2006 15:38, Kristoffer Egefelt wrote:
> > If I send a mail from a realserver to my gmail account, it have the
> source
> > address of the loadbalancer.
> > I would like it to have the source address of the Virtual Server. (so if
> I
> > reverse lookup the source ip address in the mail I get the Virtual
> Server
> > and not the loadbalancer)
>
> Although the director is offering LVS service for you, this problem has
> nothing whatsoever to do with LVS.
>
> You want a machine (the realserver) behind a masquerading server (the
> director) to appear to have a fixed IP address when making outbound
> connections to the internet.
>
> Easy.
>
> Simply have a SNAT rule on your director's external interface such that
> packets going out from the realserver get mapped to the VIP; assuming
> here that the external interface is eth0:
>
> iptables -t nat -I POSTROUTING -o eth0 \
> -s $REALSERVER_IP \
> -d 0/0 \
> -j SNAT --to-source $VIRTUAL_IP
This works perfectly!
Thanks guys..
/Kristoffer
I've used this many times to do a many-to-one mapping for realservers so
> that when they initiate external connections, they appear to come from
> the same IP.
>
> Graeme
> _______________________________________________
> LinuxVirtualServer.org mailing list - lvs-users at LinuxVirtualServer.org
> Send requests to lvs-users-request at LinuxVirtualServer.org
> or go to http://www.in-addr.de/mailman/listinfo/lvs-users
>
Search lvs-users Archives
More information about the lvs-users
mailing list