Files
tailscale/README.md
Timmy 2ffa06ac80 Initial commit: Tailscale Docker deployment with Headscale
Docker Compose 部署 Tailscale 連線至自架 Headscale 控制伺服器,
包含子網路由、出口節點、iptables NAT 設定及完整中文文件。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 09:17:12 +08:00

68 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Tailscale Docker 部署Headscale
使用 Docker Compose 部署 Tailscale連線至自架的 Headscale 控制伺服器。
## 功能
- 透過 Docker 容器執行 Tailscale使用 host 網路模式
- 連線至 `https://headscale.lotimmy.com`
- 子網路由廣播192.168.88.0/24
- 出口節點Exit Node支援
- iptables NAT/轉送自動設定
- 透過 Watchtower 自動更新容器映像
## 檔案結構
| 檔案 | 說明 |
|------|------|
| `docker-compose.yml` | Docker 服務定義 |
| `.env` | 環境變數TS_AUTHKEY |
| `run.sh` | 啟動容器 |
| `stop.sh` | 停止容器 |
| `docker_exec_tailscale_up.sh` | 連線至 Headscale含路由與出口節點設定 |
| `docker_exec_tailscale_status.sh` | 查看連線狀態 |
| `docker_exec_tailscale_ip.sh` | 查詢 Tailscale IP |
| `tailscale` | Tailscale CLI 包裝腳本 |
| `iptables_reset_and_configure.sh` | 防火牆與 NAT 設定 |
## 快速開始
```bash
# 1. 設定 .env 中的 TS_AUTHKEY
# 2. 啟動
./run.sh
# 3. 連線至 Headscale
./docker_exec_tailscale_up.sh
# 4. 設定防火牆(如需路由功能)
sudo ./iptables_reset_and_configure.sh
# 5. 驗證
./docker_exec_tailscale_status.sh
```
## 網路架構
```
Tailscale 節點 ──► Headscale (headscale.lotimmy.com)
tailscale0 介面 (100.64.0.0/10)
NAT MASQUERADE
eth0 ──► LAN (192.168.88.0/24)
```
## 主機名稱慣例
使用 `ip-192-168-88-XX` 格式,對應主機的區域網路 IP。
## 相關文件
- [QUICKSTART.md](QUICKSTART.md) — 快速開始指南
- [OPERATIONS.md](OPERATIONS.md) — 維運操作手冊
- [SUMMARY.md](SUMMARY.md) — 專案摘要