uFTP - FTP Server

uftp server, open source ftp server, linux ftp server, linux ftp server for embedded, easy to configure ftp server, ftp server for initramfs

User Tools

Site Tools


ftp-server-nat

uFTP - FTP server under NAT

FTP servers can work under NAT but there are 3 main issues to solve.

The 1st one is that the service standard port (21 is the standard FTP port) needs to be forwarded to the FTP server.

The 2nd is that for file transfer and other command such as LIST, a second TCP channel need to be established in a random port. To solve this issue a port range should be configured in the uftp server config file and the router should be configured accordingly.

The 3rd and last problem is that the ftp ip address should be sent to the client, if the FTP is under NAT the IP address should be written in the config of uftp server. Luckily modern FTP clients such as FileZilla don't need this configuration, they can redirect the connection on the endpoint automatically.

uFTP can easily set to work under NAT, some parameters need to be adjusted.

1) Set the FTP main port, default value is on port 21. Configure accordingly the NAT settings in your route to forward the TCP connection on the uFTP server machine to port 21.

#TCP/IP PORT SETTINGS (DEFAULT 21)
FTP_PORT = 21

2) Set the FTP port range used for passive connections and configure the router accordingly to forward the TCP range to the uFTP server machine.

#
# Random port for passive FTP connections range
#
RANDOM_PORT_START = 1024
RANDOM_PORT_END   = 1524

3) Set the SERVER_IP parameter with the external static IP address. This parameter is not really important since modern FTP server can overcome this issue.

#USE THE SERVER IP PARAMETER IF THE FTP SERVER IS UNDER NAT
#SERVER IP SHOULD BE SET TO ROUTER IP IN THIS CASE
#IF NOT IN USE LEAVE IT COMMENTED OR BLANK
#USE , instad of . eg: 192,168,1,1
SERVER_IP = 192,168,1,1

uFTP should work with no problem with this configuration.

ftp-server-nat.txt · Last modified: 2024/04/25 19:39 by kingk