Skip to content

Instantly share code, notes, and snippets.

@openoms
Forked from solarmicrobe/add_zerotier.sh
Last active May 14, 2022 20:56
Show Gist options
  • Save openoms/0281e59b6b642731889fe207c8639b58 to your computer and use it in GitHub Desktop.
Save openoms/0281e59b6b642731889fe207c8639b58 to your computer and use it in GitHub Desktop.
Add zerotier to TrueNAS
#! /usr/bin/env sh
pkg install wget -y
echo "# Check the latest version at: https://www.freshports.org/net/zerotier/"
echo "# Which version to install?"
echo "# Example:"
echo "1.6.5"
read VERSION
echo "# Input the space seperated list of networks to join:"
echo "# Example is the public network Earth:"
echo "8056c2e21c000001"
read NETWORKS # Space seperated list of networks to join, default here is the public network Earth
wget http://pkg.freebsd.org/freebsd:11:x86:64/latest/All/zerotier-${VERSION}.txz -O /tmp/zerotier-${VERSION}.txz
pkg add -f /tmp/zerotier-${VERSION}.txz
#autostart
echo 'zerotier_enable="YES"' > /etc/rc.conf
service zerotier start
for n in $NETWORKS; do
zerotier-cli join ${n}
done
zerotier-cli status
# if shows PORT_ERROR PRIVATE - acivate 'allow_tun' in the 'Custom Properties' of the jail
zerotier-cli listnetworks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment