xt_ipvs match does not translate source address for ipvs

To: lvs-devel@xxxxxxxxxxxxxxx, netfilter-devel@xxxxxxxxxxxxxxx, Hannes Eder <heder@xxxxxxxxxx>
Subject: xt_ipvs match does not translate source address for ipvs
From: Vincent Li <>
Date: Thu, 27 Jun 2013 15:46:36 -0700

I am running most recent net-next git tree version and compiled the
xt_ipvs match extension for ipvs, here is the info:

# uname -a
Linux vincent-hp 3.10.0-rc6-ipvs-with-nat #3 SMP Wed Jun 26 21:19:32
PDT 2013 i686 GNU/Linux

Module                  Size  Used by
xt_TRACE                 726  0
xt_tcpudp               1895  0
iptable_raw             1162  0
xt_LOG                 11066  0
arptable_filter         1122  0
arp_tables              9012  1 arptable_filter
iptable_filter          1302  0
xt_nat                  1746  2
iptable_nat             2646  1
nf_conntrack_ipv4      12368  1
nf_defrag_ipv4          1181  1 nf_conntrack_ipv4
nf_nat_ipv4             3487  1 iptable_nat
ip_tables              10235  3 iptable_raw,iptable_filter,iptable_nat
nf_nat                 14458  3 xt_nat,iptable_nat,nf_nat_ipv4
xt_ipvs                 1620  2
x_tables               15304  10
binfmt_misc             5844  1
ppdev                   5120  0
ip_vs_rr                1643  2
ip_vs                 148089  6 xt_ipvs,ip_vs_rr
nf_conntrack           77550  5
libcrc32c                855  1 ip_vs

root@vincent-hp:/usr/src/net-next# iptables -t nat -n -L
target     prot opt source               destination

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

target     prot opt source               destination
SNAT       all  --              vaddr vport 80 to:
SNAT       all  --              vaddr vport 22 to:

# ipvsadm -L -n

IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP rr
  ->                Masq    1      0          0
TCP rr
  ->                 Masq    1      0          0
  ->                Masq    1      0          0

no any filter, mangle, raw iptable rules.

the ipvs load balance works fine, but running tcpdump on LVS director
and real server shows the client source address is not translated to
specified address

I used TRACE target in raw filter to trace the packet, I saw the
packet went through 'nat' table PREROUTING chain, not POSTROUTING

I am using LVS NAT mode. I have seen this issue before with previous
kernel 3.6.x release, but not bothered to file report, it hasn't
worked for me so I am wondering if I am missing something or there is
bug in xt_ipvs match extension, any debugging tips or idea would be

I can post the tcpdump capture or debugging message with TRACE in raw
table if needed

To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at

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