none
The data connection could not be established: ECONNREFUSED - Connection refused by server error While connecting to FTP

    Question

  • Hi,

    I am having windows server 2008 R2 and I have created two FTP sites on it. first is running on port 21 and second is running on custom port 33333.

    Internally both sites are working and I am able to see the listed directories. but when I am trying to access both sites from external network it is not showing anything after successful user authentication. 

    I have also tried to access it via Filezilla it showing below mentioned message.

    On Port 21 first Site

    Status: Connection established, waiting for welcome message...
    Response: 220 Microsoft FTP Service
    Command: USER administrator
    Response: 331 Password required for administrator.
    Command: PASS ********
    Response: 230 User logged in.
    Command: OPTS UTF8 ON
    Response: 200 OPTS UTF8 command successful - UTF8 encoding now ON.
    Status: Connected
    Status: Retrieving directory listing...
    Command: PWD
    Response: 257 "/" is current directory.
    Command: TYPE I
    Response: 200 Type set to I.
    Command: PASV
    Error: Connection timed out
    Error: Failed to retrieve directory listing

    and Site 2 on Port 33333 showing 

    Status: Server sent passive reply with unroutable address. Using server address instead.
    Command: LIST
    Response: 150 Opening BINARY mode data connection.
    Error: The data connection could not be established: ECONNREFUSED - Connection refused by server
    Error: Connection timed out
    Error: Failed to retrieve directory listing

    Please help me to run FTP..


    Thanks, Manoj


    • Edited by Manoj-Kumar Wednesday, April 30, 2014 9:58 AM
    Wednesday, April 30, 2014 9:51 AM

Answers

  • Thanks for you help.

    It is working now. I have configured the passive port range on FTP Server and entered my Router's External IP in FTP Server.

    I have also allowed and forwarded passive port range on Router.

    Cheers


    Thanks, Manoj

    • Marked as answer by Manoj-Kumar Monday, May 05, 2014 3:27 AM
    Monday, May 05, 2014 3:27 AM

All replies

  • Hi Manoj,

    Thank you for posting in Windows Server forum.

    Please verify that you have forwarded correct ports during the setup and it must be opened. Also the client you're connecting from by chance located behind the same NAT as the server? If so, you need to use your private IP address to connect to the server.
    You can have a look for the procedure in the following article.
    Configuring FTP Firewall Settings 
    http://learn.iis.net/page.aspx/309/configuring-ftp-firewall-settings/

    Hope it helps!

    Thanks.

    Dharmesh Solanki

    Thursday, May 01, 2014 7:28 AM
    Moderator
  • Hi,

    Thanks for input.

    I have checked these port by http://www.yougetsignal.com/tools/open-ports/ and even on FTP server these ports are listing. 

    I am able to see the directory listing via CMD on port 21

    but unable to access it on port 55555 while I can access it internally. and this port is open and forwarded correctly.

    It is showing the error message 

    501 Server cannot accept argument.
    150 Opening ASCII mode data connection.

    Thanks, Manoj


    • Edited by Manoj-Kumar Thursday, May 01, 2014 10:31 AM
    Thursday, May 01, 2014 10:25 AM
  • Hi

    It's a normal behavor, the data port seem closed/not forwarded. You need to forward/open the data port too.The port 21 and 33333 is the control's port, the data port does not work the same way depending on PASV or active's mode.

    In Active mode it's port >1024 and you can't know wich's one it will be. In PASV's mode you give a range usually. How To Configure PassivePortRange In IIS

    Usually I see user forwarding the port range to the correct server.

    Another thing you can make, depending on your router, is to make it in a DMZ, with a port shield if you can. (that technology can have other name depending on the router) That way the server is in a DMZ, but isolated in another VLAN. You can make rule to access it after.



    Regards, Philippe

    Don't forget to mark as answer or vote as helpful to help identify good information. ( linkedin endorsement never hurt too :o) )

    Answer an interesting question ? Create a wiki article about it!

    Friday, May 02, 2014 2:11 AM
    Moderator
  • Thanks for you help.

    It is working now. I have configured the passive port range on FTP Server and entered my Router's External IP in FTP Server.

    I have also allowed and forwarded passive port range on Router.

    Cheers


    Thanks, Manoj

    • Marked as answer by Manoj-Kumar Monday, May 05, 2014 3:27 AM
    Monday, May 05, 2014 3:27 AM