Contents

Persist Zerotier address on TrueNAS Scale

Contents

This guide is designed for configuring Zerotier on TrueNAS Core using Kubernetes.

  1. In TrueNAS, navigate to System Settings and then select the Shell option.

./shell.png

  1. In the opened shell window, execute the following command:

    1
    
    k3s kubectl get namespaces
    

    The output should resemble the following:

    1
    2
    3
    4
    5
    6
    7
    8
    
    NAME              STATUS   AGE
    default           Active   2d11h
    kube-system       Active   2d11h
    kube-public       Active   2d11h
    kube-node-lease   Active   2d11h
    openebs           Active   2d11h
    ix-zerotier       Active   2d11h
    ix-syncthing      Active   2d11h
    

    Note the name of the Zerotier namespace; for example, it might be called ix-zerotier.

  2. Run the following command using the namespace obtained:

    1
    
    k3s kubectl get -n ix-zerotier pods
    

    The output should be similar to:

    1
    2
    
    NAME                        READY   STATUS    RESTARTS   AGE
    zerotier-6d55584569-8psgm   1/1     Running   0          16m
    
  3. With the namespace and pod name information, open a shell inside the pod using:

    1
    
    k3s kubectl exec -n ix-zerotier --stdin --tty zerotier-6d55584569-8psgm -- /bin/bash
    

    Now inside the Zerotier Pod, you can utilize the Zerotier CLI tools.

  4. Generate Zerotier identity files using the following command:

    1
    
    zerotier-idtool generate identity.secret identity.public
    

    This creates two files, identity.secret and identity.public.

  5. Retrieve the values from these files by running:

    1
    
    cat identity.secret
    

    The output should appear as follows:

    1
    
    481934b8ea:0:a00714fa214f59196aaa4836c8f3c5984f1b15ff186hc934ff0d5b8154f6910f2f5703560ce3364b9c898e9fe0808e4fbfb56025061085ee08551d091f65bdc2:24cebc7ecb1ea777ea055b29271e2bd82e6023849660cd7fb5d6b1c27f0a186e7c3592a38ab69d3e367ac4fee5e27d96e28f697177d13e46f1c3a6f34b14c00e
    

    Remove the root@truenas:/# from the end before pasting.

  6. Repeat the same process for the other file:

    1
    
    cat identity.public
    

    The output should be similar to:

    1
    
    481934b8ea:0:ac0714fa214f59196aaa4836c8f5c5984f1b15ff1869c934ff0d5b8158f691032f5703560ce3364b9c898e9fe0808e4fbfb56025061085ee03554d091f65bdc2
    

    Remove the root@truenas:/# from the end before pasting.

  7. Save these values in a text editor to prevent loss upon closing the shell.

  8. From the TrueNAS web UI, go to Apps, choose Zerotier, and click Edit.

./01.png

  1. Paste the values into the identity secret and identity public inputs, then click Update.

./config.png

Now, a new address will be generated, and it will persist even after rebooting the Zerotier application or TrueNAS.