I have a TP-Link Archer C7 router. When I used it as my router connected to my modem I had an FTP server that was accessible remotely from another network. Now I have a mobile 4G router and I am using my TP-Link router as an access point. The FTP server works normal on a local network as expected, but since I'm not connected to the WAN with it, I can't connect to that FTP server remotely. Is it possible for me to set up that remote FTP somehow?


Yes, any good-quality home gateway router (or mobile 4G personal gateway router) should be capable of being configured to allow incoming connections to an FTP server on the NAT-private (LAN) side of the router.

Basically, you just need to forward the FTP control port (port 21/TCP) from the public IP address of the router to port 21 on the NAT-private IP address of the FTP server. Some products call this "port mapping", "port forwarding", or "virtual server".

Note that for this to work well, your NAT gateway router (in this case this is your mobile 4G router) must have what's known as an "FTP ALG" (Application-Layer Gateway). That's because FTP is a tricky protocol for NATs to handle. FTP not only puts copies of IP addresses inside the payload of FTP control port message packets, it also makes separate connections for each file transfer or directory listing, and in some cases (depending on whether it's an FTP client or an FTP server behind the NAT, and whether active vs. passive mode FTP is being used), that could mean the NAT has to monitor the control connection to watch for when a file transfer connection is being negotiated, and rewrite those messages to specify a free port, and create a dynamic port mapping for that connection.

All that stuff is tricky enough that I've seen a lot of NAT gateway software that gets it wrong, especially when it's an FTP server behind the NAT instead of just a client. So, caveat lector, I guess. Good luck.

  • Okay so now I know it's possible but I still don't really get it how to do it. I have a mobile router on and a AP on I tried port forwarding my router to port 21 on but it doesn't work. What am I doing wrong? – Nenad Aug 16 '17 at 16:27
  • @Nenad It sounds like you set it up right, but try this: From outside your LAN, on a machine that is NOT behind a NAT, try to connect to the public IPv4 address of your mobile router via active mode FTP. Actually try just pinging the public IP address of your router first, then try active FTP. – Spiff Aug 16 '17 at 16:34
  • @Nenad or check your port mapping functionality with something less challenging like HTTP first. – Spiff Aug 16 '17 at 16:35
  • when I try to ping it from outside the LAN the request times out – Nenad Aug 16 '17 at 16:44
  • Check the admin UI of your 4G router. Are you sure it's getting a public IPv4 address? A lot of wireless providers use "carrier-grade NAT", so it's possible that your router is on a private address and can't be reached from the internet (for new incoming connections). – Spiff Aug 16 '17 at 18:14

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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