Nhiều máy rải rác — VPS, NAS, VM trên Proxmox — nhưng bạn chỉ muốn SSH, rsync, hoặc API nội bộ giữa chúng mà không mở hàng loạt port ra Internet. Tailscale gom chúng vào một tailnet (mạng mesh trên WireGuard) với vài lệnh cài đặt.
The practical problem
A homelab is rarely a single box at home. You often have:
- One or more VPS instances (backups, light CI, bastion).
- VMs / LXCs on Proxmox with only LAN addresses.
- Laptops and phones when you want to behave “as if you are on the home network”.
You want ssh [email protected], Syncthing/rsync between nodes, or internal HTTP (http://nas.lan:8080) without chasing changing public IPs and without exposing SSH on 0.0.0.0.
Plain WireGuard is still an excellent transport — but operating an N×N mesh yourself (keys, firewall rules, onboarding every new host) becomes a side project. Tailscale keeps WireGuard for the data plane and hands coordination (login, 100.64.0.0/10 addressing, NAT traversal, ACLs) to their control plane.
:::info Versus Cloudflare Tunnel Need RDP into Windows from a machine that won’t allow a VPN client? See Cloudflare Tunnel + RDP. Tailscale fits when you control the client on laptop, phone, or server. :::
What is Tailscale?
- Tailnet: your private network; each device gets a Tailscale IP (typically
100.x.y.z). - Mesh: peers try to connect directly (UDP hole punching). If that fails, traffic uses an encrypted DERP relay.
- WireGuard: the tunnel crypto; Tailscale is not a replacement for transport security.
Hub-and-spoke VPNs centralize traffic and add latency. A mesh helps when two VPSes in different regions talk to each other without hair-pinning through home.
Pros and cons (homelab lens)
| Notes | |
|---|---|
| Pros | Fast install on Linux/macOS/Windows/iOS/Android; machine inventory in the admin UI; MagicDNS; tag-based ACLs; subnet routers and exit nodes when needed |
| Pros | No self-hosted coordination server (unlike Headscale, where you run the control plane) |
| Cons | Reliance on Tailscale’s service (unless you move to Headscale for policy reasons) |
| Cons | Overlay adds overhead — throughput is often lower than raw public IP or a tuned one-hop WireGuard link; usually fine for admin, sync, and APIs |
Personal plan limits change over time — check Tailscale pricing before you scale.
1. Create an account
- Open https://login.tailscale.com/start.
- Sign in with Google, GitHub, Microsoft, or corporate SSO if applicable.
- In the admin console → Machines, authorized devices and tailnet IPs appear after
tailscale up.
Enable device approval on shared tailnets so new machines need admin consent.
2. Install on Linux (VPS / VM)
The official script works on most distributions:
curl -fsSL https://tailscale.com/install.sh | sh
sudo systemctl enable --now tailscaled
sudo tailscale up
tailscale up prints a URL — open it in a browser, sign in to the same tailnet, and Authorize. The CLI should report success.
Verify:
tailscale status
tailscale ip -4
Ping another tailnet machine (use its 100.x from the dashboard):
ping -c 4 100.x.y.z
On Arch / EndeavourOS, yay -S tailscale is fine; you still need systemctl enable --now tailscaled.
3. Install on personal devices
- macOS / Windows / mobile: Tailscale download — GUI app, one-time login.
- With your laptop on the tailnet, SSH to a VPS via
100.xwithout publishing port 22 to the Internet (still use keys-only, no root login, and harden anything else that remains public).
4. MagicDNS and hostnames
In the admin console: DNS → enable MagicDNS. A machine named my-vps becomes reachable as ssh user@my-vps instead of memorizing 100.x.
Custom split DNS is optional; see MagicDNS.
5. Subnet router (optional)
A node inside your LAN (e.g. a small always-on PC) can advertise 192.168.1.0/24 into the tailnet. Remote machines then reach 192.168.1.50 as if they were on site.
# On the LAN gateway/host, after enabling IP forwarding per Tailscale docs:
sudo tailscale up --advertise-routes=192.168.1.0/24
Approve the route in the console. Read Subnet routers carefully — a bad route can expose your LAN.
Exit nodes (send Internet traffic via home): --advertise-exit-node — powerful; enable only if you understand the risk.
6. ACLs and baseline security
- Use tags like
tag:serverandtag:personalso only personal laptops may SSH to servers. - Disable key expiry on headless boxes only when necessary; prefer periodic re-auth on laptops.
- Tailscale does not replace OS patches, host firewalls, or secret rotation.
Starter ACL ideas: Tailscale ACL samples.
7. Performance — set expectations
iperf3 over the tailnet often scores lower than the same pair over public IP or a single-hop WireGuard tunnel — relays, MTU, and path selection matter. For backups, internal APIs, and SSH, it has been enough in practice; it is not my first choice for sustained high-bandwidth streaming.
If you need maximum throughput between exactly two nodes and you will maintain configs: self-hosted WireGuard can win. If you need many machines with frequent churn: Tailscale usually saves more calendar time.
8. Headscale — when SaaS is not an option
Headscale is an open-source control server; clients still use the Tailscale agent. Useful when policy forbids SaaS. You trade convenience for operations (upgrades, backups).
Workflow recap
- Create a tailnet → install
tailscaledon each host →tailscale upand authorize. - Turn on MagicDNS; use
100.xor hostnames for SSH/rsync. - Need full LAN from afar → controlled subnet router.
- RDP or locked-down clients without VPN → use a tunnel approach instead of forcing one tool everywhere.
Official docs: What is Tailscale? · Install on Linux.
Bài toán thực tế
Homelab không chỉ là một máy ở nhà. Thường có thêm:
- Một hoặc vài VPS (backup, CI nhẹ, bastion).
- VM / LXC trên Proxmox chỉ có IP LAN.
- Laptop và điện thoại khi cần “như đang ngồi trong mạng nhà”.
Bạn muốn ssh [email protected], chạy Syncthing/rsync giữa các node, hoặc gọi service nội bộ (http://nas.lan:8080) không phụ thuộc IP public đổi liên tục và không publish SSH ra 0.0.0.0.
WireGuard thuần vẫn là nền tảng tốt — nhưng tự quản N×N peer, key rotation, firewall khi thêm máy mới nhanh chóng thành công việc phụ. Tailscale giữ WireGuard cho data plane, phần điều phối (đăng nhập, phân IP 100.64.0.0/10, NAT traversal, ACL) giao cho control plane của họ.
:::info So với Cloudflare Tunnel Cần RDP vào Windows từ máy không cho cài VPN? Xem bài Cloudflare Tunnel + RDP. Tailscale hợp khi bạn kiểm soát được client trên laptop/phone/server. :::
Tailscale là gì?
- Tailnet: mạng riêng ảo của tài khoản/org bạn; mỗi thiết bị nhận địa chỉ Tailscale IP (thường dạng
100.x.y.z). - Mesh: hai máy cố gắng kết nối trực tiếp (UDP hole punching). Nếu không được, traffic đi qua DERP relay (vẫn mã hóa WireGuard).
- WireGuard: giao thức tunnel; Tailscale không thay thế bảo mật lớp transport.
Hub-and-spoke (một VPN server trung tâm) dễ nghẽn và tăng latency. Mesh giảm “đi vòng” khi hai VPS ở hai region nói chuyện với nhau.
Ưu / nhược điểm (góc nhìn homelab)
| Ghi chú | |
|---|---|
| Ưu | Cài nhanh trên Linux/macOS/Windows/iOS/Android; dashboard quản lý máy; MagicDNS; ACL theo tag; subnet router / exit node khi cần |
| Ưu | Không tự host coordination server (khác Headscale — self-host control plane) |
| Nhược | Phụ thuộc dịch vụ Tailscale (hoặc bạn chuyển sang Headscale nếu policy yêu cầu) |
| Nhược | Overlay thêm một lớp — băng thông thường thấp hơn kết nối public trực tiếp hoặc WireGuard point-to-point tối ưu; đủ cho admin, sync, API |
Giới hạn gói Personal thay đổi theo thời gian — luôn đối chiếu Tailscale pricing.
1. Tạo tài khoản
- Mở https://login.tailscale.com/start.
- Đăng nhập bằng Google, GitHub, Microsoft, hoặc SSO doanh nghiệp (nếu có).
- Vào Admin console → Machines: danh sách thiết bị và IP tailnet sẽ hiện ở đây sau khi
tailscale up.
Bật device approval nếu tailnet dùng chung: máy mới phải được admin chấp nhận trước khi tham gia.
2. Cài trên Linux (VPS / VM)
Script chính thức hoạt động trên hầu hết distro:
curl -fsSL https://tailscale.com/install.sh | sh
sudo systemctl enable --now tailscaled
sudo tailscale up
Lệnh tailscale up in ra URL — mở trình duyệt, đăng nhập cùng tài khoản tailnet, Authorize. Terminal báo Success khi xong.
Kiểm tra:
tailscale status
tailscale ip -4
Ping một máy khác trong tailnet (dùng IP 100.x từ dashboard):
ping -c 4 100.x.y.z
Arch / EndeavourOS: có thể dùng yay -S tailscale thay script, vẫn cần systemctl enable --now tailscaled.
3. Cài trên máy cá nhân
- macOS / Windows / mobile: Tailscale download — app GUI, đăng nhập một lần.
- Sau khi laptop vào tailnet, bạn có thể SSH vào VPS qua
100.xkhông cần mở port 22 ra Internet (vẫn nênPermitRootLogin no, key-only,fail2bannếu có surface khác).
4. MagicDNS và tên máy
Trong admin console: DNS → bật MagicDNS. Máy my-vps có thể gọi ssh user@my-vps thay vì nhớ IP 100.x.
Nếu dùng domain riêng (Split DNS), xem MagicDNS — phần nâng cao, không bắt buộc ngày đầu.
5. Subnet router (tuỳ chọn)
Một node trong LAN (ví dụ mini PC chạy Tailscale) quảng bá dải 192.168.1.0/24 vào tailnet. Máy ở xa truy cập 192.168.1.50 như đang trong LAN.
# Trên máy đứng trong LAN, sau khi bật IP forwarding theo docs Tailscale:
sudo tailscale up --advertise-routes=192.168.1.0/24
Trong console: Approve route. Đọc kỹ Subnet routers — sai route có thể lộ LAN.
Exit node (đi Internet qua nhà): --advertise-exit-node — hữu ích khi du lịch, nhưng là quyền lực lớn; chỉ bật khi hiểu rủi ro.
6. ACL và bảo mật tối thiểu
- Gắn tag cho
tag:server,tag:personal— policy chỉ cho laptop cá nhân SSH vào server. - Tắt key expiry chỉ khi thật sự cần (máy headless); ưu tiên re-auth định kỳ trên laptop.
- Không thay thế patch OS, firewall trên VPS, hay secrets management.
Mẫu ACL: Tailscale ACL samples.
7. Hiệu năng — kỳ vọng đúng
Đo iperf3 giữa hai máy qua tailnet thường thấp hơn cùng cặp qua IP public hoặc WireGuard một-hop — do relay, MTU, đường đi. Với đồng bộ backup, kubectl/API nội bộ, SSH, mình thấy đủ dùng; không chọn Tailscale làm đường truyền chính cho stream 4K.
Nếu cần tối đa throughput giữa đúng hai node và bạn sẵn sàng bảo trì config: WireGuard tự host vẫn thắng. Nếu cần mười máy và đổi máy thường xuyên: Tailscale tiết kiệm thời gian hơn rõ rệt.
8. Headscale — khi phải self-host
Headscale là implementation open-source của control server, client vẫn dùng tailscale. Hợp org cấm SaaS. Đổi chi phí: bạn vận hành, backup, upgrade.
Tóm tắt workflow
- Tạo tailnet → cài
tailscaledtrên từng máy →tailscale up+ authorize. - Bật MagicDNS; SSH/rsync qua
100.xhoặc hostname. - Cần LAN đầy đủ từ xa → subnet router có kiểm soát.
- RDP / máy không cài VPN → cân nhắc tunnel (Cloudflare hoặc tương đương), không nhét mọi thứ vào một giải pháp.
Tài liệu chính thức: What is Tailscale? · Install Linux.
