LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: How to NAT The FTP-DATA Connection?

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: How to NAT The FTP-DATA Connection?
From: Horms <horms@xxxxxxxxxxxx>
Date: Wed, 27 Dec 2006 11:00:22 +0900
On Tue, Dec 26, 2006 at 12:39:59PM -0800, Joseph Mack NA3T wrote:
> On Tue, 26 Dec 2006, Robinson, Eric wrote:
> 
> >>Do you have the ip_vs_ftp module loaded?
> >
> >In fairness to Joe, he told me to load the ftp helper module in his very
> >first message on Friday morning, but I questioned this because the HOWTO
> >states in several places that the helper module is only required for
> >*passive* ftp. Then Graeme read the source code and confirmed that the
> >helper is in fact required for active FTP.
> >
> >Unfortunately, I thought the module was already loaded because
> >ip_vs_ftp.ko showed up in the output of modprobe. That was a pure newbie
> >mistake. I checked just now and lsmod did not show it. After loading it,
> >things now work correctly!
> 
> this has been a long haul. The ftp_helper strikes again. I'm glad we've 
> figured 
> out what's going on.
> 
> >A couple of observations...
> >
> >1. Joe, I gather from this that ip_vs_ftp does NOT necessarily load
> >automatically when you run ipvsadm with ftp as a virtual service, as you
> >indicated on Friday. Does that mean I should put it in rc.local?
> 
> I guess so, anywhere will do.
> 
> Horms,
>       Eric's setup didn't load ip_vs_ftp. Any ideas what might be going on?

An old version of ipvsadm? ftp is running on a port other than 21?
The module couldn't be found by modprobe for some reason?

The auto-loading thing is just a hack for the convenience of most people.
Basically, in recent versions of ipvsadm if it sees that you are setting
up a virtual service on port 21, it guesses that there is a good chance
that it is ftp and tries to load ip_vs_ftp.

If you are using a port other than 21, then you will need to set the
ports argument to the module when it is loded

insmod ip_vs_ftp.ko ports=8021

The default is 21. You can have up to IP_VS_APP_MAX_PORTS (8).
They are comma delimited

insmod ip_vs_ftp.ko ports=21,8021,9021

> >2. It might be a good idea to amend the HOWTO. It seems the helper
> >module is ALWAYS needed, not just for passive ftp.
> 
> glad we have that figured out. I couldn't imagine how ftp would work without 
> it, but Wensong said it wasn't needed. I wondered if he'd written the ftp 
> helper function for active ftp into ip_vs. I'll put it the next HOWTO (Jan 
> 2007's is out already).

I just skimmed through the code, and it seems to listen for both the
PASV and PORT command. My FTP knowledge is a bit rusty, but I think the
latter is for non-passive ftp, so yes it seems to be needed for both.

-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/


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