Skip to main content

Port Forwarding

When do you need to set up port forwarding?

If you're running a HOPRd node on your local machine or Dappnode, you're likely behind NAT (Network Address Translation), which is commonly used in home and office networks to allow multiple devices to share a single public IP address; this setup hides the internal IP addresses from the external network. To make your node reachable by external peers, you'll need to expose a specific port to the public; otherwise, your node won't be able to connect to other nodes.

When you don't need to set up port forwarding?

  • If you're running a HOPRd node on a VPS, you don't need to set up port forwarding.
  • We strongly recommend not forwarding your REST API port (default port is 3001) unless you're using a "Secret token" for secure connections. If you're using a VPS, ensure that port 3001 is not exposed to the public for security reasons.

How to configure port forwarding

1. Find the internal IP address

Determine the internal IP address of your machine running HOPRd. Please select your operating system or device:

(1) Open your terminal window.

(2) Run the following command:

hostname -I | cut -d' ' -f1

(3) The output should show your node's internal IP address.

Example:

192.168.5.68

2. Find your routers gateway IP address

To access your router's admin interface, you will need to find your router's default gateway IP address. Please select your operating system:

(1) Open your terminal window.

(2) Execute the command:

ip route show default | awk '/default/ {print $3}'

The output will display your router's gateway IP address. Commonly, the gateway IP addresses are 192.168.1.1 or 192.168.0.1.

(3) Enter the router's gateway IP address into your browser. This will load the login screen for your router, and it should usually display the model of your router.

3. Set up port forwarding on your router

(1) Access your router's admin interface by entering your gateway IP address into your browser.

(2) Each router brand will have its own method for setting up port forwarding, but it should usually be straightforward. Here is a list of instructions for the most popular router brands:

(3) Set up port forwarding using the following settings:

  • Internal Ip address: The internal IP address of your machine running the HOPRd node.

  • Protocol: You will need to set up port forwarding for both TCP and UDP.

  • Internal and external port: Use 9091 for both the internal and external ports. If you are running multiple nodes on the same machine, you will need to assign different ports for each node.

Example of how port forwarding settings looks:

Portforwarding rule