Reference sources: Command Line Interface: zerotier-cli , ZeroTier Knowledge Base How to clear/reset your ZeroTier address
Official website: zerotier official website
Here ZeroTier's registration, management background, and network creation will not be repeated here;
############ in the following code needs to be replaced with the Network ID created on the management page
Tip: On Unix systems, you may need to prefix the zerotier-cli command with sudo, while on Windows, you will need to use an administrator mode command prompt.
1. ZeroTier's Linux installation script
There are two installation methods for installing zerotier in ubuntu using SSH . The progress of the installation process will be displayed:
● If you are willing to rely on SSL to authenticate your site, a one-line installation can be done with:
curl -s https://install.zerotier.com | sudo bash
● If you have GPG installed, a more secure option is available:
curl -s 'https://raw.githubusercontent.com/zerotier/ZeroTierOne/master/doc/contact%40zerotier.com.gpg' | gpg --import && \
if z=$(curl -s 'https://install.zerotier.com/' | gpg); then echo "$z" | sudo bash; fi
ZeroTier's Linux update script
If you use ZeroTier's linux install script from the download page , it will add the repo to your system. Update zerotier-one using apt or yum.
For example, on debian/ubuntu based systems:
View updatable software:
sudo apt update
Update ZeroTier
sudo apt install zerotier-one
● Bonus tip: You can specify a version, say update to version 1.10.6 to update today:
sudo apt install zerotier-one=1.10.6
Tip: Keeping the version of each service client as consistent as possible can solve some metaphysical problems! !
2. Join a network
First, enter the following command on the Linux device to be connected to join the network. If the connection is successful, a status code prompt of 200 join OK will appear:
# 加入网络命令,操作成功则返回 “200 join OK”
sudo zerotier-cli join ###########
view current connections
# 查看当前连接的网络,如果列表中出现 Network ID、Name 说明连接成功,后台分配好IP后再查看IP地址也会出现。
sudo zerotier-cli listnetworks
3. Common operations
● The zerotier service is started manually:
# 返回信息 “200 info ########### 1.10.6 ONLINE”
zerotier-cli status
● The zerotier service is started manually:
sudo systemctl start zerotier-one.service
● zerotier service Self-starting at boot:
# 开机自启动,成功怎返回值的最后会有“enable zerotier-one”字样
sudo systemctl enable zerotier-one.service
● zerotier service View the network connected to this machine: mentioned above --- view the current connection
# 查看当前连接的网络,如果列表中出现 Network ID、Name 说明连接成功,后台分配好IP后再查看IP地址也会出现。
sudo zerotier-cli listnetworks
● The zerotier service joins the network:
# 加入网络命令,操作成功则返回 “200 join OK”
zerotier-cli join ###########
● zerotier service To disconnect the currently joined network:
# 断开网络命令,操作成功则返回 “200 leave OK”
sudo zerotier-cli leave ###########
● zerotier service stopped
sudo systemctl stop zerotier-one
or
sudo service zerotier-one stop
● zerotier service restart service
sudo systemctl start zerotier-one
or
sudo service zerotier-one start
● Follow up. . .