Difference between revisions of "Template:Networking rutos configuration example Setting up a ZeroTier tunnel between RUTX devices"

From Teltonika Networks Wiki
(Created page with "<b>ZeroTier One</b> is an open source software product which establishes Peer to Peer VPN (P2PVPN) connection between laptops, desktops, phones, embedded devices, cloud resour...")
(23 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Introduction==
 
 
<b>ZeroTier One</b> is an open source software product which establishes Peer to Peer VPN (P2PVPN) connection between laptops, desktops, phones, embedded devices, cloud resources, and apps.
 
<b>ZeroTier One</b> is an open source software product which establishes Peer to Peer VPN (P2PVPN) connection between laptops, desktops, phones, embedded devices, cloud resources, and apps.
  
 +
==Introduction==
 
This article contains step-by-step instructions on how to set up and manage a Zerotier network tunnel using two Teltonika-Networks RUTX devices.
 
This article contains step-by-step instructions on how to set up and manage a Zerotier network tunnel using two Teltonika-Networks RUTX devices.
  
Line 13: Line 13:
 
==Configuration scheme==
 
==Configuration scheme==
  
[[File:Networking rutos configuration example Setting up a ZeroTier tunnel between RUTX device schem v1.png|border|class=tlt-border|1100x1100px]]
+
 
 +
[[File:Networking_RUTXxx_configuration_example_Setting_up_a_ZeroTier_tunnel_between_RUTX_device_schem.png|border|class=tlt-border|1100x1100px]]
  
 
==Setting up a ZeroTier network==
 
==Setting up a ZeroTier network==
Line 19: Line 20:
 
<ul>
 
<ul>
 
     <li>Go to https://my.zerotier.com/login and log in or create an account if you haven't already.</li>
 
     <li>Go to https://my.zerotier.com/login and log in or create an account if you haven't already.</li>
     <li>Click the newly created network to begin configuration.<br>[[File:Networking rutos configuration example Setting up a ZeroTier tunnel between RUTX device networknameID v1.png|border|class=tlt-border|1054px]]</li>
+
     <li>Open the 'Networks' tab and click the 'Create a Network' button.<br>[[File:Zerotier_configuration_1.png|border|class=tlt-border]]</li>
 
+
    <li>Click the newly created network to begin configuration.<br>[[File:Zerotier_configuration_2.png|border|class=tlt-border]]</li>
      <ol>
+
    <li>Before configuring anything else, you may want to set up some basic settings.
        <li>Open the ''''Networks'''' tab and click the ''''Create a Network'''' button.<br></li>
 
        <li>Before configuring anything else, you may want to set up some basic settings.</li>
 
    </ol>
 
 
 
[[File:Networking rutos configuration example Setting up a ZeroTier tunnel between RUTX device create network v1.png|border|class=tlt-border|1054px]]
 
 
 
 
         <ol>
 
         <ol>
             <li>Copy the '''Network ID'''; you will need it later for ZeroTier node configuration.</li>
+
             <li>Copy the Network ID; you will need it later for ZeroTier node configuration.</li>
 
             <li>Optionally, set up a name and description for your network for easier management.</li>
 
             <li>Optionally, set up a name and description for your network for easier management.</li>
             <li>Select ''''Private'''' access control type; unless you want nodes to connect freely, without authorization.</li>
+
             <li>Select 'Private' access control type; <u>unless</u> you want nodes to connect freely, without authorization.</li>
         </ol>
+
         </ol>[[File:Zerotier_configuration_3.png|border|class=tlt-border]]
 
     </li>
 
     </li>
            [[File:Networking rutos configuration example Setting up a ZeroTier tunnel between RUTX device basic settings v1.png|border|class=tlt-border|1054px]]
+
     <li>Scroll down to find the 'IPv4 Auto-Assign' section. Select one of the provided private IP ranges for your network or click 'Advanced' and set up the range manually. For this example we'll be using the <b>10.147.17.*</b> selection which means our network will be using the <b>10.147.17.0/24</b> IP range.<br>[[File:Zerotier_configuration_4.png|border|class=tlt-border]]</li>
     <li>Scroll down to find the ''''IPv4 Auto-Assign'''' section. Select one of the provided private IP ranges for your network or click 'Advanced' and set up the range manually. For this example we'll be using the <b>10.147.17.*</b> selection which means our network will be using the <b>10.147.17.0/24</b> IP range.<br>[[File:Networking rutos configuration example Setting up a ZeroTier tunnel between RUTX device ipv4 autoassign v2.png|border|class=tlt-border]]</li>
 
 
</ul>
 
</ul>
  
Line 44: Line 38:
 
==Node configuration==
 
==Node configuration==
  
Zerotier <b>nodes</b> or <b>members</b> are clients that can connect to a ZeroTier network. This section provides information on how to configure ZeroTier nodes on RUTX devices.
+
Zerotier <b>nodes</b> or <b>members</b> are clients that can connect to a ZeroTier network. This section provides information on how to configure ZeroTier nodes on different types of machines.
 
 
Take note that if ''''Private'''' access control type is selected, the nodes will only come online after they authorized by you from the ZeroTier Central dashboard. To learn how to authorize nodes, read the [[#Node_authorization|Node authorization]] section of this article.
 
  
===Teltonika-Networks RUTX device===
+
===Teltonika-Networks device===
 
----
 
----
 
<ul>
 
<ul>
     <li>Log into your device's WebUI, and navigate to the '''Services → Package Manager page'''.</li>
+
     <li>Log in to your device's WebUI, and navigate to the Services → Package Manager page.</li>
 
     <li>Find the ZeroTier package in the list and install it.</li>
 
     <li>Find the ZeroTier package in the list and install it.</li>
     <li>Navigate to the '''Services → VPN → ZeroTier''' page and create a new ZeroTier configuration.
+
     <li>Navigate to the Services → VPN → ZeroTier page and create a new ZeroTier configuration.
 
         <ol>
 
         <ol>
 
             <li>Enter a custom name for the configuration.</li>
 
             <li>Enter a custom name for the configuration.</li>
             <li>Click ''''Add''''.</li>
+
             <li>Click 'Add'.</li>
         </ol>
+
            <li>Click the 'Edit' button next to the newly created configuration.</li>
 +
         </ol>[[File:Zerotier_configuration_5.png|border|class=tlt-border]]
 
     </li>
 
     </li>
    <li>
 
    </li>[[File:Networking rutos configuration example Setting up a ZeroTier tunnel between RUTX device add intance v1.png|border|class=tlt-border|1054px]]
 
    <li>Click the ''''Edit'''' button and will be forwarded to the newly created configuration menu.</li>[[File:Networking rutos configuration example Setting up a ZeroTier tunnel between RUTX device edit intance v1.png|border|class=tlt-border|1054px]]
 
 
     <li>Complete the configuration.
 
     <li>Complete the configuration.
 
         <ol>
 
         <ol>
 
             <li>Turn the configuration on.</li>
 
             <li>Turn the configuration on.</li>
             <li>Paste the ZeroTier Network ID into the ''''Networks'''' field.</li>
+
             <li>Paste the ZeroTier Network ID into the 'Networks' field.</li>
             <li>Click ''''Save & Apply''''.</li>
+
             <li>Click 'Save & Apply'.</li>
            <li>You will be redirected to the overview and the '''node ID''' will be created automatically</li>
+
         </ol>[[File:Zerotier_configuration_6.png|border|class=tlt-border]]
         </ol>
 
[[File:Networking rutos configuration example Setting up a ZeroTier tunnel between RUTX device enable intance v1.png|border|class=tlt-border|1054px]]
 
 
 
 
     </li>
 
     </li>
 
</ul>
 
</ul>
  
==Node authorization==
+
==RUTX configuration==
  
When Access Control is set to ''''Private'''', you will have to approve new nodes manually from the ZeroTier dashboard before they can become members of the network.
 
  
To do this, simply scroll down to the ''''Members'''' section and:
+
Connect to router's '''WebUI''', go to '''Services > VPN > GRE Tunnel'''. Enter a name for your GRE instance, click '''ADD''' and when instance appears in '''GRE Configuration''' field, click '''Edit'''.
  
<ol>
+
[[File:Networking_RUTXxx_configuration_example_gre_instance_v1.png]]
    <li>Place check marks next to nodes you wish to authorize.</li>
 
    <li>Additionally, you may want to add names and descriptions for your nodes to make it easier to differentiate between them.</li>
 
</ol>
 
  
[[File:Networking rutos configuration example Setting up a ZeroTier tunnel between RUTX device node authorization v1.png|border|class=tlt-border]]
+
Then apply the configuration presented below.  
  
==Testing configuration==
+
[[File:Networking_RUTXxx_configuration_example_rut_settings_v1.png]]
===Ping Test===
 
----
 
  
If you've followed all the steps presented above, your configuration should be finished. But as with any other configuration, it is always wise to test the setup in order to make sure that it works properly. In order to test the '''ZeroTier''' Tunnel connection.
+
#'''Enable''' instance.
 +
#Select '''Tunnel source''' (select your WAN interface).
 +
#Enter '''Remote endpoint IP address''' (Cisco WAN IP).
 +
#Set '''MTU''' to '''1440'''.
 +
#Enable '''Don't fragment'''.
 +
#Write '''Local GRE interface IP address''' (create GRE tunnel IP address or just use the same as in the example).
 +
#Write '''Local GRE interface netmask''' (create GRE tunnel netmask or just use the same as in the example)
 +
#Leave everything else as default and click '''Save & Apply'''.
  
<ol>
 
  <li>login to RUTX WebUI and go to '''Services → CLI'''.</li>
 
  <li>Login with user name: '''root''' and the router's admin password.</li>
 
  <li>From there you should then be able to '''ping''' the opposite instance's virtual IP address.</li>
 
  <li>To use a ping command, type '''ping <ip_address>''' and press the "Enter" key on your keyboard:</li>
 
</ol>
 
  
[[File:Networking rutos configuration example Setting up a ZeroTier tunnel between RUTX device ping test v2.png|border|class=tlt-border]]
 
  
If the ping requests are successful, congratulations, your setup works! If not, we suggest that you review all steps once more.
+
==Testing configuration==
  
===ZeroTier Commands===
+
If you've followed all the steps presented above, your configuration should be finished. But as with any other configuration, it is always wise to test the setup in order to make sure that it works properly. In order to test the GRE Tunnel connection, login to RUTX WebUI and go to '''Services → CLI'''. Login with user name: '''root''' and the router's admin password. From there you should then be able to '''ping''' the opposite instance's virtual IP address. To use a ping command, type '''ping <ip_address>''' and press the "Enter" key on your keyboard:
----
 
Also it's possible to get information about the VPN tunnel configuration and status via '''CLI'''. If you would like to use the '''zerotier-cli''' commands, you need to login to the WebUI:
 
<ol>
 
  <li>Go to '''Services → CLI'''.</li>
 
  <li>Login with user name: '''root''' and the router's '''admin password'''.</li>
 
  <li>Write '''zerotier-cli help''' command and press the "Enter" key on your keyboard:</li>
 
</ol>
 
  
The RUTX will show the commands the '''zerotier-cli''' can issue, for this example we'll get the VPN info/status and IP address.<br><br>
+
[[File:Networking_RUTXxx_configuration_example_test_v1.png]]
<li>Getting info/status:</li>
 
<pre>zerotier-cli info</pre>
 
<li>Getting IP address:<br><span style="color: red;"><b>Note: Need to write your own network ID</b></span></li>
 
<pre>zerotier-cli get <network ID> ip</pre>
 
  
[[File:Networking rutos configuration example Setting up a ZeroTier tunnel between RUTX device zerotier commands v1.png||border|class=tlt-border]]
+
If the ping requests are successful, congratulations, your setup works! If not, we suggest that you review all steps once more.

Revision as of 21:30, 7 July 2020

ZeroTier One is an open source software product which establishes Peer to Peer VPN (P2PVPN) connection between laptops, desktops, phones, embedded devices, cloud resources, and apps.

Introduction

This article contains step-by-step instructions on how to set up and manage a Zerotier network tunnel using two Teltonika-Networks RUTX devices.

Prerequisites

You will need:

  • Two Teltonika RUTX routers
  • A PC to configure the routers

Configuration scheme

1100x1100px

Setting up a ZeroTier network

  • Go to https://my.zerotier.com/login and log in or create an account if you haven't already.
  • Open the 'Networks' tab and click the 'Create a Network' button.
    Zerotier configuration 1.png
  • Click the newly created network to begin configuration.
    Zerotier configuration 2.png
  • Before configuring anything else, you may want to set up some basic settings.
    1. Copy the Network ID; you will need it later for ZeroTier node configuration.
    2. Optionally, set up a name and description for your network for easier management.
    3. Select 'Private' access control type; unless you want nodes to connect freely, without authorization.
    Zerotier configuration 3.png
  • Scroll down to find the 'IPv4 Auto-Assign' section. Select one of the provided private IP ranges for your network or click 'Advanced' and set up the range manually. For this example we'll be using the 10.147.17.* selection which means our network will be using the 10.147.17.0/24 IP range.
    Zerotier configuration 4.png

The last step concludes the ZeroTier network configuration. However, you may want to modify to the settings based on your specific requirements, but the network will function without any additional settings.

The next step is configuring members (aka nodes) for our ZeroTier network.

Node configuration

Zerotier nodes or members are clients that can connect to a ZeroTier network. This section provides information on how to configure ZeroTier nodes on different types of machines.

Teltonika-Networks device


  • Log in to your device's WebUI, and navigate to the Services → Package Manager page.
  • Find the ZeroTier package in the list and install it.
  • Navigate to the Services → VPN → ZeroTier page and create a new ZeroTier configuration.
    1. Enter a custom name for the configuration.
    2. Click 'Add'.
    3. Click the 'Edit' button next to the newly created configuration.
    Zerotier configuration 5.png
  • Complete the configuration.
    1. Turn the configuration on.
    2. Paste the ZeroTier Network ID into the 'Networks' field.
    3. Click 'Save & Apply'.
    Zerotier configuration 6.png

RUTX configuration

Connect to router's WebUI, go to Services > VPN > GRE Tunnel. Enter a name for your GRE instance, click ADD and when instance appears in GRE Configuration field, click Edit.

Networking RUTXxx configuration example gre instance v1.png

Then apply the configuration presented below.

Networking RUTXxx configuration example rut settings v1.png

  1. Enable instance.
  2. Select Tunnel source (select your WAN interface).
  3. Enter Remote endpoint IP address (Cisco WAN IP).
  4. Set MTU to 1440.
  5. Enable Don't fragment.
  6. Write Local GRE interface IP address (create GRE tunnel IP address or just use the same as in the example).
  7. Write Local GRE interface netmask (create GRE tunnel netmask or just use the same as in the example)
  8. Leave everything else as default and click Save & Apply.


Testing configuration

If you've followed all the steps presented above, your configuration should be finished. But as with any other configuration, it is always wise to test the setup in order to make sure that it works properly. In order to test the GRE Tunnel connection, login to RUTX WebUI and go to Services → CLI. Login with user name: root and the router's admin password. From there you should then be able to ping the opposite instance's virtual IP address. To use a ping command, type ping <ip_address> and press the "Enter" key on your keyboard:

Networking RUTXxx configuration example test v1.png

If the ping requests are successful, congratulations, your setup works! If not, we suggest that you review all steps once more.