购买搬瓦工 VPS

  • 官网: https://bandwagonhost.com
  • 推荐套餐: 选择最便宜的 KVM 架构套餐(如 $19.99/年),确保支持自定义系统。
  • 服务器位置: 优先选择美国西海岸(如洛杉矶)或日本节点,延迟较低。

初始化 VPS 设置

  • 系统安装: 在搬瓦工后台选择 CentOS 7/8Debian 10/11(推荐)。
  • SSH 连接: 使用 root 账户登录:
    ssh root@your_server_ip

    (密码或密钥在搬瓦工后台获取)


一键安装 VPN(推荐脚本)

选项1: WireGuard(速度快,现代协议)

wget https://git.io/wireguard -O wireguard-install.sh && bash wireguard-install.sh

按提示操作,脚本会自动生成客户端配置(保存在 /root/wg0-client.conf)。

选项2: Shadowsocks(简单易用)

wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubiBackup/doubi/master/ss-go.sh && chmod +x ss-go.sh && ./ss-go.sh

按提示设置端口和密码,支持 AEAD加密(如 aes-256-gcm)。


客户端配置

  • WireGuard:

    • 下载客户端:Windows / Android
    • 导入生成的 .conf 文件即可连接。
  • Shadowsocks:

    • 下载客户端:Windows / Android
    • 填写服务器 IP、端口、密码和加密方式。

防火墙设置(关键步骤)

确保放行 VPN 端口(如 WireGuard 默认 51820,Shadowsocks 自定义端口):

ufw allow 51820/udp  # WireGuardufw allow your_ss_port  # Shadowsocks

测速与优化

  • BBR 加速: 提升 TCP 速度:
    echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
    echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
    sysctl -p
  • 测试延迟和速度:
    ping your_server_ip
    wget -O- https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3

注意事项

  • IP 被墙: 如遇封锁,可在搬瓦工后台更换服务器 IP(可能需要付费)。
  • 备份配置: 定期导出客户端配置文件,防止丢失。
  • 安全性: 避免使用默认端口,定期更新密码。

如需更详细的教程或故障排查,可参考搬瓦工官方文档或社区论坛(如 LowEndTalk)。

或

扫码下载轻舟VPN

扫码下载轻舟VPN

137-6924-5183
扫码下载轻舟VPN

扫码下载轻舟VPN