Openclaw和Tailscale
Tailscale 接受外部连接,然后将流量转发到本地的 Gateway 服务
一个免费的内网穿透服务,双方电脑都需要安装tailscale并登录同一账号
"gateway": {
"port": 18789,
"mode": "local",
"bind": "loopback", # Tailscale Serve 模式要求 Gateway 监听本地回环
"controlUi": {
"allowInsecureAuth": true
},
"auth": {
"mode": "token",
"token": "***************************"
},
"tailscale": {
"mode": "off", # 机器上安装tailscale
},
}shell
sudo tailscale up # 触发登录,window上需要管理员权限
sudo tailscale serve --bg http://127.0.0.1:18789 # 指向openclaw页面shell
# 1. 检查 Tailscale Serve 状态
tailscale serve status
# 2. 在服务器本地测试 OpenClaw 是否正常运行
curl -v http://127.0.0.1:18789
# 3. 通过 Tailscale 的 MagicDNS 测试(本地)
curl -v https://claw.tailebc46b.ts.net/?token=8e3b653f6819109f3f181c14e65fae01824acffd7f4e6cde
# 4. 检查端口冲突(443 是否被占用)
sudo netstat -tlnp | grep :443
# 5. 检查 Tailscale 是否正常连接
tailscale statuspairing required
openclaw要求对每一台新请求的机器进行授权
shell
# 1. 尝试token登录,出现pairing required错误
# 查看请求device id
openclaw devices list
# 授权机器
openclaw devices approve ***************