AKZN Notes

Archives for My Lazy and Forgetful Mind

How to Set up ZeroTier for Port Forwarding in OpenWrt

ZeroTier is a virtual network software that allows users to create a private network with ease. One of its features is the ability to perform port forwarding, which is crucial in accessing devices remotely. In this article, we'll guide you on how to set up ZeroTier for port forwarding in OpenWrt.

Step 1: Connect ZeroTier

The first step is to connect ZeroTier to your network. You can do this by installing the ZeroTier client on your device and creating a network. Once you've created a network, you can add your device to the network by sharing the network's ID with it. After that, wait for the device to connect to the network.

Step 2: Add a Route

The next step is to add a route to your ZeroTier network. To do this, log in to your ZeroTier account on zerotier.com and navigate to the "Network" section. Find the network you've created and click on the "Advanced" button. Then, select "Add Route" and enter the following details:

  • Destination IP address (IP address of your modem)
  • Via (IP address of your ZeroTier device)

This will ensure that traffic from your modem is forwarded to your ZeroTier device.

Step 3: Enable Port Forwarding

The final step is to enable port forwarding on your router. To do this, log in to your OpenWrt router and navigate to the "Firewall" section. Click on the "Port Forwards" tab and click "Add" to create a new port forward. Enter the following details:

  • Protocol (TCP or UDP)
  • External zone (wan)
  • External port (the port you want to forward)
  • Internal zone (lan)
  • Internal IP address (IP address of your ZeroTier device)
  • Internal port (the port you want to forward to)

Once you've entered all the details, click "Save & Apply" to apply the changes.

Another way to add NAT forwarding to and from a ZeroTier network device:

  • Create a new zone called "zerotier".
  • Edit the created zone and go to the advanced settings.
  • On menu "covered device" choose the ZeroTier device.
  • To be able to ping devices behind the router, make sure to select the correct zone to be forwarded in the general setting > Allow forward to destination zones

Conclusion

Setting up ZeroTier for port forwarding in OpenWrt is a simple process that requires just a few steps. By following the steps outlined in this article, you can easily access your devices remotely and enjoy a secure private network.

Leave a Reply

Your email address will not be published.