# Ftp List Directory Problem



## lamany1977 (Feb 21, 2014)

Dear all, I have a pure-ftpd as FTP server and the port is 2121, my server have local IP address: 192.168.1.200 and the server is behind the ISP network. If I access through LAN from FTP client like: filezilla, winscp, etc, every thing is fine, the error is goes when I am access from external using public ip from my ISP, 202.xxx.xxx.xxx:2121 from ftp client, 

```
starting the season...
reading remote directory...
retrieving directory list...

Server sent passive reply with unroutable address 192.168.1.200, using host address instead.
Transfer channel can't be opened. Reason: No connection could be made because the target machine actively refused it.
Could not retrieve directory listing
```

Any solution?

regards

irwan


----------



## SirDice (Feb 21, 2014)

FTP uses a data channel on a random port for the transfer. Port 21 is only used for authentication and commands. This explains the process rather well: http://slacksite.com/other/ftp.html


----------



## lamany1977 (Feb 21, 2014)

so we can not change the port : 21 for any reason ?

regards

irwan


----------



## SirDice (Feb 21, 2014)

lamany1977 said:
			
		

> so we can not change the port : 21 for any reason?


You can but the problem of the data channel will remain. FTP is notoriously tricky to firewall. Depending on your firewall you may need to use ftp-proxy(8). But if you're behind a router that also NATs it may never work properly.


----------



## lamany1977 (Feb 21, 2014)

alright thank you very much


----------



## kpa (Feb 21, 2014)

The way to do it is to use an FTP server software that allows you to set the passive mode data ports manually and port forward those ports on the router to the server. I'm not sure if ftp/pure-ftpd has such an option, I know that ftp/proftpd has because I've done such a set up using it.


----------

