27 zerotier-one 命令详解

27 zerotier-one 命令详解

1-1. 查看是否已安装服务zerotier-one

1
rpm -qa | grep zerotier-one

2-1. 安装 zerotier-one

https://install.zerotier.com/
1
curl -s https://install.zerotier.com/ | sudo bash

3-1. 查看服务状态zerotier-one

1
systemctl status zerotier-one.service

3-2. 启动服务zerotier-one

1
systemctl start zerotier-one.service

3-3. 关闭服务zerotier-one

1
systemctl stop zerotier-one.service

3-4. 重启服务zerotier-one

1
systemctl restart zerotier-one.service

3-5. 设置开机启动项服务zerotier-one

1
systemctl enable zerotier-one.service

3-6. 取消开机启动项服务zerotier-one

1
systemctl disable zerotier-one.service

4-1. 列出各种服务开机是否启动

1
systemctl list-unit-files

4-2. 列出zerotier-one服务是否开机启动

1
systemctl list-unit-files | grep zerotier-one.service

4-3. 列出zerotier-one服务是否开机启动

1
systemctl is-enabled zerotier-one.service

5-1. 查看zerotier-one守护进程是否正常工作

1
netstat -tulpn | grep zerotier-one

6-1. 上面那一步可以看到是占用端口9993,查看端口是否在运行.

1
lsof -i:9993

6-2. 另一种方式查询端口9993是否在运行

1
netstat -tnl | grep 9993

7-1. 放行9993端口,如果是阿里云要打开网页端口

1
2
3
firewall-cmd --zone=public --permanent --add-port=9993/tcp
firewall-cmd --zone=public --permanent --add-port=9993/udp
firewall-cmd --reload

8-1. 查看 zerotier-cli 帮助

1
zerotier-cli -h

8-2. 查看 zerotier-cli 版本

1
zerotier-cli -v

8-3. 查看 zerotier-cli 信息

1
zerotier-cli info

8-4. 列出 zerotier-cli 所有 peers

1
zerotier-cli listpeers

8-5. 列出 zerotier-cli 所有 networks

1
zerotier-cli listnetworks

8-6. 列出 zerotier-cli 所有 moons

1
zerotier-cli listmoons

8-7. 加入 网络 c7c8172af117fa16

1
zerotier-cli join c7c8172af117fa16

8-8. 离开 网络 c7c8172af117fa16

1
zerotier-cli leave c7c8172af117fa16

8-9. 加入 moon 2c45e637cf —-这步要root用户才能运行

1
zerotier-cli orbit 2c45e637cf 2c45e637cf

8-10. 离开 moon 2c45e637cf —-这步要root用户才能运行

1
zerotier-cli deorbit 2c45e637cf 2c45e637cf

8-11. 关闭 zerotier-one – 不是CentOS 7.0 也能用

1
killall zerotier-one

8-12. 重新打开 zerotier-one – 不是CentOS 7.0 也能用

1
zerotier-one -d

Leave a Reply

Your email address will not be published. Required fields are marked *