Set Up Port Forwarding

To successfully connect to the outside world, the storage node software is using TCP forwarded ports. The user must manually configure TCP port forwarding as it provides the most stable configuration possible.

If your router does not support TCP port forwarding, please have a look at chapter 5 of the Running a V3 Storage Node with PIA (VPN) guide to obtain a forwarded port.

One of the main hurdles for setting up a good working node is the port forwarding step, which has been the cause for many nodes showing OFFLINE status and, as a result, not being able to communicate with the network or receive any data. In this section, we will explain how to configure TCP port forwarding for our node.

Most consumer-grade routers use DHCP. DHCP gives your computers on the local network a new IP address after a certain amount of time (normally 24 hours). If our computer is given a new private IP address, it creates an issue - suddenly, the specified storage node TCP port will not match the private IP address of our system any more in the router configuration. When this happens, our computer will not be able to access the port any more and the port will thus be closed. To prevent this from happening, you have to set up a static private IP address. There are plenty of tutorials on this topic on the internet, including:

Windows
Linux

When done, make sure to restart your computer and check if the private IP address is still static. If the IP address changes after a reboot, it means that the IP is not static.

Ensure your Public IP Address is Static

To be able to use TCP port forwarding in storagenode, it is necessary that the port you will forward is linked to a public IP or hostname. Although one could use a public IP, most internet providers (ISPs) do not assign static public IPs, meaning that at some point in time your public IP address will change. The consequence of this is that the port you forwarded ceases to match the IP address specified in the storage node configuration parameters and thus the port will be inaccessible/closed. You can protect yourself against public IP address changes by assigning a hostname to your own local network with a service like noip. Even if you are not really sure if your public IP changes over time, it is still a good idea to configure a hostname, just in case. Below, we will walk through using both methods. If you plan to use a hostname, please skip straight to the Hostname Configuration section below.

Use a Static Public IP Address

If you are certain your public IP address is static, this step is straight-forward.

Open a browser and head over to Google or your favorite search engine and type in “what’s my IP”. The search should then return your public IP address. Alternately, you can get your public IP from https://www.whatsmyip.org/. Keep this IP address at hand as we will need it later.

Figure 1. Finding your public IP address.

Hostname Configuration

Note: You should only use one hostname for your entire local network, even if you plan to configure multiple drives/nodes or run storagenode on multiple machines (which is possible but not recommended because of IP filtering now implemented). This is true as long as the machines are connected to the same network and can thus be identified with the same public IP address. If you want to run one of the nodes behind a proxy or VPN on the same network, you would have to add another hostname. You will also need a new hostname if you want to run storagenode on another network.

If your public IP address is not static, your ISP will provide you with a new IP address after a certain amount of time. The consequence of this would be that when the IP address changes, the storage node would lose its connection to the network. Adding a hostname solves the issue of public IP change.

We will add a free hostname using NoIP which needs to be renewed every 30 days on a free account. On the NoIP website, scroll down to “Create Your Free Hostname now”, then do the following (Figure 2):

  • In the hostname input field, select a hostname of your liking (e.g. myhomestorjfarm), it can contain letters and numbers.

  • Next, select a hostname provider of your liking (e.g. “.ddns.net”) in the box to the right.

  • Click “Sign Up"

Figure 2. Adding our own hostname.

On the sign-up page, enter your email, username and password. Make sure to write these details down, as you will need them later (Figure 3).

Figure 3. NoIP registration page.
  • When done, click on “Create My Free Account”. NoIP will now send you a confirmation email with an activation link to your email address. Once you click on the activation link, it should take you to the NoIP website and confirm that your account is now active.

  • Now scroll down to where it says “How to remote access your device” and click “Get started with Dynamic DNS” (Figure 4)

Figure 4. The activation page: click on the large blue box to go to the hostname setup page.
  • Clicking on the link should take us to our NoIP dashboard.

  • Now scroll down to “Dynamic Update Client for Windows” (DUC) and click on“Download” (Figure 5). This should take you to the download page where you can download the DUC tool. On the download page click \“Download Now”

Figure 5. Dynamic Update Client download
  1. After the file has downloaded successfully, head over to the download folder and double click on the “DUCSetup” executable.

  2. On the resulting installation window, click on “Agree” -> “Install” -> “Finish”

Figure 6. DUC installation.
  1. The Dynamic Update Client should now open. Enter the username and password from step (4) above and click on “Sign In” (Figure 7).

Figure 7. Dynamic Update Client (DUC).
  1. Once you've logged in successfully, the “Edit groups/Hosts” menu should be displayed (Figure 8). If not already selected, choose the hostname box and click on “Save.”

Figure 8. From the Edit groups/Hosts menu, select the hostname and click on save.
  • The DUC tool will now come to life (Figure 9). Next go to “File” -> “Preferences” and select “Start this application automatically when the user logs on”. In case your computer reboots, DUC will automatically start in the background. This is very handy because if storagenode starts automatically, it will not run into a closed port as DUC is also already running.

Figure 9. DUC once configured correctly.

You now have a hostname and a dynamic update tool that automatically tracks and assigns the IP address to your hostname. So if your public IP changes, storagenode will not lose access to the TCP port. Please keep your hostname at hand as we will need it later.

Note: Some routers can also act as a DUC, in which case you can use the router conifguration directly instead of having to install the No-IP DUC. Search the router menus for "hostname" or "DDNS".

Router TCP Port Forwarding Configuration

Now that we have our public IP address or hostname (kademlia.external-address), it is necessary to link the kademlia.external-address to a specific TCP port by forwarding that port in your router. All communication to and from your node will pass through this port.

Note: Each drive/node should have its own TCP port, so in case you want to add multiple drives it would look like this (multi-drive installation is not currently supported yet, but we include it here for completeness so that you will know how to configure it when it becomes possible to do so):

First, before we can start our port forwarding journey, we need to know the gateway (router) private IP address so that we can gain access to the router. This can be done in the following ways:

Windows

Your router IP address can be found by typing in ipconfig into a CMD window (Figure 10). Then scroll down to “Default gateway” and copy-paste the router’s private IP address into a browser window (Figure 11).

Figure 10. Network settings.
Figure 11. Router Login page.

We can now log into our router and configure the TCP ports. The router manufacturer and model will vary from user to user and thus, the port-forwarding appearance and menu location within the router GUI will also differ.

Doing a quick Google or YouTube search for:

  • Port forwarding with <Your router brand and model>

Should bring up enough information to successfully configure port forwarding for your router, alternatively, the following website contains guides on how to port forward on most routers: https://portforward.com/.

Note: The port forwarding menu in most routers is under the “Security” menu called “Virtual server”.

Now copy the IPv4 address from the command prompt (CMD) window in which we executed the ipconfig command. This IPv4 address is the private internal IP address of our computer and is required to set the port forwarding rule (Figure 12).

In the example below the ports for three nodes/drives were added to the router:

  • Node 1: 4000

  • Node 2: 4001

  • Node 3: 4002

Figure 12. Port forwarding parameters for three nodes. Each row represents the forwarding parameters for a single node.

The current alpha release assumes that you are forwarding port 28967. In case of running multiple nodes connected to the same router, you would need to configure different ports for each (not supported in the current version yet).

Linux

The first thing we have to do is find our default gateway (router private IP address). This can be accomplished by typing in the following command into a terminal (Figure 13):

route -n

or

ip route show
Figure 13. Find your router gateway IP address.

Now copy your “Gateway” address as shown in red in the figure above (Figure 13). Paste the gateway address into a browser window (Figure 14). This should bring up the router login page

Figure 14. Router Login page.

We can now log into our router and configure the TCP ports. The router manufacturer and model will vary from user to user and thus the port-forwarding menu location within the router GUI will also differ.

Doing a quick google or YouTube search for:

  • Port forwarding with <Your router brand and model>

Should bring up enough information to open the ports. Alternatively, the following website contains guides on how to port forward on most routers: https://portforward.com/.

The port forwarding menu in most routers is under the “Security” menu called “Virtual server”.

Next, find the private IP address of the machine on which you want to run Storage Node, by executing the following command:

hostname -I

This should return your current static private IP address.

Now copy the IP address from the terminal window in which you executed the hostname -I command and use it to set the port forwarding rule in the router settings (Figure 15).

In the example below the ports for three nodes/drives were added to the router:

  • Node 1: 4000

  • Node 2: 4001

  • Node 3: 4002

Figure 15. Port forwarding parameters for three nodes. Each row represents the forwarding parameters for a single node.

The current alpha release assumes that you are forwarding port 28967. In case of running multiple nodes connected to the same router, you would need to configure different ports for each (not supported in the current version yet).

After following all these steps you should have the following:

  1. A configured hostname or knowledge of your static Public IP address.

  2. A static private IP address.

  3. Configured port forwarding for every node/drive you want to add to Storage Node.

For help with network configuration problems, please consult our Storage Node Networking Basics Documentation before submitting a support ticket to support@storj.io.