LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

ipvs + source nat

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: ipvs + source nat
From: trietz <trietz@xxxxxxxxxxx>
Date: Thu, 12 Oct 2006 15:29:30 +0200
Hi,

im very confused and can't find any solution for my problem. These list is my last hope.

Im using LVS-NAT for a simple rr-loadbalancing between two sendmail servers. I setup a director with 3 NICs, one for the external connection(eth0) and the other two(eth1 and eth2) for connecting my realservers over crosspatch cable.
My director got two external ip adresses on the external interface.
These is the output from ip addr show:

1: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
   link/ether 00:30:05:45:8b:9d brd ff:ff:ff:ff:ff:ff
   inet x.x.x.122/27 brd x.x.x.127 scope global eth0
   inet x.x.x.123/27 brd x.x.x.127 scope global secondary eth0
2: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
   link/ether 00:30:05:3f:ab:e2 brd ff:ff:ff:ff:ff:ff
   inet 192.168.0.254/24 brd 192.168.0.255 scope global eth1
3: eth2: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
   link/ether 00:d0:b7:25:8c:06 brd ff:ff:ff:ff:ff:ff
   inet 192.168.0.253/24 brd 192.168.0.255 scope global eth2
4: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue
   link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
   inet 127.0.0.1/8 scope host lo

And these is the output from ipvsadm-save:

-A -t x.x.x.123:smtp -s rr
-a -t x.x.x.123:smtp -r 192.168.0.1:smtp -m -w 1
-a -t x.x.x.123:smtp -r 192.168.0.2:smtp -m -w 1
-A -t x.x.x.122:smtp -s rr
-a -t x.x.x.122:smtp -r 192.168.0.1:smtp -m -w 1
-A -t x.x.x.123:imaps -s rr
-a -t x.x.x.123:imaps -r 192.168.0.1:imaps -m -w 1

The packages intialized by the realservers will be SNATed with iptables on the director successfully. My problem: loadbalancing works fine, but i see a lot of the reply packages from the realserver leaving the director on interface eth0 with there internal ips 192.168.0.1 and 192.168.0.2.


The command 'tcpdump -i eth0 -n net 192.168.0.0/24' shows these:

15:18:57.030848 IP 192.168.0.1.35848 > 66.21.125.195.25: F 3251166362:3251166362(0) ack 2859045522 win 5840 15:18:57.061016 IP 192.168.0.2.47977 > 207.115.20.22.25: FP 1094427615:1094427621(6) ack 855764034 win 1460 <nop,nop,timestamp 64017492 418423715>

Any Ideas?

Thanks in advance,
Thomas

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