GithubHelp home page GithubHelp logo

xubiaolin / docker-zerotier-planet Goto Github PK

View Code? Open in Web Editor NEW
1.6K 14.0 343.0 3.15 MB

一分钟私有部署zerotier-planet服务

Dockerfile 11.39% Shell 76.76% JavaScript 11.85%
zerotier-network dockerfile self-hosted zerotier self-host-zerotier planet

docker-zerotier-planet's Introduction

TG交流群:https://t.me/+JduuWfhSEPdlNDk1

QQ交流群1群(已满):692635772 QQ交流群2群:785620313

0: 广告

不想自己搭建?

可以加群联系群主按月购买现成服务,或者添加tg: https://t.me/uxkram

年付99¥,最大300Mbit带宽,单月流量限制200G,流量超出后10¥可购买100G

线路为宁波电信

测速图如下:

图片名称

1:ZeroTier 介绍

ZeroTier 这一类 P2P VPN 是在互联网的基础上将自己的所有设备组成一个私有的网络,可以理解为互联网连接的局域网。最常见的场景就是在公司可以用手机直接访问家里的 NAS,而且是点对点直连,数据传输并不经由第三方服务器中转。

Zerotier 在多设备之间建立了一个 Peer to Peer VPN(P2PVPN) 连接,如:在笔记本电脑、台式机、嵌入式设备、云资源和应用。这些设备只需要通过 ZeroTier One ( ZeroTier 的客户端) 在不同设备之间建立直接连接,即使它们位于 NAT 之后。连接到虚拟 LAN 的任何计算机和设备通常通过 NAT 或路由器设备与 Internet 连接,ZeroTier One 使用 STUN 和隧道来建立 NAT 后设备之间的 VPN 直连。

简单一点说,Zerotier 就是通过 P2P 等方式实现形如交换机或路由器上 LAN 设备的内网互联。

zerotier

专有名词

PLANET :行星服务器,Zerotier 根服务器

MOON :卫星服务器,用户自建的私有根服务器,起到代理加速的作用

LEAF :网络客户端,就是每台连接到网络节点。

我们本次搭建的就是 PLANET 行星服务器

2:为什么要自建PLANET 服务器

简单来讲就是官方的服务器在海外,我们连接的时候会存在不稳定的情况

3:开始安装

3.1:准备条件

  • 具有公网 ip 的服务器(需要开放 3443/tcp 端口,9994/tcp 端口,9994/udp 端口)[这里的9994需要你根据实际情况替换]
  • 安装 dockergit
  • Debian10+,Ubuntu20+ 等内核大于5.0的系统均支持
  • CentOS不支持,内核太低了,可能需要手动升级内核

3.1.1 安装git

#debian/ubuntu等
apt update && apt install git -y 

#centos等
yum update && yum install git -y 

3.1.2 安装docker

curl -fsSL https://get.docker.com |bash 

3.1.3 启动docker

service docker start

3.2:下载项目源码

官方地址

git clone https://github.com/xubiaolin/docker-zerotier-planet.git

加速地址

git clone https://ghproxy.imoyuapp.win/https://github.com/xubiaolin/docker-zerotier-planet.git

3.3:执行安装脚本

进入项目目录

cd docker-zerotier-planet

运行 deploy.sh 脚本

./deploy.sh

根据提示来选择即可,操作完成后会自动部署

欢迎使用zerotier-planet脚本,请选择需要执行的操作:
1. 安装
2. 卸载
3. 更新
4. 查看信息
5. 退出
请输入数字:

整个脚本预计需要 1-3 分钟,具体需要看网络与机型

当您看到类似如下字样时,表示安装成功 install-finish

3.4 下载 planet 文件

脚本运行完成后,会在 ./data/zerotier/dist 目录下有个 planetmoon 文件

可以直接访问安装完成后的url下载,也可以用scp等其他方式下载

下载文件备用

3.5 新建网络

访问 http://ip:3443 进入controller页面

ui

使用默认账号为:admin

默认密码为:password

3.5.1 创建网络

进入后创建一个网络,可以得到一个网络ID

创建网络,输入名称

ui

得到网络 id

ui

3.5.2 分配网络IP:

选中easy setup assign_id

生成ip范围 ip_addr

4.客户端配置

客户端主要为Windows, Mac, Linux, Android

4.1 Windows 配置

首先去zerotier官网下载一个zerotier客户端

planet 文件覆盖粘贴到C:\ProgramData\ZeroTier\One中(这个目录是个隐藏目录,需要运允许查看隐藏目录才行)

Win+S 搜索 服务

ui

找到ZeroTier One,并且重启服务

ui

4.2 加入网络

使用管理员身份打开PowerShell

执行如下命令,看到join ok字样就成功了

PS C:\Windows\system32> zerotier-cli.bat join 网络id(就是在网页里面创建的那个网络)
200 join OK
PS C:\Windows\system32>

登录管理后台可以看到有个个新的客户端,勾选Authorized就行

ui

IP assignment 里面会出现zerotier的内网ip

ip

执行如下命令:

PS C:\Windows\system32> zerotier-cli.bat peers
200 peers
<ztaddr>   <ver>  <role> <lat> <link> <lastTX> <lastRX> <path>
fcbaeb9b6c 1.8.7  PLANET    52 DIRECT 16       8994     1.1.1.1/9993
fe92971aad 1.8.7  LEAF      14 DIRECT -1       4150     2.2.2.2/9993
PS C:\Windows\system32>

可以看到有一个 PLANTET 和 LEAF 角色,连接方式均为 DIRECT(直连)

到这里就加入网络成功了

4.2 Linux 客户端(openwrt可以参考这个)

步骤如下:

  1. 安装linux客户端软件
  2. 进入目录 /var/lib/zerotier-one
  3. 替换目录下的 planet 文件
  4. 重启 zerotier-one 服务(service zerotier-one restart)
  5. 加入网络 zerotier-cli join 网络 id
  6. 管理后台同意加入请求
  7. zerotier-cli peers 可以看到 planet 角色

4.3 安卓客户端配置

Zerotier 非官方安卓客户端

4.4 MacOS 客户端配置

步骤如下:

  1. 进入 /Library/Application\ Support/ZeroTier/One/ 目录,并替换目录下的 planet 文件
  2. 重启 ZeroTier-One:cat /Library/Application\ Support/ZeroTier/One/zerotier-one.pid | sudo xargs kill
  3. 加入网络 zerotier-cli join 网络 id
  4. 管理后台同意加入请求
  5. zerotier-cli peers 可以看到 planet 角色

参考链接

zerotier-虚拟局域网详解

五分钟自建 ZeroTier 的 Planet/Controller

5. 管理面板SSL配置

管理面板的SSL支持需要自行配置,参考Nginx配置如下:

upstream zerotier {
  server 127.0.0.1:3443;
}

server {

  listen 443 ssl;

  server_name {CUSTOME_DOMAIN}; #替换自己的域名

  # ssl证书地址
  ssl_certificate    pem和或者crt文件的路径;
  ssl_certificate_key key文件的路径;

  # ssl验证相关配置
  ssl_session_timeout  5m;    #缓存有效期
  ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;    #加密算法
  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;    #安全链接可选的加密协议
  ssl_prefer_server_ciphers on;   #使用服务器端的首选算法


  location / {
    proxy_pass http://zerotier;
    proxy_set_header HOST $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

server {
    listen       80;
    server_name  {CUSTOME_DOMAIN}; //替换自己的域名
    return 301 https://$server_name$request_uri;
}

6. 卸载

docker rm -f zerotier-planet

7: Q&A:

1. 为什么我ping不通目标机器?

请检查防火墙设置,Windows 系统需要允许 ICMP 入站,Linux 同理

2. IOS客户端怎么用?

iOS 客户端插件在这里,设备需要越狱: https://github.com/lemon4ex/ZeroTieriOSFix

3. 为什么看不到官方的Planet

该项目剔除了官方服务器,只保留了自定义的Planet节点

4. 我更换了IP需要怎么处理?

如果IP更换了,则需要重新部署,相当于全新部署

5. PVE lxc 容器没有创建网卡

需要修改lxc容器的配置,同时lxc容器需要取消勾选无特权

配置文件位置在/etc/pve/lxc/{ID}.conf

在Proxmox7.0之前的版本添加以下内容:

lxc.cgroup.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file

在Proxmox7.0之后的版本添加以下内容:

lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file

6. 管理后台忘记密码怎么办:

执行./deploy.sh,选择重置密码即可

7. 为什么连不上planet

请检查防火墙,如果是阿里云、腾讯云用户,需要在对应平台后台防火墙放行端口。linux机器上也要放行,如果安装了ufw等防火墙工具。

8. 如何判断是直连还是中转

管理员权限执行终端,运行zerotier-cli peers

<ztaddr>   <ver>  <role> <lat> <link>   <lastTX> <lastRX> <path>
69c0d507d0 -      LEAF      -1 RELAY
93caa675b0 1.12.2 PLANET  -894 DIRECT   4142     4068     110.42.99.46/9994
ab403e2074 1.10.2 LEAF      -1 RELAY

如果你的ztaddr是REPLAY, 就说明是中转

9. 为什么我的zerotier传输不稳定

由于zerotier使用的是udp协议,部分地区可能对udp进行了qos, 可以考虑使用openvpn。

10.支持域名吗?

暂不支持

11. ARM服务器可以搭建吗

暂不支持, 但是ARM可以作为客户端使用

12. 支持docker-compose启动部署吗

参考docker-compose文件如下

version: '3'

services:
  myztplanet:
    image: xubiaolin/zerotier-planet:latest
    container_name: ztplanet
    ports:
      - 9994:9994
      - 9994:9994/udp
      - 3443:3443
      - 3000:3000
    environment:
      - IP_ADDR4=[IPV4IP ADDRESS]
      - IP_ADDR6=
      - ZT_PORT=9994
      - API_PORT=3443
      - FILE_SERVER_PORT=3000
    volumes:
      - ./data/zerotier/dist:/app/dist
      - ./data/zerotier/ztncui:/app/ztncui
      - ./data/zerotier/one:/var/lib/zerotier-one
      - ./data/zerotier/config:/app/config
    restart: unless-stopped

开发计划

🥰您的捐助可以让开发计划的速度更快🥰

  • 多planet支持
  • 3443端口自定义支持
  • planet和controller分离部署

风险声明

本项目仅供学习和研究使用,不鼓励用于商业用途。我们不对任何因使用本项目而导致的任何损失负责。

类似项目

捐助和支持

如果觉得本项目对您有帮助,欢迎通过扫描下方赞赏码捐助项目 :)

donate

鸣谢

感谢以下网友投喂,你们的支持和鼓励是我不懈更新的动力

  • Kimi Chen
  • 岸芷汀兰
  • **忠
  • 夏末秋至
  • 匿名
  • 啊乐
  • 天天星期天
  • 情若犹在
  • 小猪猪的饲养员
  • Calvin
  • 你好
  • 随性

docker-zerotier-planet's People

Contributors

hisune avatar jasper-1024 avatar oneisall8955 avatar pescn avatar rwv avatar wekingchen avatar xubiaolin avatar ziy1-tan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-zerotier-planet's Issues

启动失败

您好,我在启动
docker run -d --name zerotier-planet -p 3443:3443 -p 9993:9993 -p 9993:9993/udp -v /var/lib/zerotier-one:/var/lib/zerotier-one --restart unless-stopped zerotier-planet
这个命令时,会报错
docker: Error response from daemon: driver failed programming external connectivity on endpoint zerotier-planet (b0a28ce245f6bbcbb3c2c3a36e99e12235e8883f043db9d6e000ded4c4c06f69): Error starting userland proxy: listen tcp4 0.0.0.0:9993: bind: address already in use.
使用 netstat -tanlp 查看了端口,显示是zerotier-one在占用9993端口
不知道是不是因为moon节点和planet节点同时布置在云服务器上

编译报错,麻烦康康

下载源码中,源码文件较大,请耐心等待;如果源码下载失败,请重新执行该脚本
Cloning into 'ztncui'...
warning: redirecting to https://github.markxu.workers.dev/https:/github.com/key-networks/ztncui.git/
Cloning into 'ZeroTierOne'...
warning: redirecting to https://github.markxu.workers.dev/https:/github.com/zerotier/ZeroTierOne.git/
npm ERR! code 1
npm ERR! path /opt/ztncui/src/node_modules/argon2
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! make: Entering directory '/opt/ztncui/src/node_modules/argon2/build'
npm ERR! make: Leaving directory '/opt/ztncui/src/node_modules/argon2/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 3.9.7 found at "/usr/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v16.14.0/node-v16.14.0-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.14.0/node-v16.14.0-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v16.14.0/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.14.0/SHASUMS256.txt
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/opt/ztncui/src/node_modules/argon2/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/root/.cache/node-gyp/16.14.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/16.14.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/16.14.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/opt/ztncui/src/node_modules/argon2',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! make: printf: Operation not permitted
npm ERR! make: *** [libargon2.target.mk:123: Release/obj.target/libargon2/argon2/src/opt.o] Error 127
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: make failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:520:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Linux 4.18.0-240.1.1.el8_3.x86_64
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /opt/ztncui/src/node_modules/argon2
npm ERR! gyp ERR! node -v v16.14.0
npm ERR! gyp ERR! node-gyp -v v8.3.0
npm ERR! gyp ERR! not ok

安装过程报错

您好,
非常感谢提供便捷的脚本安装,但是安装过程中报错,能看一下是怎么回事吗?看了一下之前的issue,感觉也是那个链接的问题?
image
我的安装环境是腾讯云,ubuntu18.04

提示没有zerotier-planet:latest镜像

启动服务
Unable to find image 'zerotier-planet:latest' locally
docker: Error response from daemon: pull access denied for zerotier-planet, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
Error: No such container:path: zerotier-planet:/app/bin/planet

对于eth0的ip为内网地址的服务器,子节点无法连接root服务器

国内云服务器eth0的inet地址为内网,例如:10.0.0.14,此时按照教程安装完成后子节点可以加入network,gui页面也显示在线,但子节点的无法接收到数据(只有发送)

主节点的9993端口监听以下地址:
localhost:9993
172.17.0.1:9993
10.0.0.14:9993
叶节点接收不到数据。

关于原zerotier所加入的网络问题

我看到这个代码中生成了一个新的planet文件,当使用这个文件覆盖客户端配置以后,客户端无法连接原有官方的zerotier节点了。

请问这个是一个bug还是说机制上只允许建立私有网络,而不允许连接官网公共网络?

升级能否保留原先的配置

目前发现每次运行./deploy.sh之后,都会删除原先的planet和zerotier配置文件,导致路由和客户端都要重新配置,如果在运行脚本的时候可以选择是否删除原来配置就好了。

请问,zerotier-planet或者moon布置能否在域名上进行

腾讯或者阿里云的服务器,第二年起就变的很贵;家里宽带有公网ip地址,但是ip地址不固定,几天会变一次,已经使用域名绑定,家里有nas服务器,常年开机的,现在想请问下能否在家里服务器中部署[zerotier-planet],方便各种设备组成局域网

部署成功后,PLANET为RELAY

zerotier-cli peers
200 peers

0344a38d42 1.8.6 MOON 99 DIRECT 8286 3180 xx.xxx.xx.xxx/9993
579dcf7144 1.8.4 LEAF -1 RELAY
7457f95400 1.8.4 MOON 17 DIRECT 3238 3238 xx.xx.xx.xxx/9993
7a49962c80 1.10.0 PLANET -1 RELAY
cafe9efeb9 - LEAF -1 DIRECT -1 2928 xxx.xxx.x.xxx/9993

您好,脚本能否加入备份功能

我需要组网的设备太多,而且都是固定ip,如果以后迁移或是重装,那可太痛苦了。
或者能否告知备份哪个配置文件?

缺少变量

如果修改9993端口,缺少echo 'ZT_ADDR=127.0.0.1:15559' >>.env

无法加入网络

  • 服务器已开启所有端口

  • 服务器 docker 已运行

>docker ps
CONTAINER ID   IMAGE             COMMAND                  CREATED          STATUS          PORTS                                                                                                                             NAMES
9a5ddcaee3de   zerotier-planet   "/bin/sh -c '/bin/sh…"   38 minutes ago   Up 38 minutes   0.0.0.0:3443->3443/tcp, :::3443->3443/tcp, 0.0.0.0:9994->9994/tcp, :::9994->9994/tcp, 0.0.0.0:9994->9994/udp, :::9994->9994/udp   zerotier-planet
  • 成功生成 /tmp/planet 文件
  • 已把文件替换到 C:\ProgramData\ZeroTier\One 并重启服务
  • 尝试加入网络报错
>zerotier-cli.bat join 03c420ea3831c507
0 join connection failed
  • 运行 zerotier-cli.bat peers 显示如下
>zerotier-cli.bat peers
Error connecting to the ZeroTier service: timed out

Please check that the service is running and that TCP port 9993 can be contacted via 127.0.0.1.

猜想是不是 planet 不生效? 为什么显示 127.0.0.1:9993 ? 而不是服务器的 9993(其实服务器我设置的端口是 9994)?

部署完成之后PLANET 还是会有多个

root@hecs-205094:/app# zerotier-cli listpeers
200 listpeers
200 listpeers 62f865ae71 50.7.252.138/9993;14111;3895 213 - PLANET
200 listpeers 778cde7190 103.195.103.66/9993;4111;3872 238 - PLANET
200 listpeers cafe04eba9 84.17.53.155/9993;419;3955 156 - PLANET
200 listpeers cafe9efeb9 104.194.8.134/9993;14111;3941 170 - PLANET

image

Possible Changes For The Code

Hi xubiaoliln,

Thanks for your efforts to the project.

I just readed your source code. Maybe there are some new changes that can be added to the code. Some of the features that migth
be benefits to the code/user are shown below.

  1. Automatically get the current public IP , no longer need to change the patch.json when generating the image. Some of APIs can be used, such as:
    http://ip.3322.net/
    https://httpbin.org/ip
    https://pv.sohu.com/cityjson?ie=utf-8
    http://whois.pconline.com.cn/ipJson.jsp
    http://v4.ipv6-test.com/api/myip.php
    https://api-ipv4.ip.sb/ip
    http://myip.ipip.net/s

  2. mkworld.cpp file clone from the offical repos in real time in order to prevent file content changes from causing the generation to fail.

That's all, thank you.

卡在这里怎么办

使用其他ip请输入要使用的ip,例如1.1.1.1,支持使用域名
使用当前ip请输入:y


当前的ip为:, 是否继续? y/n
y
清除原有内容
rm: cannot remove '/opt/planet': No such file or directory
Error response from daemon: No such container: zerotier-planet
Error: No such container: zerotier-planet
Error: No such image: zerotier-planet
打包镜像
Sending build context to Docker daemon 1.006MB
Step 1/8 : FROM ubuntu:20.04
---> bdbe84df0b98
Step 2/8 : ENV TZ=Asia/Shanghai DEBIAN_FRONTEND=noninteractive
---> Using cache
---> 793be8609160
Step 3/8 : ADD . /app
---> Using cache
---> 7f0be969e5f9
Step 4/8 : RUN echo "deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse" > /etc/apt/sources.list && echo "deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse" >> /etc/apt/sources.list && echo "deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse" >> /etc/apt/sources.list && echo "deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse" >> /etc/apt/sources.list && echo "deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse" >>/etc/apt/sources.list && echo "deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse" >>/etc/apt/sources.list && echo "deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse" >>/etc/apt/sources.list && echo "deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse" >>/etc/apt/sources.list && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse" >>/etc/apt/sources.list && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' > /etc/timezone && apt update && apt install git python3 npm make curl wget -y && mkdir /usr/include/nlohmann/ && cd /usr/include/nlohmann/ && wget https://github.com/nlohmann/json/releases/download/v3.10.5/json.hpp && npm config set registry http://registry.npm.taobao.org && npm install -g node-gyp && apt-get clean && rm -rf /var/lib/apt/lists/*
---> Running in 2f31801440d5

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Get:1 http://mirrors.aliyun.com/ubuntu focal InRelease [265 kB]
Get:2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security InRelease [114 kB]
Ign:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/restricted arm64 Packages
Ign:4 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/universe arm64 Packages
Ign:5 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/multiverse arm64 Packages
Ign:6 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/main arm64 Packages
Ign:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/restricted arm64 Packages
Ign:4 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/universe arm64 Packages
Ign:5 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/multiverse arm64 Packages
Ign:6 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/main arm64 Packages
Ign:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/restricted arm64 Packages
Ign:4 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/universe arm64 Packages
Ign:5 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/multiverse arm64 Packages
Ign:6 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/main arm64 Packages
Ign:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/restricted arm64 Packages
Ign:4 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/universe arm64 Packages
Ign:5 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/multiverse arm64 Packages
Ign:6 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/main arm64 Packages
Ign:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/restricted arm64 Packages
Ign:4 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/universe arm64 Packages
Ign:5 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/multiverse arm64 Packages
Ign:6 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/main arm64 Packages
Err:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/restricted arm64 Packages
404 Not Found [IP: 101.6.15.130 80]
Ign:4 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/universe arm64 Packages
Ign:5 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/multiverse arm64 Packages
Ign:6 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/main arm64 Packages
Get:7 http://mirrors.aliyun.com/ubuntu focal-security InRelease [114 kB]
Get:8 http://mirrors.aliyun.com/ubuntu focal-updates InRelease [114 kB]
Get:9 http://mirrors.aliyun.com/ubuntu focal-backports InRelease [108 kB]
Get:10 http://mirrors.aliyun.com/ubuntu focal/restricted Sources [7198 B]
Get:11 http://mirrors.aliyun.com/ubuntu focal/main Sources [1079 kB]
Get:12 http://mirrors.aliyun.com/ubuntu focal/universe Sources [12.3 MB]

need diverse mirrors

when i try to deploy it in Tencent Cloud,it speeds too much time because of mirrors of Tsinghua University and taobao. please give diverse mirrors to speed up the process.

可以更改9993端口吗?

我这里服务搭建好以后,联通和移动的机器都能联上,电信的联不上。估计是9993端口被电信屏蔽了。有没有什么办法可以把9993端口改成其它的吗?

换源导致失败

init.sh换源是20.04的,dockerfile里面拉取的镜像是latest(22.04)导致安装npm等失败,建议修改为FROM ubuntu:20.04

客户端无法连接官方Planet时,好像也无法连接自建Planet

客户端无法连接官方Planet时,好像也无法连接自建Planet
同一个地区的两条电信宽带,一个能连接官方Planet,一个不能连接。两个都覆盖planet文件后,只有能正常连接官方Planet的那个网络里的设备可以成功加入自建控制中心。另一个一直都是Requesting Configuration。

/tmp目录下没有planet 文件

您好,我安装成功后,可以打开control 界面,但/tmp目录下没有planet 文件,这个有别的地方可以下载么?

半小时了,安装100K/S,国内BGP-nat

Get:168 http://mirrors.aliyun.com/ubuntu focal/main amd64 liburi-perl all 1.76-2 [77.5 kB]
Get:169 http://mirrors.aliyun.com/ubuntu focal/main amd64 libfile-desktopentry-perl all 0.22-1 [18.2 kB]
Get:170 http://mirrors.aliyun.com/ubuntu focal/main amd64 libfile-fcntllock-perl amd64 0.22-3build4 [33.1 kB]
Get:171 http://mirrors.aliyun.com/ubuntu focal/main amd64 libtimedate-perl all 2.3200-1 [34.0 kB]
Get:172 http://mirrors.aliyun.com/ubuntu focal/main amd64 libhttp-date-perl all 6.05-1 [9920 B]
Get:173 http://mirrors.aliyun.com/ubuntu focal/main amd64 libfile-listing-perl all 6.04-1 [9774 B]
Get:174 http://mirrors.aliyun.com/ubuntu focal/main amd64 libfile-mimeinfo-perl all 0.29-1 [41.5 kB]
Get:175 http://mirrors.aliyun.com/ubuntu focal/main amd64 libfont-afm-perl all 1.20-2 [13.2 kB]
Get:176 http://mirrors.aliyun.com/ubuntu focal-security/main amd64 libfreetype6 amd64 2.10.1-2ubuntu0.2 [341 kB]
Get:177 http://mirrors.aliyun.com/ubuntu focal/main amd64 libfontconfig1 amd64 2.13.1-2ubuntu3 [114 kB]
Get:178 http://mirrors.aliyun.com/ubuntu focal/main amd64 libfontenc1 amd64 1:1.1.4-0ubuntu1 [14.0 kB]
Get:179 http://mirrors.aliyun.com/ubuntu focal-security/main amd64 libglapi-mesa amd64 21.2.6-0ubuntu0.120.04.2 [27.4 kB]
Get:180 http://mirrors.aliyun.com/ubuntu focal-security/main amd64 libllvm12 amd64 1:12.0.0-3ubuntu1
20.04.5 [18.8 MB]

network failure

When I deploy the controller, I get an npm error. But the container starts normally, and the client can connect to the controller. But in practice I can't access other devices and can't ping。thx

在部署时候,出现一个npm错误。但是容器正常启动的,客户端也能连接上控制器。
但是在实际操作中我无法访问任何设备。ping 出现Destination Host Unreachable

planet服务器不生效,客户端查看不到该planet

下载服务器 /opt/zerotier-planet 下的planet文件并 将planet文件覆盖粘贴到C:\ProgramData\ZeroTier\One中后通过services.msc重启zerotier-one服务后powershell输入zerotier-cli listpeers并没有对应自己服务器ip地址的planet,还是只有官方的
PS C:\Users\35087> zerotier-cli listpeers
200 listpeers
200 listpeers 62f865ae71 50.7.252.138/9993;11154;1338 -216 - PLANET
200 listpeers 778cde7190 103.195.103.66/9993;1122;1496 -372 - PLANET
200 listpeers 98b8b6091e - -1 - LEAF
200 listpeers b0273d23e3 - -1 - LEAF
200 listpeers cafe04eba9 84.17.53.155/9993;1052;1052 -522 - PLANET
200 listpeers cafe7b4cdf - -1 - PLANET
200 listpeers f7a68b8ff2 45.32.95.235/62913;152;426 736 1.6.6 LEAF

编译出错

Cloning into 'ztncui'...
sh: missing ]
Cloning into 'ZeroTierOne'...
sh: missing ]
npm ERR! code 1
npm ERR! path /opt/ztncui/src/node_modules/argon2
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! make: Entering directory '/opt/ztncui/src/node_modules/argon2/build'
npm ERR! make: Leaving directory '/opt/ztncui/src/node_modules/argon2/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 3.9.7 found at "/usr/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v16.14.0/node-v16.14.0-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.14.0/node-v16.14.0-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v16.14.0/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.14.0/SHASUMS256.txt
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/opt/ztncui/src/node_modules/argon2/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/root/.cache/node-gyp/16.14.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/16.14.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/16.14.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/opt/ztncui/src/node_modules/argon2',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! make: printf: Operation not permitted
npm ERR! make: *** [libargon2.target.mk:123: Release/obj.target/libargon2/argon2/src/opt.o] Error 127
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: make failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:520:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Linux 4.19.0-16-amd64
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /opt/ztncui/src/node_modules/argon2
npm ERR! gyp ERR! node -v v16.14.0
npm ERR! gyp ERR! node-gyp -v v8.3.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-02-21T03_04_50_837Z-debug.log

没有planet文件

您好,我找不到/opt/zerotier-planet 这个路径,没有planet文件
image

已经搭建成功,客户端连不上

已经搭建成功了。在/opt目录下下载planet文件,在客户机上替换了,但是连不上。
我没用vps搭建,用的是ddns方式,在部署上,填写ip那个地方是用的域名代替。
tcp/9993,udp/9993都做了端口映射
PS C:\Users\down> zerotier-cli.bat join 826bb777c0f4c839
200 join OK
PS C:\Users\down> zerotier-cli.bat peers
200 peers

826bb777c0 - PLANET -1 RELAY
PS C:\Users\down>

Detail for network
authTokens:[
null
]
authorizationEndpoint:
capabilities:[]
clientId:
creationTime:1665151574943
dns:[]
enableBroadcast:true
id:826bb777c0f4c839
ipAssignmentPools:[
{
"ipRangeEnd": "10.0.0.254",
"ipRangeStart": "10.0.0.100"
}
]
mtu:2800
multicastLimit:32
name:O791@zlang
nwid:826bb777c0f4c839
objtype:network
private:true
remoteTraceLevel:0
remoteTraceTarget:
revision:4
routes:[
{
"target": "10.0.0.0/24",
"via": null
}
]
rules:[
{
"not": false,
"or": false,
"type": "ACTION_ACCEPT"
}
]
rulesSource:
ssoEnabled:false
tags:[]
v4AssignMode:{
"zt": true
}
v6AssignMode:{
"6plane": false,
"rfc4193": false,
"zt": false
}

请教下能用ddns来用吗?

甲骨云安装后,客户端无法加入

使用甲骨云免费服务器部署,部署完成后,客户端连接网络,然后去控制台看,成员为0,部署几次+换了服务器也是这样,请问我怎么排查问题

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.