本文片帶你一步步利用 Google Cloud Platform (GCP) 的免費資源和 Tailscale 的特殊功能,來搭建一個專屬於你的 VPN 出口節點。你將學會如何建立一個位於美國的永久免費伺服器,並將其設定為你的 VPN 網路出口。 讓你擁有一個安全、穩定,且可以自由選擇連線位置的個人 VPN。這不僅能幫助你提升網路隱私,還能讓你突破地域限制,自由瀏覽網路世界。
Linux 安裝 Tailscale
curl -fsSL https://tailscale.com/install.sh | sh
加入 Tailnet
sudo tailscale up
設定出口節點
Exit Node:讓其他節點透過此機器出網 (VPN)
sudo tailscale up --reset --advertise-exit-node
驗證 Tailscale 連線狀態
tailscale status
編輯 sysctl.conf 設定檔
sudo nano /etc/sysctl.conf
以下命令會立即套用設定,讓 Linux 核心支援封包轉送。
sudo sysctl -p
解決 UDP GRO forwarding 警告
若遇到「Warning: UDP GRO forwarding is suboptimally configured on enp6s18…」這樣的警告訊息,是 Tailscale 在 Linux 上偵測到你的網卡未啟用某些優化設定,可能會影響 Exit Node 的 UDP 轉送效能。你可以透過 ethtool 工具來優化。
解法:使用 ethtool 啟用 UDP GRO Forwarding
1️⃣ 安裝 ethtool(若尚未安裝)
sudo apt install ethtool
2️⃣ 查詢你的網卡名稱(自動偵測)
ip -o route get 8.8.8.8 | cut -f 5 -d ' '
這會輸出你的主要網卡名稱,例如 enp6s18。
3️⃣ 套用優化設定
sudo ethtool -K enp6s18 rx-udp-gro-forwarding on
sudo ethtool -K enp6s18 rx-gro-list off
📌 請將 enp6s18 替換為你實際的網卡名稱。
4️⃣ 設定開機自動套用
這些設定在重開機後會失效,建議加入開機腳本:
使用 networkd-dispatcher:
printf '#!/bin/sh\nethtool -K %s rx-udp-gro-forwarding on rx-gro-list off\n' "$(ip -o route get 8.8.8.8 | cut -f 5 -d ' ')" | sudo tee /etc/networkd-dispatcher/routable.d/50-tailscale
sudo chmod 755 /etc/networkd-dispatcher/routable.d/50-tailscale
- Tailscale 使用 UDP 傳輸封包,尤其在 Exit Node 模式下
- 若未啟用 GRO(Generic Receive Offload)優化,可能導致效能瓶頸
- 啟用後可提升封包聚合效率,減少 CPU 負擔、降低延遲
重要!開放 UDP 埠號
補充!請記得開放 Tailscale 使用的埠號 UDP 41641