• 陪伴互联网运营小白共同探索成长,与IT爱好者共享探索乐趣
  • 建站只为分享,欢迎在PC端文章面打赏支持
  • 使用Ctrl+D 可收藏本站

在openvz上安装zerotier

好玩有趣 陆子方 2周前 (01-07) 35次浏览 0个评论 扫描二维码
文章目录[隐藏]

前言

这个很有意思,特别是对于纯ipv6的机子,有点类似直接拿了一个ipv4地址。

前置

打开TUN/TAP开关。一般在面板上就可以操作

安装

apt install curl -y
curl -s https://install.zerotier.com | bash

处理报错

如果直接运行,会看到以下错误。虽然zerotier控制面板能看到授权,但主机上无法获取ip
# service zerotier-one status
● zerotier-one.service - ZeroTier One
     Loaded: loaded (/lib/systemd/system/zerotier-one.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2025-01-07 01:35:59 UTC; 2min 44s ago
   Main PID: 249 (zerotier-one)
      Tasks: 24 (limit: 76936)
     Memory: 14.0M
     CGroup: /system.slice/zerotier-one.service
             └─249 /usr/sbin/zerotier-one

Jan 07 01:35:48 gufi.ippp.ml zerotier-one[254]: Control Plane Stopped
Jan 07 01:35:48 gufi.ippp.ml zerotier-one[254]: V6 Control Plane Stopped
Jan 07 01:35:48 gufi.ippp.ml zerotier-one[254]: terminate called without an active exception
Jan 07 01:35:48 gufi.ippp.ml systemd[1]: zerotier-one.service: Main process exited, code=killed, status=6/ABRT
Jan 07 01:35:48 gufi.ippp.ml systemd[1]: zerotier-one.service: Failed with result 'signal'.
Jan 07 01:35:48 gufi.ippp.ml systemd[1]: Stopped ZeroTier One.
Jan 07 01:35:59 gufi.ippp.ml systemd[1]: Started ZeroTier One.
Jan 07 01:35:59 gufi.ippp.ml zerotier-one[249]: Starting V6 Control Plane...
Jan 07 01:35:59 gufi.ippp.ml zerotier-one[249]: Starting Control Plane...
Jan 07 01:35:59 gufi.ippp.ml zerotier-one[249]: ERROR: unable to configure virtual network port: could not open TUN/TAP device: No such file or directory

处理过程

nano /lib/systemd/system/zerotier-one.service

#在ExecStart=/usr/sbin/zerotier-one 后添加 -U参数,结果如下

[Unit]
Description=ZeroTier One
After=network-online.target network.target
Wants=network-online.target

[Service]
ExecStart=/usr/sbin/zerotier-one -U
Restart=always
KillMode=process

[Install]
WantedBy=multi-user.target

#重载并重启服务
systemctl daemon-reload
systemctl restart zerotier-one

#加入网络
zerotier-cli join 网络ID

#授权后,查看连接状态。一般也可以通过ip a命令查看示
zerotier-cli listnetworks

 


子方有料原创丨转载请注明原文链接
期待您的评论或捐赠,这是最好的鼓励和支持!
喜欢 (0)
[赞赏使我快乐]
分享 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到