@@ -1280,6 +1280,103 @@ OpenWISP. Register or create a device before proceeding.
1280
1280
**Voila! ** You have successfully configured OpenWISP to manage VXLAN over
1281
1281
WireGuard tunnels for your devices.
1282
1282
1283
+ How to setup ZeroTier Tunnels
1284
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1285
+
1286
+ Follow the procedure described below to setup ZeroTier tunnels on your devices.
1287
+
1288
+ **Note: ** This example uses **Shared systemwide (no organization) ** option as
1289
+ the organization for VPN server and VPN client template. You can use any
1290
+ organization as long as VPN server, VPN client template and Device has same
1291
+ organization.
1292
+
1293
+ 1. Configure Self-Hosted ZeroTier Network Controller
1294
+ ####################################################
1295
+
1296
+ If you haven't already set up a self-hosted Zerotier network controller on your server,
1297
+ now is a good time to do so. You can start by simply installing Zerotier on your server
1298
+ from the `official website <https://www.zerotier.com/download/ >`_.
1299
+
1300
+ 2. Create VPN server configuration for ZeroTier
1301
+ ###############################################
1302
+
1303
+ 1. Visit ``/admin/config/vpn/add/ `` to add a new VPN server.
1304
+ 2. We will set **Name ** of this VPN server ``ZeroTier `` and **Host ** as
1305
+ ``my-zerotier-server.mydomain.com:9993 `` (update this to point to your ZeroTier VPN server).
1306
+ 3. Select ``ZeroTier `` from the dropdown as **VPN Backend **.
1307
+ 4. When using ZeroTier, OpenWISP takes care of managing IP addresses
1308
+ (assigning an IP address to each VPN clients (Zerotier network members).
1309
+ You can create a new subnet or select an existing one from the dropdown menu.
1310
+ You can also assign an **Internal IP ** to the Zerotier controller or
1311
+ leave it empty for OpenWISP to configure. This IP address will be used
1312
+ to assign it to the Zerotier controller running on the server.
1313
+ 5. Set the **Webhook AuthToken **, this will be ZeroTier authorization token which you
1314
+ can obtain by running the following command on the ZeroTier controller:
1315
+
1316
+ .. code-block :: shell
1317
+
1318
+ sudo cat /var/lib/zerotier-one/authtoken.secret
1319
+
1320
+ .. image :: https://raw.githubusercontent.com/openwisp/openwisp-controller/docs/docs/zerotier-tutorial/vpn-server-1.png
1321
+ :alt: ZeroTier VPN server configuration example 1
1322
+
1323
+ .. image :: https://raw.githubusercontent.com/openwisp/openwisp-controller/docs/docs/zerotier-tutorial/vpn-server-2.png
1324
+ :alt: ZeroTier VPN server configuration example 2
1325
+
1326
+ .. image :: https://raw.githubusercontent.com/openwisp/openwisp-controller/docs/docs/zerotier-tutorial/vpn-server-3.png
1327
+ :alt: ZeroTier VPN server configuration example 3
1328
+
1329
+ .. image :: https://raw.githubusercontent.com/openwisp/openwisp-controller/docs/docs/zerotier-tutorial/vpn-server-4.png
1330
+ :alt: ZeroTier VPN server configuration example 4
1331
+
1332
+ 6. After clicking on **Save and continue editing **, OpenWISP automatically detects
1333
+ the node address of the Zerotier controller and creates a Zerotier network.
1334
+ The **network_id ** of this network can be viewed in the **System Defined Variables **
1335
+ section, where it also provides internal IP address information.
1336
+
1337
+ .. image :: https://raw.githubusercontent.com/openwisp/openwisp-controller/docs/docs/zerotier-tutorial/vpn-server-5.png
1338
+ :alt: ZeroTier VPN server configuration example 5
1339
+
1340
+ 3. Create VPN client template for ZeroTier VPN Server
1341
+ #####################################################
1342
+
1343
+ 1. Visit ``/admin/config/template/add/ `` to add a new template.
1344
+ 2. Set ``ZeroTier Client `` as **Name ** (you can set whatever you want) and
1345
+ select ``VPN-client `` as **type ** from the dropdown list.
1346
+ 3. The **Backend ** field refers to the backend of the device this template can
1347
+ be applied to. For this example, we will leave it to ``OpenWRT ``.
1348
+ 4. Select the correct VPN server from the dropdown for the **VPN ** field. Here
1349
+ it is ``ZeroTier ``.
1350
+ 5. Make sure to check the **Automatic tunnel provisioning ** option.
1351
+ This will enable OpenWISP to automatically provision an IP address
1352
+ for each ZeroTier VPN client.
1353
+ 6. After clicking on **Save and continue editing ** button, you will see details
1354
+ of *ZeroTier * VPN server in **System Defined Variables **. The template
1355
+ configuration will be automatically generated which you can tweak
1356
+ accordingly. We will use the automatically generated VPN client configuration
1357
+ for this example.
1358
+
1359
+ .. image :: https://raw.githubusercontent.com/openwisp/openwisp-controller/docs/docs/zerotier-tutorial/template.png
1360
+ :alt: ZeroTier VPN client template example
1361
+
1362
+ 4. Apply ZeroTier VPN template to devices
1363
+ #########################################
1364
+
1365
+ **Note **: This step assumes that you already have a device registered on
1366
+ OpenWISP. Register or create a device before proceeding.
1367
+
1368
+ 1. Open the **Configuration ** tab of the concerned device.
1369
+ 2. Select the *ZeroTier Client * template.
1370
+ 3. Upon clicking on **Save and continue editing ** button, you will see some
1371
+ entries in **System Defined Variables **. It will contain internal IP address
1372
+ for the ZeroTier client on the device along with details of VPN server.
1373
+
1374
+ .. image :: https://raw.githubusercontent.com/openwisp/openwisp-controller/docs/docs/zerotier-tutorial/device-configuration.png
1375
+ :alt: ZeroTier VPN device configuration example
1376
+
1377
+ **Voila! ** You have successfully configured OpenWISP
1378
+ to manage ZeroTier tunnels for your devices.
1379
+
1283
1380
How to configure automatic provisioning of subnets and IPs
1284
1381
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1285
1382
@@ -2709,6 +2806,7 @@ Available configuration backends. For more information, see `netjsonconfig backe
2709
2806
| | ('openwisp_controller.vpn_backends.OpenVpn', 'OpenVPN'), |
2710
2807
| | ('openwisp_controller.vpn_backends.Wireguard', 'WireGuard'), |
2711
2808
| | ('openwisp_controller.vpn_backends.VxlanWireguard', 'VXLAN over WireGuard'), |
2809
+ | | ('openwisp_controller.vpn_backends.ZeroTier', 'ZeroTier'), |
2712
2810
| | ) |
2713
2811
+--------------+----------------------------------------------------------------------------------+
2714
2812
@@ -3230,6 +3328,39 @@ Allows to show a pie chart like the one in the screenshot.
3230
3328
Active groups are groups which have at least one device in them,
3231
3329
while emtpy groups do not have any device assigned.
3232
3330
3331
+ ``OPENWISP_CONTROLLER_API_TASK_RETRY_OPTIONS ``
3332
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3333
+
3334
+ +--------------+-----------+
3335
+ | **type **: | ``dict `` |
3336
+ +--------------+-----------+
3337
+ | **default **: | see below |
3338
+ +--------------+-----------+
3339
+
3340
+ .. code-block :: python
3341
+
3342
+ # default value of OPENWISP_CONTROLLER_API_TASK_RETRY_OPTIONS:
3343
+
3344
+ dict (
3345
+ max_retries = 5 , # total number of retries
3346
+ retry_backoff = True , # exponential backoff
3347
+ retry_backoff_max = 600 , # 10 minutes
3348
+ retry_jitter = True , # randomness into exponential backoff
3349
+ )
3350
+
3351
+
3352
+ This setting is utilized by background API tasks executed
3353
+ by `ZeroTier VPN servers and ZeroTier VPN clients <#how-to-setup-zerotier-tunnels >`_ to handle recoverable
3354
+ HTTP status codes such as 429, 500, 502, 503, and 504. These tasks are retried with a maximum
3355
+ of 5 attempts with an exponential backoff and jitter, with a maximum delay of 10 minutes.
3356
+
3357
+ This feature ensures that ZeroTier Service API calls
3358
+ are resilient to recoverable failures, improving the reliability of the system.
3359
+
3360
+ For more information on these settings, you can refer to the `the celery documentation regarding automatic retries
3361
+ for known errors. <https://docs.celeryq.dev/en/stable/userguide/tasks.html#automatic-retry-for-known-exceptions> `_
3362
+
3363
+
3233
3364
Signals
3234
3365
-------
3235
3366
0 commit comments