日本 VPS 部署 sing-box 全记录:VLESS + Reality 三协议一次配好

约 6 分钟
VPSsing-box代理
日本 VPS 部署 sing-box 全记录:VLESS + Reality 三协议一次配好

背景

旧的新加坡 NAT 小鸡抖动严重,网页终端都经常断,于是换了一台 VMISS 大阪 IIJ 线路的 VPS(1GB 内存 / 10GB 硬盘,Debian 12)。这篇记录从零开始的完整部署过程。

安装 sing-box 1.14.1

# 下载官方 release(以 linux amd64 为例)
curl -Lo sing-box.tar.gz https://github.com/SagerNet/sing-box/releases/download/v1.14.1/sing-box-1.14.1-linux-amd64.tar.gz
tar xzf sing-box.tar.gz
install -m 755 sing-box-1.14.1-linux-amd64/sing-box /usr/local/bin/sing-box

三协议配置

配置文件放在 /etc/s-box/config.json,三个 inbound 共存:

  • VLESS + Reality:监听 443/tcp。Reality 不需要域名和证书,steal oneself 指向一个高可信目标即可,客户端指纹用 chrome。
  • Hysteria2:监听 443/udp,自签证书即可,适合弱网环境。
  • VMess + WS:监听 8080/tcp,path 设一个随机字符串,备用。
{
  "inbounds": [
    {
      "type": "vless",
      "listen": "0.0.0.0",
      "listen_port": 443,
      "users": [{ "uuid": "<你的UUID>", "flow": "xtls-rprx-vision" }],
      "tls": {
        "enabled": true,
        "server_name": "www.microsoft.com",
        "reality": {
          "enabled": true,
          "handshake": { "server": "www.microsoft.com", "server_port": 443 },
          "private_key": "<reality私钥>",
          "short_id": ["<short-id>"]
        }
      }
    }
  ]
}

注意:flow 用 xtls-rprx-vision,旧的 xtls-rtt-0 在新版本行为有变化,建议直接写 vision。

密钥生成:

sing-box generate uuid
sing-box generate reality-keypair

BBR 与开机自启

# 开启 BBR(Debian 12 内核一般自带)
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p
sysctl net.ipv4.tcp_congestion_control  # 确认输出 bbr

systemd 服务:

[Unit]
Description=sing-box
After=network.target

[Service]
ExecStart=/usr/local/bin/sing-box run -c /etc/s-box/config.json
Restart=always

[Install]
WantedBy=multi-user.target
systemctl enable --now sing-box

订阅服务

用一个极简的 HTTP 服务把三个节点的订阅拼成一份,监听 8888 端口,路径用 48 位随机 token(例如 /sub/<随机串>),避免被扫到。客户端导入一个链接即可拿到全部节点。

实测结果

  • 经节点出口 IP 即 VPS 本机 IP
  • Google 连通性 204 正常,Gemini 200 正常
  • chatgpt.com 返回 403(换 Chrome UA 也一样),疑似该 IP 段被 OpenAI 限制
  • 用户实际体感延迟 80–90ms,比旧新加坡节点快且稳

小结

Reality 省去了证书的麻烦,是目前个人自用最省心的方案;Hysteria2 作为 UDP 补充;VMess+WS 留作备用。三协议共存互不干扰,一份订阅全搞定。