Tailscale

Tailscale 是一個 Mesh VPN 雲端服務,基於 WireGuard 的 end-to-end 加密 VPN 技術,可用於 Peer-to-peer VPN,可穿越 NAT,中央管理控制台,免費版支援 3 個帳號 100 個裝置。

特點:

教學:

Alternatives

Peer-to-peer VPN
Tunnet VPN
Site-to-site VPN
Secure Reverse Proxy
Installation

Linux

curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up
Commands
# Connect your machine to your Tailscale network and authenticate in your browser
sudo tailscale up

# find your Tailscale IPv4 address
tailscale ip -4

# Find all IP of devices
tailscale status

# Custom Hostname
sudo tailscale up --hostname=<name>

tailscale set --hostname=<name>

# Disabling MagicDNS (optional)
tailscale set --accept-dns=false
Exit Node

Advertise a device as an exit node

  1. 下載安裝 tailscale client
  2. 啟用系統 IP forwarding
  3. 連線 tailscale 網路
  4. 設定 Exit node

啟用 IP forwarding

echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
sudo sysctl -p /etc/sysctl.d/99-tailscale.conf

連線 tailscale 網路

sudo tailscale up

設定 Exit node

sudo tailscale set --advertise-exit-node

前往網站管理平台

  1. Go to the Machines page of the admin console.
  2. Locate the device in the list. It should display the Exit Node badge.
  3. Select the 三點 menu, then select Edit route settings.
  4. Check the Use as exit node box, then select Save.

Use exit node

sudo tailscale up
tailscale status
sudo tailscale set --exit-node=<exit-node-ip>

# To stop using an exit node
sudo tailscale set --exit-node=
Tailscale Serve

這是 Tailnet 類似 Reverse Proxy 的服務,適用遠端存取那些僅開放 localhost 的服務。

如要使用 https,需要到 Tailscale 控制台啟用 HTTPS Certificates。然後存取的網址格式是 https://your-device.tailnet-domain。 

sudo tailscale serve --bg --https=443 127.0.0.1:18789

Tools
Tailscale on Proxmox
ScaleTail

用 Docker 架構整合 Tailscale 與各類服務的專案庫


Revision #39
Created 2025-04-13 10:22:43 CST by A-Lang (Admin)
Updated 2026-04-29 10:32:49 CST by A-Lang (Admin)