From: Simon Horman <horms@verge.net.au>
To: lvs-devel@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, netfilter@vger.kernel.org,
netfilter-devel@vger.kernel.org
Cc: Malcolm Turnbull <malcolm@loadbalancer.org>,
Wensong Zhang <wensong@linux-vs.org>,
Julius Volz <julius.volz@gmail.com>,
Patrick McHardy <kaber@trash.net>,
"David S. Miller" <davem@davemloft.net>,
Hannes Eder <heder@google.com>
Subject: Re: [patch v2.5 3/4] IPVS: make FTP work with full NAT support
Date: Sun, 11 Jul 2010 18:01:31 +0900 [thread overview]
Message-ID: <20100711085959.GA28199@verge.net.au> (raw)
In-Reply-To: <20100710030222.732009020@vergenet.net>
On Sat, Jul 10, 2010 at 12:01:00PM +0900, Simon Horman wrote:
> From: Hannes Eder <heder@google.com>
>
> Use nf_conntrack/nf_nat code to do the packet mangling and the TCP
> sequence adjusting. The function 'ip_vs_skb_replace' is now dead
> code, so it is removed.
>
> To SNAT FTP, use something like:
>
> % iptables -t nat -A POSTROUTING -m ipvs --vaddr 192.168.100.30/32 \
> > --vport 21 -j SNAT --to-source 192.168.10.10
>
> and for the data connections in passive mode:
>
> % iptables -t nat -A POSTROUTING -m ipvs --vaddr 192.168.100.30/32 \
> > --vportctl 21 -j SNAT --to-source 192.168.10.10
>
> using '-m state --state RELATED' would also works.
>
> Make sure the kernel modules ip_vs_ftp, nf_conntrack_ftp, and
> nf_nat_ftp are loaded.
[snip]
> Index: nf-next-2.6/net/netfilter/ipvs/ip_vs_ftp.c
> ===================================================================
> --- nf-next-2.6.orig/net/netfilter/ipvs/ip_vs_ftp.c 2010-07-10 11:48:54.000000000 +0900
> +++ nf-next-2.6/net/netfilter/ipvs/ip_vs_ftp.c 2010-07-10 11:59:19.000000000 +0900
[snip]
> @@ -43,6 +57,16 @@
> #define SERVER_STRING "227 Entering Passive Mode ("
> #define CLIENT_STRING "PORT "
>
> +#define FMT_TUPLE "%pI4:%u->%pI4:%u/%u"
> +#define ARG_TUPLE(T) (T)->src.u3.ip, ntohs((T)->src.u.all), \
> + (T)->dst.u3.ip, ntohs((T)->dst.u.all), \
> + (T)->dst.protonum
> +
> +#define FMT_CONN "%pI4:%u->%pI4:%u->%pI4:%u/%u:%u"
> +#define ARG_CONN(C) (C)->caddr, ntohs((C)->cport), \
> + (C)->vaddr, ntohs((C)->vport), \
> + (C)->daddr, ntohs((C)->dport), \
> + (C)->protocol, (C)->state
>
> /*
> * List of ports (up to IP_VS_APP_MAX_PORTS) to be handled by helper
The argument to the %pI4 needs to be a pointer
so (T)->src.u3.ip should be &(T)->src.u3.ip and
(C)->caddr should be &(C)->caddr.ip.
I'm not sure how this slipped through the cracks so far.
I will repost.
next prev parent reply other threads:[~2010-07-11 9:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-10 3:00 [patch v2.5 0/4] [patch v2.4 0/4] IPVS full NAT support + netfilter 'ipvs' match support Simon Horman, Simon Horman
2010-07-10 3:00 ` [patch v2.5 1/4] netfilter: xt_ipvs (netfilter matcher for IPVS) Simon Horman, Simon Horman
2010-07-10 3:00 ` [patch v2.5 2/4] IPVS: make friends with nf_conntrack Simon Horman, Simon Horman
2010-07-10 3:01 ` [patch v2.5 3/4] IPVS: make FTP work with full NAT support Simon Horman, Simon Horman
2010-07-11 9:01 ` Simon Horman [this message]
2010-07-10 3:01 ` [patch v2.5 4/4] libxt_ipvs: user-space lib for netfilter matcher xt_ipvs Simon Horman, Simon Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100711085959.GA28199@verge.net.au \
--to=horms@verge.net.au \
--cc=davem@davemloft.net \
--cc=heder@google.com \
--cc=julius.volz@gmail.com \
--cc=kaber@trash.net \
--cc=linux-kernel@vger.kernel.org \
--cc=lvs-devel@vger.kernel.org \
--cc=malcolm@loadbalancer.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=netfilter@vger.kernel.org \
--cc=wensong@linux-vs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).