在 Windows 上安装 Tailscale
本指南介绍如何在 Windows 系统上安装和配置 Tailscale。
系统要求
- Windows 10 或更高版本
- Windows Server 2016 或更高版本
- 管理员权限(用于安装)
安装方法
方法一:图形界面安装(推荐)
- 访问 Tailscale 下载页面
- 点击"Download for Windows"下载安装程序
- 运行下载的
.exe文件 - 按照安装向导完成安装
方法二:命令行安装
使用 PowerShell 安装:
powershell
# 使用 winget 安装
winget install tailscale.tailscale
# 或使用 Chocolatey 安装
choco install tailscale方法三:便携版
下载便携版可执行文件:
- 访问 Tailscale 下载页面
- 下载便携版 ZIP 文件
- 解压到任意目录
- 运行
tailscale.exe
配置 Tailscale
1. 启动 Tailscale
安装完成后,Tailscale 会自动启动。您可以在系统托盘中看到 Tailscale 图标。
2. 连接到 tailnet
- 点击系统托盘中的 Tailscale 图标
- 点击"Log in"
- 在浏览器中完成身份验证
- 连接成功后,图标会显示绿色勾号
3. 验证连接
打开 PowerShell 并运行:
powershell
tailscale status输出示例:
100.100.100.100 your-device-name your-email@domain.com windows -
100.101.102.103 other-device your-email@domain.com linux -命令行操作
Tailscale 在 Windows 上也支持命令行操作:
查看状态
powershell
tailscale status连接到网络
powershell
tailscale up断开连接
powershell
tailscale down查看IP地址
powershell
tailscale ipPing 其他设备
powershell
tailscale ping other-device高级配置
设置为出口节点
将此设备配置为出口节点:
- 打开管理员 PowerShell
- 运行命令:
powershell
tailscale up --advertise-exit-node- 在管理控制台中批准此设备作为出口节点
设置子网路由器
将此设备配置为子网路由器:
powershell
tailscale up --advertise-routes=192.168.1.0/24使用认证密钥(无交互)
创建一个认证密钥并使用它连接:
powershell
tailscale up --authkey=tskey-xxxxxxxxxxxx故障排除
Tailscale 服务未运行
检查服务状态:
powershell
Get-Service Tailscale启动服务:
powershell
Start-Service Tailscale防火墙问题
确保 Windows 防火墙允许 Tailscale:
powershell
# 允许 Tailscale 通过防火墙
New-NetFirewallRule -DisplayName "Tailscale" -Direction Inbound -Program "C:\Program Files\Tailscale\tailscale.exe" -Action Allow
New-NetFirewallRule -DisplayName "Tailscale" -Direction Outbound -Program "C:\Program Files\Tailscale\tailscale.exe" -Action Allow日志位置
Tailscale 日志位于:
C:\ProgramData\Tailscale\Logs重装 Tailscale
如果遇到问题,可以尝试重装:
powershell
# 卸载
winget uninstall tailscale.tailscale
# 重新安装
winget install tailscale.tailscale