Skip to content

Instantly share code, notes, and snippets.

@taogashi
Last active April 22, 2021 05:44
Show Gist options
  • Save taogashi/349ae9059526909e4618412a398eea30 to your computer and use it in GitHub Desktop.
Save taogashi/349ae9059526909e4618412a398eea30 to your computer and use it in GitHub Desktop.
内网穿透的一种姿势

ubuntu创建网络并加入

  1. https://www.zerotier.com 上注册账号并创建网络,得到形如d9edf5716d92c74f的网络ID
  2. 在ubuntu设备上安装,curl -s https://install.zerotier.com | sudo bash
  3. 加入网络,sudo zerotier-cli join <网络ID>
  4. https://my.zerotier.com 上同意设备加入网络
  5. 在ubuntu设备上验证已加入网络,ifconfig结果显示ztugawpjjg接口上分配到ip地址,或者sudo zerotier-cli listnetworks显示<网络ID>

加入已有网络,只需要后面4步

进阶操作-自建moon加速连接

  1. 直接在/var/lib/zerotier目录下,创建moons.d文件夹,并且形如00000018fasd2319.moon的文件拷入,并重启服务sudo systemctl restart zerotier-one.service
  2. 验证moon添加成功,sudo zerotier-cli listpeers, 看到moon字样即成功
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment