2

Today I was trying to set up an FTP server for my friend and myself. Server is in my home so I have no problem accessing it locally, but I am unable to open it to public. For my server configuration it is FileZilla server running on Windows 7 machine. I have disabled all firewalls so nothing is blocking it for now and I am able to connect to it in my local network.

What I have tried when it comes to opening it to local (on MikroTik router):  I have created a firewall NAT rule to forward from my public IP address and port 776 to the server IP address on port 21 and what I get from FileZilla when trying to connect from external network:

Status: Logged in
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/" is current directory.
Command: TYPE I
Response: 200 Type set to I
Command: PASV
Response: 227 Entering Passive Mode (31,134,50,169,198,229)
Command: MLSD
Error: The data connection could not be established: ECONNREFUSED - Connection refused by server
Response: 425 Can't open data connection for transfer of "/"
Error: Failed to retrieve directory listing

So as I see I am able to connect but can't actually read files. I know that there is this 'Passive Mode' problem, but from what I have read it is occurring when trying to connect, so it is not on me anymore? Correct me if I am wrong please.

I was also using this site to test for everything but it showed errors. I am new to this kind of stuff and not very skilled when it comes to setting up connections.

This question [from ServerFault] is talking about this stuff too, but I am unable to make it work. If anyone can explain to me step by step what do I do, please.

EDIT:

FileZilla output:

Command: MLSD
Error:    The data connection could not be established: ECONNREFUSED - Connection refused by server
Response: 425 Can't open data connection for transfer of "/"
Error:    Failed to retrieve directory listing

My NAT rule that forwards from my router IP and port 776 to server local port 21:

NAT rule that forwards from my router IP and port 776 to server local port 21

NAT rules that I have added to accept inbound and out traffic:

NAT rules added to accept inbound and out traffic

2

The problem is you are only opening port 21, and you need to open a bunch of others:

  • Outbound: TCP ports 1025 and above.
  • Inbound: TCP port 21 and TCP ports 1025 and above.

Try this and should work ok.

However that's a HUGE range of ports. You can limit your exposure by configuring a lower range of ports in the filezilla server, let's say from (50,100 to 51,100):

  • Open up the FileZilla GUI on your server.
  • Click on the top menu Edit -> Settings.
  • From the tree menu click on Passive mode settings.
  • Now make sure the checkbox Use custom port range is checked and enter 50100 in the first box a and 51100 in the second.

After that, make the same changes in your firewall, and you should be ok.

  • please see attached 3 pictures of what I have. I added that inbound and outbound accept but I guess it is not correct as it is still not working. I also addded my output from filezilla – user1031296 May 3 at 20:12
  • I found this article that may compliment, and add a few other things to check for. Try the part where it says: This usually happens, when the server is not aware of its external IP address and reports its internal IP address.: stackoverflow.com/questions/43758580/… – Luis Alberto Barandiaran May 3 at 20:38
  • wiki.filezilla-project.org/… wiki.filezilla-project.org/Network_Configuration I ahve tried the article but yeah, still got something wrong. I was hoping for it to be a quick and painless experience, but I will wrap my head around these two links, maybe they can provide some information I can understand. Thank you for your help, I will write if something changes – user1031296 May 3 at 21:22
  • okay so after some configuration something hit my head. When doing all this stuff described in these links, do I need these ports on my NAT router to be opened? I mean my ISP have open ports in range of 770-790 in my router so I can use them for varius purposes. So assuming that these other ports are not 'open', will I not be able to forward packets through them?? – user1031296 May 3 at 22:29
  • Yes! When I said firewall I meant both in your router, your PC, and if you have anything in between. Did that fix it? – Luis Alberto Barandiaran May 5 at 2:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.