本文最后更新于 2026年5月11日。
在Linux上安装ZeroTier One的步骤如下:
- 下载ZeroTier One的安装脚本。
curl -s https://install.zerotier.com | sudo bash
- 如果你的Linux发行版使用的是systemd,那么ZeroTier One服务会自动启动。如果不是,你可以手动启动服务:
sudo systemctl start zerotier-one
- 使ZeroTier One服务开机自启:
sudo systemctl enable zerotier-one
-
你需要登录到ZeroTier Central(https://my.zerotier.com/)来创建一个网络,并获取网络ID。
-
在Linux上应用这个网络ID:
sudo zerotier-cli join <你的网络ID>
sudo zerotier-cli join e56273510dd117e9
替换<你的网络ID>为你从ZeroTier Central上获得的网络ID。
- 完成这些步骤后,你的ZeroTier One服务应该已经连接到了ZeroTier网络中。你可以通过运行以下命令来检查状态:
sudo zerotier-cli status
确保你的ZeroTier One服务保持运行,以便保持连接。
获取帮助
zerotier-one -h
由于我运行了zerotier的服务端docker占用了9993端口,所以不能成功启动。
[root@iZ8vbajg9wo8iwynfb1lgeZ ~]# zerotier-one
zerotier-one: fatal error: cannot bind to local control interface port 9993
我把已经运行的docker服务关闭后就能成功启动了
[root@iZ8vbajg9wo8iwynfb1lgeZ ~]# sudo systemctl status zerotier-one
● zerotier-one.service - ZeroTier One
Loaded: loaded (/usr/lib/systemd/system/zerotier-one.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2024-04-23 16:14:57 CST; 10s ago
Main PID: 3533914 (zerotier-one)
Tasks: 23 (limit: 11496)
Memory: 4.0M
CGroup: /system.slice/zerotier-one.service
└─3533914 /usr/sbin/zerotier-one
安装指令
curl -s https://install.zerotier.com | sudo bash
安装日志:
Last login: Mon Feb 26 11:02:29 2024 from localhost
[root@iZ8vbajg9wo8iwynfb1lgeZ ~]# curl -s https://install.zerotier.com | sudo bash
*** ZeroTier Service Quick Install for Unix-like Systems
*** Tested OSes / distributions:
*** MacOS (10.13+) (just installs ZeroTier One.pkg)
*** Debian Linux (7+)
*** RedHat/CentOS Linux (6+)
*** Fedora Linux (16+)
*** SuSE Linux (12+)
*** Mint Linux (18+)
*** Supported architectures vary by OS / distribution. We try to support
*** every system architecture supported by the target.
*** Please report problems to contact@zerotier.com and we will try to fix.
*** Detecting Linux Distribution
*** Found RHEL/CentOS/Rocky, creating /etc/yum.repos.d/zerotier.repo
*** Installing ZeroTier service package...
/usr/lib/python3.6/site-packages/OpenSSL/crypto.py:12: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
from cryptography import x509
Failed loading plugin "spacewalk": module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/epel.repo; Configuration: OptionBinding with id "failovermethod" does not exist
Repository epel is listed more than once in the configuration
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/epel.repo; Configuration: OptionBinding with id "failovermethod" does not exist
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/epel.repo; Configuration: OptionBinding with id "failovermethod" does not exist
ZeroTier, Inc. RPM Release Repository 7.2 kB/s | 11 kB 00:01
Last metadata expiration check: 0:00:01 ago on Mon 22 Apr 2024 06:17:33 PM CST.
Dependencies resolved.
===================================================================================================================================================================================================================================================
Package Architecture Version Repository Size
===================================================================================================================================================================================================================================================
Installing:
zerotier-one x86_64 1.12.2-1.el8 zerotier 4.3 M
Transaction Summary
===================================================================================================================================================================================================================================================
Install 1 Package
Total download size: 4.3 M
Installed size: 15 M
Downloading Packages:
zerotier-one-1.12.2-1.el8.x86_64.rpm 27 kB/s | 4.3 MB 02:46
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 27 kB/s | 4.3 MB 02:46
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: zerotier-one-1.12.2-1.el8.x86_64 1/1
Installing : zerotier-one-1.12.2-1.el8.x86_64 1/1
Running scriptlet: zerotier-one-1.12.2-1.el8.x86_64 1/1
Verifying : zerotier-one-1.12.2-1.el8.x86_64 1/1
Installed:
zerotier-one-1.12.2-1.el8.x86_64
Complete!
*** Enabling and starting ZeroTier service...
Created symlink /etc/systemd/system/multi-user.target.wants/zerotier-one.service → /usr/lib/systemd/system/zerotier-one.service.
*** Waiting for identity generation...
*** Success! You are ZeroTier address [ a999a82b89 ].
[root@iZ8vbajg9wo8iwynfb1lgeZ ~]#