$5 VPS 上的 WireGuard VPN
在 NoctisNode VPS 上用一个配置文件部署 WireGuard:安全默认值、IPv6 支持、秒级添加节点,复制即用。
几分钟内即可在 NoctisNode 干净的 IP 上获得私人出口。以下步骤假设 Ubuntu 24.04 或 Debian 12——订购流程均可一键选装。
安装并启用
apt update && apt install -y wireguard
systemctl enable wg-quick@wg0服务端配置
用 wg genkey | tee server.key | wg pubkey 生成密钥。建议在 /etc/sysctl.conf 中永久开启转发,而不依赖 PostUp。
[Interface]
Address = 10.66.0.1/24, fd42::1/64
ListenPort = 51820
PrivateKey = <server-private-key>
PostUp = sysctl -w net.ipv4.ip_forward=1; ip6tables -t nat -A POSTROUTING -s fd42::/64 -o eth0 -j MASQUERADE; iptables -t nat -A POSTROUTING -s 10.66.0.0/24 -o eth0 -j MASQUERADE
PostDown = sysctl -w net.ipv4.ip_forward=0添加对端
每个 peer 在 IPv4 得到 /32、IPv6 得到 /128。systemctl restart wg-quick@wg0 重启后,客户端用 AllowedIPs = 0.0.0.0/0, ::/0 即可让全部流量走 VPS。
[Peer]
PublicKey = <client-public-key>
AllowedIPs = 10.66.0.2/32, fd42::2/128加固默认项
- ▹防火墙只放行 51820/udp 和 SSH;SSH 保持仅密钥登录。
- ▹设备失控时轮换 peer 密钥——删除 peer 段落即刻生效。
- ▹所有 NoctisNode 套餐都含 IPv6;优先使用它而不是只隧道化 IPv4 流量。