I am trying to configure my FTP running on my local machine which connects to my control panel (162.0.0.1) that has a built-in FTP client. My local server (192.168.1.30) is connected to the control panel as a game server with the public IP as (152.5.5.5). Port 20/21 is forwarded on my router, but for some reason I cannot get this FTP server to work on my local machine with access from outside my local network. Possibly I am configuring the FTP configuration wrong, but when running the FTP server can be access locally just not externally.
- 192.168.1.30 - Local FTP server with Daemon running on it & the game server behind my router.
- 152.5.5.5 - My external IP
- 162.0.0.1 - Control panel web server with the web based FTP client. This is a VPS in lalaland.
Config 162.0.0.1 --> 152.5.5.5 --> 192.168.1.30
The control panel is Multicraft made for managing game servers. They have a built in FTP client that uses net2ftp in the browser which connects to the FTP server in this case 152.5.5.5/192.168.1.30.
These are all linux machines, and the router is an ASUS with merlin firmware. Port 21, 20, 5000-6000 ports are forwarded on the router for FTP.
Here is the configuration file I am working with that is on the 152.5.5.5/192.168.1.30 machine.
[ftp]
## Wheter or not to enable the integrated FTP server, true/false
## default: true
enabled = true
## IP to listen on for FTP connections, uncomment to use the same as
## for the daemon.
## 0.0.0.0 means listening on all available interfaces (all IPs)
## default: same as the "ip" setting for the daemon, see above
ftpIp = 192.168.1.30
## See the descriptions of "externalIp" and "ip" for the daemon above
## default: same as "externalIp" if "ftpIp" is "0.0.0.0" otherwise "ftpIp"
#ftpExternalIp = 152.5.5.5
## Masquerade IP address to use for passive FTP connections when
## Multicraft is running behind a router.
## default: empty
ftpNatIp = 152.5.5.5
## A port range to use for passive data transfers. If this is not
## specified the FTP server will use random ports.
## Format: 4000-8000
## default: empty
ftpPasvPorts = 5000-6000
## Port to listen on for incoming FTP connections. Change this to
## something else if you are already running an FTP server on this
## system.
## default: 21
ftpPort = 21
## Regular expression matching files that can't be manipulated by
## users in any way. If you want users to be able to upload their own
## plugins instead of using the ones you provide for them you can
## just comment this option out.
## default: empty
forbiddenFiles =
## Set the level of detail for FTP server log messages in the multicraft.log.
## Errors will always be logged regardless of this setting.
## Available levels:
## full - Log all messages
## basic - Don't log client/server communication
## none - No FTP logging
## default: full
ftpLogLevel = full
## If this setting is enabled the FTP server will not be started when the main
## daemon process is started. You can start the FTP server separately by using
## "start_ftp" instead of "start" as the parameter to the daemon command.
## default: false
ftpSeparate = false
## The PID file for the FTP only process. The path is relative to "baseDir"
## default: multicraft_ftp.pid
ftpPidFile = multicraft_ftp.pid
## The log file to use for the FTP only process. This setting has no effect if
## the FTP server is started as part of the main daemon process (i.e. if
## "ftpSeparate" is false.
## default: multicraft.log (same as the daemon)
ftpLogFile = multicraftftp.log
## Throttle the FTP bandwidth (experimental)
## Incoming data throttle (Kb/s)
## default: 0 (unlimited)
#ftpThrottleIn = 0
## Outgoing data throttle (Kb/s)
## default: 0 (unlimited)
#ftpThrottleOut = 0
I have tried setting the ftpPasvPorts = with 5000-6000, but had no luck. Also switching around the IP/ExternalIp settings yeilds no results. I currently have no idea what I am doing with a lack of ideas.
To add to this, the local server 152.5.5.5/192.168.1.30 has a daemon running onto it which the FTP server uses. The daemon configuration is as follows below.
## The daemon will listen on the following IP/port.
## 0.0.0.0 to listen on all available interfaces (all IPs). Note that
## you will have to use the "externalIp" setting below if you set this
## to 0.0.0.0 as the control panel needs to know where to connect.
ip = 192.168.1.30
port = 25465
## If the external address is different from the listen address
## you can set the external address here. This setting will be saved
## to the DB and used by the control panel to connect to the daemon.
## default: same as "ip"
externalIp = 152.5.5.5
They're all in the same config file.
The daemon connects to the control panel on 162.0.0.1 which then allows the game server to be controlled from along with the FTP server. I have enabled passive FTP in the control panel.
Note* FTP works locally. I can access the FTP server 152.5.5.5/192.168.1.30 locally with filezilla, but not externally.
EDIT: Below is the error log from ftptest.net
Warning: Plaintext FTP is insecure. You should use explicit FTP over TLS.
Status: Resolving address of 152.5.5.5
Status: Connecting to 152.5.5.5
Warning: The entered address does not resolve to an IPv6 address.
Status: Connected, waiting for welcome message...
Reply: 220 Multicraft 2.1.1 FTP server
Command: CLNT https://ftptest.net on behalf of 152.5.5.5
Reply: 500 Command "CLNT" not understood.
Command: USER cisnet.3
Reply: 331 Username ok, send password.
Command: PASS **********
Reply: 230 Login successful
Command: SYST
Reply: 215 UNIX Type: L8
Command: FEAT
Reply: 211-Features supported:
Reply: EPRT
Reply: EPSV
Reply: MDTM
Reply: MLST type*;perm*;size*;modify*;unique*;unix.mode;unix.uid;unix.gid;
Reply: REST STREAM
Reply: SIZE
Reply: TVFS
Reply: UTF8
Reply: 211 End FEAT.
Command: PWD
Reply: 257 "/" is the current directory.
Status: Current path is /
Command: TYPE I
Reply: 200 Type set to: Binary.
Command: PASV
Reply: 227 Entering passive mode (192,168,1,30,186,215).
Error: Server returned unroutable private IP address in PASV reply
EDIT #2 I have finally figured out the main FTP problem. FTP now works from the external 152.5.5.5 address which connects to my local 192.168.1.30 machine by changing the ftppasv= 152.5.5.5. The control panel however does not want to connect to the FTP even in passive mode... trying to locate the control panel logs to uncover the hidden secret.... Also the FTP port was changed from 21 to 513.
nc). – Kamil Maciorowski Nov 24 '17 at 08:24154. ...and152. .... Maybe you tried to hide the real IP and failed. – Kamil Maciorowski Nov 24 '17 at 08:43ftpPasvPorts = 5000-6000. ButServer returned unroutable private IP address in PASV replysuggests there's (also?) something wrong with IP address your server passes to the client before the client initiates data transfer. Client side logs might reveal more details (e.g. what exactly the IP address passed to the client is). – Kamil Maciorowski Nov 24 '17 at 08:54