In order to successfully set up an FTP server on windows 10 you'll need to do the following.
- Assign a static ip address to the computer running the FTP server via the DHCP Server running in your router.
- Enable your DHCP server
- Set the starting ip address
- Set the number of ip addresses
- Assign an ip address to the mac address the FTP server is running on
- Forward ports in your router.
- Forward a single port, port 21, to the static ip address you set up in step 1.4 and set the protocol to TCP
- Forward a range of ports (in this tutorial we'll use ports 50000 - 51000) to the static ip address you set up in step 1.4 and set the protocol to TCP
- Set up an inbound rule in the windows 10 firewall to allow your FTP server program to pass through, and set the protocol to TCP
- Install the FTP server and adjust its settings
- Set the port for the admin interface (this tutorial sets the port to 14147)
- Set the single port for FTP to listen on (same port as step 2.1)
- Set the custom port range (same port as step 2.2)
- Set the public ip address
- Generate a certificate for FTP over TLS
- Assign a user and password
In part one, you'll learn how to assign a static ip address on the computer running the FTP server. You'll also learn how to forward ports on your router.
Explanation: If your router is set up as a DHCP (dynamic host control protocol) server (which it probably is) your router will assign an ip addresses automatically (randomly) to devices connected to your local area network (LAN).
So lets say that you have two devices connected to your LAN. When you start or boot up device number one, it will connect to the router and the DHCP server will assign that device a random ip address, for example, 192.168.1.101. Then, lets say you boot up device number two, which also connects to your router and the DHCP server assigns it an ip address of, for example 192.168.1.102.
Now lets say that you shut down both devices and then restart them in reverse order. Now device number two may receive an ip address of 192.168.1.101 and device number one will receive an ip address of 192.168.1.102. So if your ftp server is running on device number one and it shuts down, or you reboot it, it may not receive the same ip address from the DHCP server from your router. And because you need to forward a port to that device in your router (more on this later) you'll need to assign that device a static ip address so that it won't change on reboot.
How to assign a static ip address to your device
If you already know how to login to your router you can skip steps 1-5, otherwise, you'll first need to find the mac id (Media Access Control) for your network card.
- Open the Command prompt by right clicking on the windows icon in the task bar, choose the run option, then type "cmd" (without the quotes) in the run dialog box.
- At the prompt, type "ipconfig /all" (without the quotes, note: there is a space before the /all)
- A bunch of data will be displayed in the command prompt window. You will be looking for four things
- The Correct port
- The Physical Address
- The IPv4 Address
- And the Default Gateway
- Scroll down and look for the Ethernet adaptor port your using. If your connected to your router via. an Ethernet cable the port will start with "Ethernet". If your connected via. wi-fi the port will start with "Wireless" (the port i'm using is highlighted in white) You may have more than one port so make sure you choose the correct one. Now look for the line that reads "Physical Address". Next to that will be displayed your mac address (highlighted in red). It will be in the hexadecimal format. Look for your IPv4 Address (highlighted in yellow) and finally look for the Default gateway (highlighted in blue)
An example of the correct port will look similar to screen capture below.
- Open a web browser and point it to the default gateway ip address (which is your router), in my case its 192.168.1.1
- You'll need to login to your router. I can't help you here. If you don't know your login credentials you'll need to do a search for the default login credentials for the particular make and model of your router.
- After you've logged into your router you'll be looking for your routers "DHCP Reservation" page. My Linksys pages are as follows. Click on the Connectivity link in the menu. Your router menu will look different than mine unless you have a Linksys router.
- Click on the "Local Network" tab
- Make sure that the DHCP Server is enabled. Notice that I set the "start ip address" to 1.100. I could have set it to 1.2 if I wanted, which would have allowed for more ip addresses. Also notice I'm limiting the number of ip addresses to 25. That is just my preference for my LAN. After you have added your starting ip address click on the "DHCP Reservation" link below.
- Here is where you add the static ip address for your network card. In my router all the devices found in my LAN are listed in the 1st table, so all I needed to do was to select the device and add it to the DHCP Reservation list. If your router does not populate your devices you'll have to manually enter your mac address (you found it from the command prompt window in step 4) and the ip address you want to assign for that device. Notice in the 2nd table, you can edit the device and change the ip address, as long as it's within the maximum ip range you set in the previous step. If you remember, I'm starting my ip range at 1.100 and limiting the number of ip addresses to 25, so my ip address range would be between 192.168.1.100 to 192.168.1.125. When your done, click ok to get back to the main menu.
- Now we need to forward the correct ports to to the right ip address. Open the "Security" tab in the main menu.
- Click on the "Apps and Gaming" tab in the Security page
- In the Apps and Gaming page click on the "Single Port Forwarding" link.
- Click on the "Add a new Single Port Forwarding" button to forward a port.
- Enter a name for the application, it can be anything you want, however, the name should be something you or others would recognize. Next, use 21 for the external port number (port 21 is the default ftp port number). For the protocol, select "TCP". FTP doesn't use UDP so don't select "both". Next, assign the ip address that you want to forward the port to. It needs to be the ip address you assigned to the mac address in step 10, and that machine will be running the FTP server. Save your settings and then click apply.
- Next you need to forward a range of ports for the ftp server to listen to. Click on the "Port Range Forwarding" link
- On the Port Range Forwarding page click on the "Add a new Range Forwarding" button.
- Give the Application A name. Enter a range of ports. The range has to start above 1024 and below 65,535. You can see I am listing on 1,000 ports. It could be less or it could be more. Choose "TCP" for the protocol, not both. Remember FTP doesn't use UDP so don't choose that protocol. Next, you need to assign the ip address. Use the same ip address you used in the "Single Port Forwarding" (step 15). It needs to be the ip address that the FTP server will be running on. Make sure that the ports are enabled and save, then Apply then Ok.
Now, in order for the router to assign the ip addresses you just set up, you need to Reboot your computer.
To check that the ip addresses were assigned successfully, repeat steps 1-4.