LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

[lvs-users] IPVS with SNAT support on the kernel 2.6.36 + iptables v1.4.

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: [lvs-users] IPVS with SNAT support on the kernel 2.6.36 + iptables v1.4.10
From: Ivan Havlicek <ivan@xxxxxxxxxxx>
Date: Tue, 9 Nov 2010 10:30:12 +0100
Hi,

I try to use IPVS with SNAT support on the kernel 2.6.36 + iptables
v1.4.10 without success :

All needed modules are loaded :
# lsmod | grep -e ipvs -e ip_vs
xt_ipvs                 1376  2
ip_vs_wlc               1248  2
ip_vs                 103280  7 xt_ipvs,ip_vs_wlc
libcrc32c                728  1 ip_vs
nf_conntrack           42376  8
ip_vs,ipt_MASQUERADE,iptable_nat,nf_nat,nf_conntrack_ipv4,xt_state,xt_connmark,xt_conntrack
x_tables               11496  26
ipt_LOG,xt_ipvs,ip6table_filter,ip6_tables,ebtables,xt_CHECKSUM,iptable_mangle,ipt_MASQUERADE,iptable_nat,xt_state,ipt_REJECT,xt_tcpudp,iptable_filter,ipt_addrtype,xt_NFQUEUE,xt_iprange,xt_owner,xt_hashlimit,xt_connmark,xt_conntrack,xt_multiport,xt_dscp,xt_DSCP,xt_mark,xt_string,ip_tables
ipv6                  194120  73 ip_vs

My LVS configuration :
ipvsadm --list -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  88.190.12.128:80 wlc
  -> 10.1.3.31:80                 Masq    100    0          0
  -> 10.1.3.32:80                 Masq    100    0          1
  -> 10.1.3.33:80                 Masq    100    0          1

So, Adding the SNAT :
iptables -t nat -I POSTROUTING -m ipvs --vaddr 88.190.12.128 --vport
80 -j SNAT --to-source 10.1.3.254

But the iptables rule doesn't work :
# iptables -vn -t nat -L POSTROUTING
 pkts bytes target     prot opt in     out     source
destination
    0     0 SNAT       all  --  *      *       0.0.0.0/0
0.0.0.0/0           vaddr 88.190.12.128 vport 80 to:10.1.3.254
(tcpdump show any snat translation too)

And when I try to have all ipvs traffic log :
iptables -t nat -I POSTROUTING -m ipvs --vaddr 88.190.12.128 -j LOG
--log-prefix "ipvs/POSTROUTING : "
# iptables -vn -t nat -L POSTROUTING
 pkts bytes target     prot opt in     out     source
destination
    0     0 LOG        all  --  *      *       0.0.0.0/0
0.0.0.0/0           vaddr 88.190.12.128 LOG flags 0 level 4 prefix
`ipvs/POSTROUTING : '
I've no output...

Did I miss something ?
Any help welcome.
-- 
                                                               Ivan Havlicek

_______________________________________________
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>