PASV returns private IP of server

Moderator: Project members

Post Reply
Message
Author
scpolo
500 Command not understood
Posts: 3
Joined: 2014-08-11 15:36
First name: scpolo
Last name: scpolo

PASV returns private IP of server

#1 Post by scpolo » 2014-08-11 15:47

Hi, masters.

I am developing a ftp client for a device with Windows Mobile. I am trying to connect with a ftp server (FileZilla Server version 0.9.41 beta) via GRPS through a public IP. I get to connect to ftp server and even I get logged on, but when I send PASV command, the server responds with the private IP instead of the public ip (I connected to public ip). First, I though the problem was in ftp server configuration, but I have tried to connect with filezilla client and the server responds with public ip correctly.

Any idea?

These are the logs:

FTP_CLIENT connected to xxx.yyy.88.157:21
FTP_CLIENT RECEIVED CMD RESPONSE: 220 FileZilla Server version 0.9.41 beta
FTP_CLIENT Sending command:USER my_user
FTP_CLIENT RECEIVED CMD RESPONSE: 331 Password required for my_user
FTP_CLIENT Sending command:PASS my_pass
FTP_CLIENT RECEIVED CMD RESPONSE: 230 Logged on
FTP_CLIENT Sending command:PASV
FTP_CLIENT RECEIVED CMD RESPONSE: 227 Entering Passive Mode (uuu,vvv,27,157,13,3)

User avatar
boco
Contributor
Posts: 26930
Joined: 2006-05-01 03:28
Location: Germany

Re: PASV returns private IP of server

#2 Post by boco » 2014-08-12 03:35

First, the latest and only supported FileZilla Server version is 0.9.46.

Second, especially mobile ISPs use carrier-grade-NAT due to IPv4 shortness or other issues. That means you're arriving at the FTP server with a NATed private IPv4, not a public one. In its default settings, the server responds to a private IPv4 with a private IPv4 in its PASV response. Otherwise, you couldn't use the server publicly and in LAN at the same time.
What you could try is unchecking the ''Don't use external IPs for local connections'' (Passive tab in General server settings). However, you might still fail to get a listing because of the ISP NAT.
No support requests over PM! You will NOT get any reply!!!
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org

scpolo
500 Command not understood
Posts: 3
Joined: 2014-08-11 15:36
First name: scpolo
Last name: scpolo

Re: PASV returns private IP of server

#3 Post by scpolo » 2014-08-12 09:02

Thanks for your quick reply. What you say makes sense, but I think I have an error in my develop because I can connect correctly to ftp server using internet explorer in my windows mobile device with uri format in the browser.

Thanks for your help, I hope solve this problem soon :)

scpolo
500 Command not understood
Posts: 3
Joined: 2014-08-11 15:36
First name: scpolo
Last name: scpolo

Re: PASV returns private IP of server

#4 Post by scpolo » 2014-09-19 09:10

Finally even unchecking the ''Don't use external IPs for local connections'' didn't work.

The way to solve this problem was checking ''Don't use external IPs for local connections'' and in "Passive mode settings" in "External Server IP Address for passive mode transfers" instead of check "Default" I set in "Use the following IP:" the IP public. So, in case of a local connection tries to connect the server will respond with local IP due to ''Don't use external IPs for local connections'' is checked. In other cases the server will respond with Public IP.

I do not like this solution but it works.

Thanks, friends!

Post Reply