Do you support building FTP services to the public network? FTP+PASV+NAT routing?
Tmalll opened this issue · 3 comments
I built it in a device on a local area network
Its ip address is: 192.168.1.111
The port is the default 2122~2130
Other devices can use ftp://192.168.1.111:2121 normally
Then I mapped 192.168.1.111:2121 to the public IP on my openwrt router.
Finally, when I use ftp://domain name or public IP: 2121, it goes wrong, prompting 200 227 error, client I tried windows file browser and several other ftp clients.
In the information returned by the Windows File Explorer 227 error:
In the ip address, it shows the address of the local area network ip, not my public network ip.
The port is random and not 2122~2130 set in the configuration.
Is there an error there?
After my research, I found that the 200 227 error occurred after the ftpserver port was nat by the router, because the address returned by the ftpserver is the internal network address of the machine, not the public network address after nat.
Is there a setting for ftpserver to return the public network address, or it is also possible to provide a setting to return a specific domain name.
Using the filezilla client after port forwarding can avoid the 200 227 error, but this limits the client
Hi @wutongskype, to use it on a public IP address you have to use the public_host
property of the config file. See this sample config.
Hi @wutongskype, to use it on a public IP address you have to use the
public_host
property of the config file. See this sample config.
I get an error when I try to use the ddns domain name as public_host
level=error ts=2022-09-24T17:21:08.1513401Z caller=main.go:93 err="could not load settings: invalid passive IP \"www.xxxx.com\"" event="Problem listening"
level=info ts=2022-09-24T17:21:08.1518551Z caller=server.go:130 component=driver event="Waiting for last client to disconnect..."
Is there a way to make the public_host parameter support ddns domain names? Or is there another automated way to get the current public ip and then use it on the public_host parameter?