自建 headscale
2025-8-17
| 2026-6-26
字数 792阅读时长 2 分钟
type
Post
status
Published
date
Aug 17, 2025
slug
summary
tags
category
icon
password
AI summary
Last edited time
Jun 26, 2026 07:08 AM

headscale 安装配置

默认 headscale 的 ip 段配置为 100.64.0.0/10, 这个会和阿里云的ECS的默认 dns 冲突,改为 10.99.100.0/24 段
headscale 中用户可以理解为租户,不同的租户网络隔离

常用命令

 

也可以通过 headscale-ui 设置 preauth

 
notion image
 

阿里云 tailscale 设置

阿里云 ECS 默认使用 100.100.2.136/100.100.2.138 作为内部 DNS 解析,会与 tailscale 默认的 iptables 规则冲突
添加 iptables 规则
 
开启 ipv4 转发
 
 
开放 41641 udp 端口
notion image
 
安装 tailscale
 
登录到headscale
--snat-subnet-routes=false 视情况加, 阿里云 RDS 如果只允许内网访问,需要 --snat-subnet-routes=true

macos tailscale 设置

启用命令行
notion image
notion image
 
通过事先创建好的 preauthkey 加入到网络
 
添加成功后客户显示
notion image

iStoreOS tailscale 设置

官方 iStore 商店中安装的版本太老,需要 在官方地址 下载对应版本, 手动更新替换 /usr/sbin/tailscale /usr/sbin/tailscaled
 
ssh 登录后通过以下命令进行登录

📎 参考文章

 
 
mihomo 使用Playwright 使用心得
Loading...