自部署Headscale开源免费的异地组网支持多平台简朴快速上手教程 ...

打印 上一主题 下一主题

主题 1496|帖子 1496|积分 4488

网络期间我们经常需要远程互访问管理家庭或公司里的电脑,NAS,连网装备,随着宽带的提速网络的普及,未来这个需求只会更加的多。固然现在都有IPV6可以直连了,但有些装备或网络还不支持或没开启,IPV6究竟是暴露在公网的始终没那么安全,总之多个方案多个选择是最好的,以是折腾搭建了异地组网网络,也叫虚拟局域网,号称搭建后能主动P2P组网直连即不需要走公网服务器的流量,自用的话用组网的方式比内网穿透NPS,FRP和IPV6要安全可靠快速。
       要搭建一套远程组网网络必须有一台公网VPS的linux服务器支持docker运行,保举使用腾讯的现在活动很便宜几十块就一年,还能同价续费一年等于白撸二年,购买连接:精选特惠 上云无忧_腾讯云优惠活动,往下拉就能看到轻量的服务器购买,作者使用的就是腾讯的轻量海外服务器199/年,买海外服务器的懂得都懂了,可以挂很多服务,作者的网站88531,这里不方便多说了,至于服务器安装网上有很多教程这里就不说了,下面就只讲解这个组网Headscale部署过程,保举使用宝塔部署方便管理。


1、新建挂载目次和创建数据库文件

  1. mkdir -p /docker/headscale/config
  2. touch /docker/headscale/config/db.sqliteCopy
复制代码
2、两个文件配置文件 (注意存放的路径)

可以根据自己需求修改,注意端口不能和你已有的应用有冲突
/docker/headscale/config/config.yaml 主要配置组网的相干信息
<public_ip>需要修改为你服务器的现实IP
  1. ---
  2. # headscale will look for a configuration file named `config.yaml` (or `config.json`) in the following order:
  3. #
  4. # - `/etc/headscale`
  5. # - `~/.headscale`
  6. # - current working directory
  7. # The url clients will connect to.
  8. # Typically this will be a domain like:
  9. #
  10. # https://myheadscale.example.com:443
  11. #
  12. server_url: http://<public_ip>:8081
  13. # Address to listen to / bind to on the server
  14. #
  15. # For production:
  16. # listen_addr: 0.0.0.0:8080
  17. listen_addr: 0.0.0.0:8081
  18. # Address to listen to /metrics, you may want
  19. # to keep this endpoint private to your internal
  20. # network
  21. #
  22. metrics_listen_addr: 0.0.0.0:6030
  23. # Address to listen for gRPC.
  24. # gRPC is used for controlling a headscale server
  25. # remotely with the CLI
  26. # Note: Remote access _only_ works if you have
  27. # valid certificates.
  28. #
  29. # For production:
  30. # grpc_listen_addr: 0.0.0.0:50443
  31. grpc_listen_addr: 127.0.0.1:50443
  32. # Allow the gRPC admin interface to run in INSECURE
  33. # mode. This is not recommended as the traffic will
  34. # be unencrypted. Only enable if you know what you
  35. # are doing.
  36. grpc_allow_insecure: false
  37. # Private key used to encrypt the traffic between headscale
  38. # and Tailscale clients.
  39. # The private key file will be autogenerated if it's missing.
  40. #
  41. private_key_path: /etc/headscale/private.key
  42. # The Noise section includes specific configuration for the
  43. # TS2021 Noise protocol
  44. noise:
  45.   # The Noise private key is used to encrypt the
  46.   # traffic between headscale and Tailscale clients when
  47.   # using the new Noise-based protocol. It must be different
  48.   # from the legacy private key.
  49.   private_key_path: /etc/headscale/noise_private.key
  50. # List of IP prefixes to allocate tailaddresses from.
  51. # Each prefix consists of either an IPv4 or IPv6 address,
  52. # and the associated prefix length, delimited by a slash.
  53. # While this looks like it can take arbitrary values, it
  54. # needs to be within IP ranges supported by the Tailscale
  55. # client.
  56. # IPv6: https://github.com/tailscale/tailscale/blob/22ebb25e833264f58d7c3f534a8b166894a89536/net/tsaddr/tsaddr.go#LL81C52-L81C71
  57. # IPv4: https://github.com/tailscale/tailscale/blob/22ebb25e833264f58d7c3f534a8b166894a89536/net/tsaddr/tsaddr.go#L33
  58. ip_prefixes:
  59.   - fd7a:115c:a1e0::/48
  60.   - 100.64.0.0/10
  61. # DERP is a relay system that Tailscale uses when a direct
  62. # connection cannot be established.
  63. # https://tailscale.com/blog/how-tailscale-works/#encrypted-tcp-relays-derp
  64. #
  65. # headscale needs a list of DERP servers that can be
复制代码
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

圆咕噜咕噜

论坛元老
这个人很懒什么都没写!
快速回复 返回顶部 返回列表