Error: Could not establish data connection: Connection refused

Need help with FileZilla Server? Something does not work as expected? In this forum you may find an answer.

Moderator: Project members

Message
Author
aconti74
504 Command not implemented
Posts: 10
Joined: 2016-02-25 21:40
First name: Anthony
Last name: Conti

Error: Could not establish data connection: Connection refused

#1 Post by aconti74 » 2016-02-26 00:45

Hello my server stop working yesterday for some reason. I am not experienced IT person. After reading the posts here on this topic I have checked my router and computer firewall, my nat on router, called my ISP to see if they are blocking ports, try changing to another port from port 21. I rolled back the window updates when it stop working. Turn of the windows firewall and updated my server. I read the Network Configuration page and follow the instructions for fire settings.

System Details

Filezilla server 0.9.55 beta
windows 8.1
static IP
port 21 open and pointing to server
port 990 open and pointing to server
port 1984 open and point to server (alt to port 21)


Here is the log when using ftptest.net

Code: Select all

Warning: Plaintext FTP is insecure. You should use explicit FTP over TLS.
Status: Resolving address of ftp.sysmetgroup.com
Status: Connecting to 50.1.126.51
Warning: The entered address does not resolve to an IPv6 address.
Status: Connected, waiting for welcome message...
Reply: 220-*****************************************
Reply: 220-*** Welcome to SMG FTP Server
Reply: 220-*** FileZilla Server 0.9.55 beta
Reply: 220-*** Contact: Anthony Conti
Reply: 220-*** 415.395.7005
Reply: 220 *****************************************
Command: CLNT https://ftptest.net on behalf of 173.228.63.70
Reply: 200 Don't care
Command: USER smg
Reply: 331 Password required for smg
Command: PASS *******
Reply: 230 Logged on
Command: SYST
Reply: 215 UNIX emulated by FileZilla
Command: FEAT
Reply: 211-Features:
Reply: MDTM
Reply: REST STREAM
Reply: SIZE
Reply: MODE Z
Reply: MLST type*;size*;modify*;
Reply: MLSD
Reply: AUTH SSL
Reply: AUTH TLS
Reply: PROT
Reply: PBSZ
Reply: UTF8
Reply: CLNT
Reply: MFMT
Reply: EPSV
Reply: EPRT
Reply: 211 End
Command: PWD
Reply: 257 "/" is current directory.
Status: Current path is /
Command: TYPE I
Reply: 200 Type set to I
Command: PASV
Reply: 227 Entering Passive Mode (50,1,126,51,197,116)
Command: MLSD
Error: Could not establish data connection: Connection refused
If my router is malicious what do I need to do fix this? How to test?
Attachments
Passive Settings
Passive Settings
Capture.PNG (54.17 KiB) Viewed 8668 times

User avatar
botg
Site Admin
Posts: 35492
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Error: Could not establish data connection: Connection refused

#2 Post by botg » 2016-02-26 07:54

What about the 1001 ports that aren't forwarded?

aconti74
504 Command not implemented
Posts: 10
Joined: 2016-02-25 21:40
First name: Anthony
Last name: Conti

Re: Error: Could not establish data connection: Connection refused

#3 Post by aconti74 » 2016-02-26 19:01

I added ports 30000-31000(Web server for router 50000-51000?) to my Nat and Firewall. Still no luck. but new error.

Code: Select all

Warning: Plaintext FTP is insecure. You should use explicit FTP over TLS.
Status: Resolving address of ftp.sysmetgroup.com
Status: Connecting to 50.1.126.51
Warning: The entered address does not resolve to an IPv6 address.
Status: Connected, waiting for welcome message...
Reply: 220-*****************************************
Reply: 220-*** Welcome to SMG FTP Server
Reply: 220-*** FileZilla Server 0.9.55 beta
Reply: 220-*** Contact: Anthony Conti
Reply: 220-*** 415.395.7005
Reply: 220 *****************************************
Command: CLNT https://ftptest.net on behalf of 173.228.63.70
Reply: 200 Don't care
Command: USER smg
Reply: 331 Password required for smg
Command: PASS *******
Reply: 230 Logged on
Command: SYST
Reply: 215 UNIX emulated by FileZilla
Command: FEAT
Reply: 211-Features:
Reply: MDTM
Reply: REST STREAM
Reply: SIZE
Reply: MODE Z
Reply: MLST type*;size*;modify*;
Reply: MLSD
Reply: AUTH SSL
Reply: AUTH TLS
Reply: PROT
Reply: PBSZ
Reply: UTF8
Reply: CLNT
Reply: MFMT
Reply: EPSV
Reply: EPRT
Reply: 211 End
Command: PWD
Reply: 257 "/" is current directory.
Status: Current path is /
Command: TYPE I
Reply: 200 Type set to I
Command: PASV
Reply: 227 Entering Passive Mode (50,1,126,51,118,148)
Command: MLSD
Reply: 425 Can't open data connection for transfer of "/"
Error: Listing failed
Last edited by aconti74 on 2016-02-27 02:45, edited 1 time in total.

User avatar
botg
Site Admin
Posts: 35492
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Error: Could not establish data connection: Connection refused

#4 Post by botg » 2016-02-26 21:35

I added ports 30000-31000(Web server for router 50000-51000?) to my Nat and Firewall. Still no luck. but new error.
Why the offset of 20000? That won't work, it needs to be 0.

aconti74
504 Command not implemented
Posts: 10
Joined: 2016-02-25 21:40
First name: Anthony
Last name: Conti

Re: Error: Could not establish data connection: Connection refused

#5 Post by aconti74 » 2016-02-26 22:44

My router said those ports were taken by the web server interface(for the router I believe. not running a web server) when I tried 50000-51000. I changed the ports in ftp server as well. Does it have to be ports 50000-51000?
Attachments
Capture.PNG
Capture.PNG (58.21 KiB) Viewed 8613 times

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

Re: Error: Could not establish data connection: Connection refused

#6 Post by boco » 2016-02-27 02:30

No, if it had to be 50000-51000, then you wouldn't be able to change it. You can choose any range you want, but there are a few basic rules:

- Ports below 1025 MUST NOT be used as they are privileged system ports. Why Windows still lets you use these ports is beyond me. Note @botg: Why you do not restrict Custom port ranges to non-privileged ports, e. g. 1025-65535 in place of 1-65535?
- Ports from 1025 to 49151 may be used, but aren't optimal. There are still various services using these ports.
- Ports from 49152 to 65535 are ephemeral ports and recommended by us.
- Use a range that's big enough. Essentially it's the number of listings and transfers that can be done in 4 minutes. Calculate the maximum number of users that may hit your server at the same time, as they all share the available ports.
### BEGIN SIGNATURE BLOCK ###
No support requests per PM! You will NOT get any reply!!!
FTP connection problems? Please do yourself a favor and read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
### END SIGNATURE BLOCK ###

aconti74
504 Command not implemented
Posts: 10
Joined: 2016-02-25 21:40
First name: Anthony
Last name: Conti

Re: Error: Could not establish data connection: Connection refused

#7 Post by aconti74 » 2016-02-27 02:41

Changed the ports to 60000-60100 on Server, NAT & Windows 8.1 Firewall (inbound & outbound).

Still having the same error

Code: Select all

Reply: 227 Entering Passive Mode (50,1,126,51,234,127)
Command: MLSD
Reply: 425 Can't open data connection for transfer of "/"
Error: Listing failed 

User avatar
botg
Site Admin
Posts: 35492
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Error: Could not establish data connection: Connection refused

#8 Post by botg » 2016-02-27 09:08

boco wrote: Note @botg: Why you do not restrict Custom port ranges to non-privileged ports, e. g. 1025-65535 in place of 1-65535?
Good question, never thought about that.
aconti74 wrote:Changed the ports to 60000-60100 on Server, NAT & Windows 8.1 Firewall (inbound & outbound).

Still having the same error

Code: Select all

Reply: 227 Entering Passive Mode (50,1,126,51,234,127)
Command: MLSD
Reply: 425 Can't open data connection for transfer of "/"
Error: Listing failed 
So port 60000 is forwarded to 60000, 60001 is forwarded to 60001, 60002 is forwarded to 60002 and so on?

aconti74
504 Command not implemented
Posts: 10
Joined: 2016-02-25 21:40
First name: Anthony
Last name: Conti

Re: Error: Could not establish data connection: Connection refused

#9 Post by aconti74 » 2016-02-28 05:40

Yes ports 60000-60100 are forwarded to 60000-60100

User avatar
botg
Site Admin
Posts: 35492
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Error: Could not establish data connection: Connection refused

#10 Post by botg » 2016-02-28 08:43

I'm starting to run out of ideas. There's one thing you could still try: FTP over TLS.

aconti74
504 Command not implemented
Posts: 10
Joined: 2016-02-25 21:40
First name: Anthony
Last name: Conti

Re: Error: Could not establish data connection: Connection refused

#11 Post by aconti74 » 2016-03-01 00:30

I tried that. Same problem. If I use ftp from the command prompt (windows 8.1) I can login and download a file. No other client works.

User avatar
botg
Site Admin
Posts: 35492
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Error: Could not establish data connection: Connection refused

#12 Post by botg » 2016-03-01 07:11

Windows' ftp.exe always uses active mode, it does not support passive mode. Virtually all other FTP clients use passive mode by default.

Macktek
550 File not found
Posts: 33
Joined: 2016-03-03 19:04
First name: Mack

Re: Error: Could not establish data connection: Connection refused

#13 Post by Macktek » 2016-03-05 20:21

Can you confirm that the internal ip address for your server has not changed from the one you have set in your router for port forwarding ?
For ex. if the router is forwarding to 192.168.100 and your current internal address on the server has changed to .102 that might cause problems.

aconti74
504 Command not implemented
Posts: 10
Joined: 2016-02-25 21:40
First name: Anthony
Last name: Conti

Re: Error: Could not establish data connection: Connection refused

#14 Post by aconti74 » 2016-03-08 21:43

My Server is set to a static ip address & it matches the ip address in the nat table

aconti74
504 Command not implemented
Posts: 10
Joined: 2016-02-25 21:40
First name: Anthony
Last name: Conti

Re: Error: Could not establish data connection: Connection refused

#15 Post by aconti74 » 2016-03-09 01:57

Update: I put my modem/router in bridge mode and now the server is working. I am not sure what changed on my modem/router to make it stop working one day. :x

Post Reply