计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
tailscale-client【效率与协作】Install, configure, and troubleshoot the official Tailscale client when connected to a Headscale self-hosted control server. Use when connecting a new device, diagnosing connectivity, checking peer status, or troubleshooting DERP relay issues.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Tailscale is a WireGuard-based mesh VPN that connects devices into a secure
tailnet. When used with Headscale, a
self-hosted open-source control server, the official Tailscale client connects
via the --login-server flag instead of Tailscale's SaaS control plane.
This skill covers client-side installation, authentication, diagnostics, and troubleshooting.
[Client A] ───── WireGuard ───── [Client B]
│ │
└──────── Headscale URL ────────┘
(control/
coordination)
The Tailscale client (the tailscaled daemon) registers with the Headscale
control server, exchanges WireGuard keys, and establishes direct peer-to-peer
encrypted connections. When direct NAT traversal fails, traffic falls back
through DERP (Detour Encrypted Relay Protocol) relays.
Install the official Tailscale client on the target device:
| Platform | Command |
|---|---|
| Debian/Ubuntu | `curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.noarmor.gpg |
| macOS | brew install tailscale |
| Windows | choco install tailscale |
| Fedora/RHEL | sudo dnf install dnf-plugins-core && sudo dnf config-manager --add-repo https://pkgs.tailscale.com/stable/fedora/tailscale.repo && sudo dnf install tailscale |
| Alpine | apk add tailscale |
See ts-install.sh for automated detection and installation.
After installation, authenticate with your Headscale server:
sudo tailscale up --login-server=https://headscale.example.com
This opens a browser for web-based authentication OR prints an auth URL at the terminal. For non-interactive (scripted) setups, use a pre-authentication key:
sudo tailscale up \
--login-server=https://headscale.example.com \
--authkey=tskey-auth-xxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
See ts-up.sh for a wrapper with env-var defaults.
The default tailscale up flow prints a URL (e.g. https://headscale.example.com/register/nodekey:xxxxx).
Visit this URL in a browser (or pass it to the Headscale admin to approve).
Generate on the Headscale server:
headscale preauthkeys create --user myuser
Use the key with --authkey as shown above. Keys can be tagged for
service/auth nodes that don't belong to a specific user:
headscale preauthkeys create --user myuser --tags tag:ci-runner,tag:monitoring
Then on the client:
sudo tailscale up \
--login-server=https://headscale.example.com \
--authkey=tskey-auth-xxxxx \
--advertise-tags=tag:ci-runner
| Command | Purpose |
|---|---|
tailscale status --json | List all peers and their connection state |
tailscale ping --verbose -c 3 <peer> | Test direct vs. relay path to a peer |
tailscale netcheck | Check NAT type and DERP relay connectivity |
tailscale version | Client and daemon version info |
tailscale debug | Low-level debugging (derp-map, metrics, goroutines) |
Run ts-diagnostics.sh for a comprehensive connectivity bundle that collects
all of the above into a structured JSON output. Use
ts-connectivity-report.py to interpret the diagnostics and produce a
human-readable or structured report.
| Feature | Headscale Support | Notes |
|---|---|---|
| MagicDNS | ✅ Supported | --accept-dns must be passed to tailscale up |
| Taildrop / Taildrive | ✅ Supported | File sharing between peers |
| Tailscale SSH | ✅ Supported | --ssh flag on tailscale up |
| Serve | ✅ Supported | Expose local services via tailnet |
| Funnel | ❌ Not supported | Funnel requires Tailscale's SaaS control plane |
| Exit Nodes | ✅ Supported | Advertise with --advertise-exit-node, use with --exit-node |
| Variable | Purpose |
|---|---|
HEADSCALE_URL | Default --login-server URL for ts-up.sh |
TAILSCALE_AUTHKEY | Default --authkey for ts-up.sh |
lsof -i :8080.ts-diagnostics.sh or tailscale status --json and look for
"relay":"..." instead of "txBytes"/"rxBytes" on the direct path.tailscale
CLI commands work. On systemd systems: sudo systemctl start tailscaled.
On macOS: open the Tailscale GUI app or run sudo tailscaled.--accept-dns on tailscale up.
Without it, nodes are only reachable by their Tailscale IP (100.x.x.x).--force-reauth or
re-run tailscale up to re-authenticate. Pre-auth keys can be created
with --expiry=false for non-expiring (long-lived) nodes.This skill should be loaded when the user mentions any of the following:
tailscale status, tailscale ping, or tailscale netcheck outputDo not use this skill for server-side Headscale deployment (load headscale-deploy instead) or for ACL/policy authoring (load tailnet-policy). It covers client installation, authentication, and diagnostics only.