zerotier官网:ZeroTier – Global Area Networking
![](https://img-blog.csdnimg.cn/img_convert/1b9b05d2ae90579fbaf4af3da93d28ba.png)
这10多年做了很多项目都没有记录过,需要搭建使用时经常忘了而重新网上找教程,浪费时间,希望自己养成解决思路及实现教程记录的习惯,开始写各种教程。
实现思路:
一、根服务器搭建方式
2种zerotier实现方式
利用国内vps服务器搭建zerotier根服务器,提升连接速度。
利用zerotier自带服务搭建。
二、核心接入内网布局旁路由挂载zeroter服务。
树莓派或其他软路由刷openwrt装zerotier服务
使用路由器刷openwrt装zerotier服务
三、接入端安装zerotier服务
实现方法:
一、根服务器搭建
vps搭建根服务器 (利用docker部署方式部署)
1、dock安装
安装docker 命令
sudo apt-get removedocker docker-engine docker-ce docker.io
sudo apt-get update
sudo apt-get install-y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg| sudo apt-key add -
sudoadd-apt-repository "deb [arch=amd64]
https://download.docker.com/linux/ubuntu$(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get installdocker-ce
sudo service dockerstart
2、安装zerotier plant(根服务器)
3.1:准备条件
具有公网 ip 的服务器(需要开放 3443/tcp 端口,9993/tcp 端口,9993/udp 端口)
安装 docker
3.2:下载项目源码
git clone https://github.com/xubiaolin/docker-zerotier-planet.git
3.3:执行安装脚本
进入项目目录
cddocker-zerotier-planet
运行 deploy.sh 脚本
./deploy.sh
根据提示来选择即可,操作完成后会自动部署
-------------------------------------------
您当前公网ip为:8.8.8.8,
使用当前ip请输入:y
-------------------------------------------
使用其他ip请输入要使用的ip,例如1.1.1.1
-------------------------------------------
整个脚本预计需要 3-10分钟,具体需要看网络与机型
当您看到类似如下字样时,表示安装成功
Step 6/6 : CMD/bin/sh -c "zerotier-one -d; cd /opt/ztncui/src;npm start"
---> Running in13b4acf043ce
Removing intermediate container 13b4acf043ce
---> f66b3f73437e
Successfully built f66b3f73437e
Successfully tagged zerotier-planet:latest
启动服务
WARNING: Published ports are discarded when using host network
mode
7782066b89fb217bf53ae57b139c73c3d6df79fecf887d1571aa8eed2433ba75
具体实现方式可见:参考连接:GitHub - xubiaolin/docker-zerotier-planet: 私有部署zerotier-planet服务
利用zerotier自带服务部署
按官网教程搭建可参考网上搭建教程。
二、核心接入内网布局旁路由挂载zeroter服务。
软路由、路由器、树莓派等设备刷入openwrt后安装zerotier服务。
接入核心内网将搭载的openwrt旁路由配置好固定IP。
设置需接入的设备的IP的dns指向openwrt旁路由
三、接入端安装zerotier服务
接入端安装好zerotier服务并配置好,这样可以实现设备远程调用。
搭建案例:
低成本搭建远程呼叫中心。
主要需采购硬件or服务:vps、电话模拟转数字设备、可刷openwrt路由器
实现方式:
1、使用硬件将电话的模拟信号转成数字信号
搭建旁路由并挂载zerotier服务
远端挂载zerotier服务远程,电话拨号软件指向接入设备的IP地址即可使用。