Batmen.cc


Setup ZeroTier on OpenWRT

Date: []
Categories: [Tech]
Tags: [Networking], [Linux], [OpenWRT]

ZeroTier is a powerful networking tool that allows you to create virtual networks, making it easy to connect devices across different physical locations. This is my simple guide on the process of installing and configuring ZeroTier on an OpenWRT router.

Prerequisites

Before you begin, ensure that you have the following:

  1. An OpenWRT-compatible router with administrative access.
  2. A ZeroTier account and network ID. If you don't have one, you can sign up at ZeroTier Central.

Step-by-Step Guide

Step 1: Stop Other VPN Services

It is recommended to stop any other VPN services running on your router to avoid conflicts. You can do this through the OpenWRT web interface or via SSH.

Step 2: Install ZeroTier Package

  1. Update the Package List:

    Open an SSH connection to your router and run the following command to update the package list:

    opkg update
  2. Install ZeroTier and IPSet:

    Install the ZeroTier package along with IPSet, which is required for proper functioning:

    opkg install zerotier
    opkg install ipset

Step 3: Configure ZeroTier

  1. Edit the ZeroTier UCI Configuration:

    Use a text editor like vim to edit the ZeroTier configuration file located at /etc/config/zerotier:

    vim /etc/config/zerotier
  2. Add Your Network ID:

    Add the following configuration to the file, replacing <network id> with your actual ZeroTier network ID:

    config zerotier 'sample_config'
        option enabled '1'
        list join '<network id>'

    Save and close the file.

Step 4: Approve the Join Request

  1. Log in to ZeroTier Central:

    Go to ZeroTier Central and log in to your account.

  2. Approve the Join Request:

    Navigate to your network settings and approve the join request from your OpenWRT router. This step is crucial for the router to join the network.

Step 5: Restart Services and Verify

  1. Restart ZeroTier and Firewall Services:

    Restart the ZeroTier and firewall services to apply the changes:

    service zerotier restart
    service firewall restart
  2. Check the IP Address:

    Verify that the router has obtained an IP address from the ZeroTier network:

    ip a

    Look for an entry that corresponds to the ZeroTier interface (usually zt0).

Additional Tips

Conclusion

Congratulations! You have successfully installed and configured ZeroTier on your OpenWRT router. Your router should now be part of your ZeroTier network, allowing you to connect devices seamlessly across different locations.

For more advanced configurations and troubleshooting, refer to the ZeroTier documentation and the OpenWRT documentation.