LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: packets being sent out from the wrong ip-adress

To: Julian Anastasov <ja@xxxxxx>
Subject: Re: packets being sent out from the wrong ip-adress
Cc: List - LVS Users <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
From: Matthijs van der Klip <Matthijs.van.der.Klip@xxxxxxxxxxxxxx>
Date: Mon, 25 Nov 2002 14:25:28 +0100 (CET)
On Mon, 25 Nov 2002, Julian Anastasov wrote:
>       No, this is the way the REDIRECT method is working in 2.4,
> it uses NAT. IIRC:
>
> - change daddr in PRE_ROUTING for out->in packets (requests)
> - change saddr in POST_ROUTING for in->out packets (replies)

I've changed my iptables rules to do both of above actions:

iptables -t nat -A PREROUTING -i eth1 -p tcp -d $VIP --dport 80 -j
REDIRECT

_AND_

iptables -t nat -A POSTROUTING -o eth0 -p tcp -s 192.168.0.0/16 --sport 80
-j SNAT --to-source $VIP


I'm not sure if I'm supposed to do this but it seems to work. The second
rule simply rewrites all packets going out on my public interface (etho)
with a private source adress to have the VIP as source adress.

Ultimately I'd like to get rid of the redirect approach, but haven't been
able to get the hidden interface approach to work. The good news is I'm
supposed to get a whole stack of new boxes in a short while and I'll be
able to test and design a whole new production site. I will test the
hidden interface approach again then.


Regards,

-- 
Matthijs van der Klip, Unix Beheerder
Publieke Omroep Internet Beheer  []()
Gateway C -- Kamer 107 -- 035 6774252




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