Tailscale
Tailscale
---
summary: "Tailscale - private network connecting this VM to the user's own machines"
read_when:
- Reach a machine on the user's Tailscale network or tailnet
- Join a Tailscale network from this device, or check whether it has
- Reach a personal, work, or home machine not on the public internet
- Access a service on a `100.64.0.0/10` address (`100.64.` through `100.127.`)
title: "Tailscale"
---
这台设备在你的 Tailscale 网络上请求使用名称 `muse`。
Tailscale 是一个私有网络(private network),把这台 VM 与用户自己的机器连在一起。连接后,这些机器可通过它们的 tailnet 地址访问,Tailscale 从 `100.64.0.0/10` 段分配地址——即从 `100.64.` 到 `100.127.` 的任意地址,不只是 `100.64.`。
这台设备仅以客户端(client)身份加入:只发起出站连接,不接受任何入站连接。它无法从 tailnet 被访问,不托管任何服务,也不为其他机器转发流量。
> Tailscale 支持是实验性的,仍在开发中。
---
summary: "Tailscale - private network connecting this VM to the user's own machines"
read_when:
- Reach a machine on the user's Tailscale network or tailnet
- Join a Tailscale network from this device, or check whether it has
- Reach a personal, work, or home machine not on the public internet
- Access a service on a `100.64.0.0/10` address (`100.64.` through `100.127.`)
title: "Tailscale"
---
This device requests the name `muse` on your Tailscale network.
Tailscale is a private network joining this VM to the user's own machines. Once
connected, they are reachable at their tailnet addresses, which Tailscale
assigns from `100.64.0.0/10` — anything from `100.64.` to `100.127.`, not just
`100.64.`.
This device joins as a client only: it makes outgoing connections and accepts
none. It cannot be reached from the tailnet, hosts nothing, and does not route
traffic for other machines.
> Tailscale support is experimental and work in progress.
```bash
tailscale up
```
会输出一个链接。**把链接展示给用户并请他们打开**——只有他们能批准这台设备。批准后加入会自动完成;他们一批准,连接就建立,用 `tailscale status` 来确认。
等待期间可以安全地重新运行:它会再次显示同一个链接并继续等待批准。链接五天内有效。这台设备每次询问后过一段时间会停止等待,所以如果用户需要更长时间,再运行一次即可;它会接回同一个链接。
如果用户运行自己的控制服务器(headscale 或其他自托管控制平面),按原生 CLI 的方式传入——仅支持 https 起源(origin):
```bash
tailscale up --login-server https://headscale.example.com
```
该选择会随注册(enrollment)持久保存,`tailscale status` 会显示当前使用的登录服务器;切换到另一个服务器前需要先执行 `tailscale down`。批准一次自定义服务器的加入不会留下可复用的权限:每次批准都是一次性的且指明服务器,这与普通的 `tailscale up` 不同,后者可能带有一个长期有效的允许。
`tailscale down` 会断开这台 VM 并清除其 Tailscale 身份,因此重新上线需要新的批准——当用户希望这台 VM 不再持有访问权限时使用它。
它无法从 Tailscale 管理控制台或用户自己的控制服务器上移除设备。告诉用户自行去那里删除。
```bash
tailscale up
```
Prints a link. **Show it to the user and ask them to open it** — only they can
approve this device. Approval finishes the join on its own; the connection comes
up as soon as they approve, and `tailscale status` is how you confirm it.
Safe to run again while waiting: it shows the same link again and keeps
watching for the approval. The link stays good for five days. This device
stops watching a while after each ask, so if the user needs longer, run it
again; it picks up the same link.
If the user runs their own control server (headscale or another self-hosted
control plane), pass it the way the vanilla CLI does — an https origin only:
```bash
tailscale up --login-server https://headscale.example.com
```
The choice persists with the enrollment and `tailscale status` names the login
server in use; switching to a different one needs `tailscale down` first.
Approving a custom-server join never leaves a reusable permission behind: each
approval is single-use and names the server, unlike a plain `tailscale up`,
which can carry a standing allow.
`tailscale down` disconnects this VM and erases its Tailscale identity, so
coming back up needs a fresh approval — use it when the user wants this VM to
stop holding access.
It cannot remove the device from the Tailscale admin console or their own
control server. Tell the user to delete it there themselves.
普通网络访问到不了 tailnet。复用运行时代理(runtime proxy),只把端口改为 `3130`:
```bash
tunnel_proxy="${HTTPS_PROXY%:*}:3130"
curl --proxy "$tunnel_proxy" --fail-with-body "http://<tailnet-ip>:<port>/<path>"
```
端口决定走 Tailscale,地址只是目的地。它可以承载任何 TCP 服务,不只是 HTTP——把客户端指向同一个代理即可。
**只走 TCP,经该代理。** 隧道承载的是连接而非数据包,所以 `ping`、traceroute 以及其他走 ICMP 或 UDP 的工具都到不了 tailnet——即使机器在线且可达,它们也会失败或挂起。ping 失败不能说明任何问题;不要报告说机器宕机了。经代理打开一条 TCP 连接是唯一的测试方法。
- 对某个地址的第一次隧道请求需要单独批准;网页权限不会沿用。一旦批准,所选的权限有效期覆盖通过该代理访问该确切名称或 IP 的其他端口和 TCP 服务,包括 SSH。同一机器的另一个名称或 IP(短名、完整 MagicDNS 名、IPv4、IPv6)是不同的地址,需要单独批准;固定使用一个。
- 任何等待批准的请求都可能需要等待用户回应。这是预期的:不要超时、不要重试,也不要把等待解读为失败。
- 如果这台设备尚未加入网络,或该地址不是 tailnet 可达的,请求会直接失败,而不会回退到公网。检查 `tailscale status`。
- 绝不要把凭据放进命令里。
Ordinary network access does not reach the tailnet. Reuse the runtime proxy,
changing only its port to `3130`:
```bash
tunnel_proxy="${HTTPS_PROXY%:*}:3130"
curl --proxy "$tunnel_proxy" --fail-with-body "http://<tailnet-ip>:<port>/<path>"
```
The port selects Tailscale; the address is just the destination. This carries
any TCP service, not only HTTP — point a client at the same proxy.
**TCP only, through that proxy.** The tunnel carries connections, not packets,
so `ping`, traceroute, and anything else over ICMP or UDP never reach the
tailnet — they fail or hang even when the machine is up and reachable. A failed
ping is not evidence of anything; do not report it as the machine being down.
Opening a TCP connection through the proxy is the only test.
- The first tunnel request to an address needs its own approval; web permission
does not carry over. Once approved, the selected permission lifetime covers
other ports and TCP services, including SSH, on that exact name or IP through
this proxy. Another name or IP for the same machine (short name, full
MagicDNS name, IPv4, IPv6) is a different address and needs its own approval;
keep using one.
- Any request awaiting approval may wait for the user to answer it. Expected: do
not time out, retry, or read the pause as a failure.
- If this device has not joined a network, or the address is not one the
tailnet reaches, the request fails rather than falling back to the public
internet. Check `tailscale status`.
- Never put credentials in a command.
`tailscale status` 列出连接状态以及每台设备及其地址;`tailscale ip` 显示这台设备自己的地址。
可以用 tailnet IP 或(当用户网络启用 MagicDNS 时)机器名来寻址。经 `3130` 端口的请求使用该网络的 DNS 设置,包括搜索域、分流 DNS、NextDNS over HTTPS、普通 DNS、DNS-over-TLS,以及经 tailnet 可达的私有 DNS 服务器。如果某个 DNS 服务器不可用,请求可以尝试为同一 DNS 路由配置的另一台服务器。阻塞或否定回答不会切换 DNS 提供方。这些设置适用于经 Tailscale 代理的请求。该连接器(connector)不提供出口节点(exit-node)选择。
`tailscale status` 说明某个地址是否在网络上。它没有可达性探测;用经代理的 TCP 连接测试服务。
`tailscale status` lists the connection state and every device with its
addresses; `tailscale ip` shows this device's own.
Machines can be addressed by tailnet IP or, when the user's network enables
MagicDNS, by their name. Requests through port `3130` use the network's DNS
settings, including search domains, split DNS, NextDNS over HTTPS, plain DNS,
DNS-over-TLS, and private DNS servers reachable through the tailnet. If a DNS
server is unavailable, the request can try another server configured for that
same DNS route. A blocking or negative answer does not switch DNS providers.
These settings apply to requests through the Tailscale proxy. The connector
does not offer exit-node selection.
`tailscale status` says whether an address is on the network. There is no
reachability probe; test the service with a TCP connection through the proxy.
说“你的 Tailscale 网络”或直接点名机器。除非用户要求细节,否则不要引用原始命令或 `100.64.0.0/10` 地址。
Say "your Tailscale network" or name the machine. Do not quote raw commands or
`100.64.0.0/10` addresses unless the user asks for detail.