文章

Hysteria 2

Hysteria 2

Oracle Cloud 部署 Hysteria 2 完整指南

🛠️ 前置准备

  1. 域名: 一个一级域名(如 yingjie.lol),为新服务器分配一个子域名(如 us.yingjie.lol)。
  2. DNS 解析: 将子域名 A 记录解析到新服务器 IP。
    • 注意: 如果用 Cloudflare,必须关闭小黄云 (设为 DNS Only / 灰色云朵)。
  3. 权限: 拥有服务器 root 权限。

第二步:安装服务端

SSH 登录服务器(推荐使用 root 用户),执行官方一键脚本:

1
2
bash <(curl -fsSL https://get.hy2.sh/)

第四步:放行系统内部防火墙

即便 Oracle 网页开了防火墙,服务器系统内部通常默认也是关的。根据你的系统执行:

方案 A:如果你是 Ubuntu (UFW)

1
2
3
4
5
ufw allow 80/tcp
ufw allow 443/udp
ufw allow 443/tcp
ufw reload

方案 B:如果你是 Oracle Linux / CentOS (Firewalld)

1
2
3
4
5
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=443/udp --permanent
firewall-cmd --zone=public --add-port=443/tcp --permanent
firewall-cmd --reload

方案 C:暴力清除所有规则 (仅限纯净系统,最省事)

1
2
3
4
5
6
7
8
9
# 警告:这会清空所有 iptables 规则,确保你没做特殊的转发配置
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F
iptables -X
# 重新加载 ufw 规则
ufw reload

第六步:客户端配置

📱 iOS Shadowrocket (小火箭)

  • 类型: Hysteria2
  • 地址: us.yingjie.lol (你的新域名)
  • 端口: 443
  • 密码: (你的密码)
  • SNI: us.yingjie.lol (必填)
  • Allow Insecure: 关闭 (我们有正规证书)
  • Fast Open: 打开

💻 Windows Clash Verge Rev (Meta内核)

在配置文件 proxies: 下添加:

1
2
3
4
5
6
7
8
9
10
11
proxies:
  - name: "Oracle-US-Hy2"
    type: hysteria2
    server: us.yingjie.lol      # 【修改】
    port: 443
    password: "你的密码"        # 【修改】
    sni: us.yingjie.lol         # 【修改】
    skip-cert-verify: false
    up: "150 Mbps"
    down: "300 Mbps"


💡 多服务器管理小技巧

  • 域名复用:不用买新域名,继续用你的 yingjie.lol
  • 新加坡服务器用 sg.yingjie.lol
  • 美国服务器用 us.yingjie.lol
  • 日本服务器用 jp.yingjie.lol

  • 端口跳跃 (防封):如果某个 IP 被封了,不需要重装。
    1. Oracle 后台放行 UDP 20000-50000
    2. 服务端 Config 加一行 ignoreClientBandwidth: false
    3. 客户端端口改为 20000-50000
本文由作者按照 CC BY 4.0 进行授权