mobile wallpaper 1mobile wallpaper 2mobile wallpaper 3mobile wallpaper 4mobile wallpaper 5mobile wallpaper 6
1000 字
3 分钟
NAT机器搭建节点(Alpine)
2026-06-11

协议选择:VLESS + Vision + REALITY#

REALITY 借用别人的合规证书(如微软、索尼),你不需要自己花钱买域名、更不用折腾配置证书自动续期。

Vision 流控可以实现“流式过滤”,遇到本来就加密的 HTTPS 流量直接放行(Splice 技术),不占用 VPS 的 CPU 去二次加密,延迟极低,看 4K/8K 视频和下载非常爽。

xtls-rprx-vision: 拥有独创的流式控制机制。它能智能识别出流量中原本就已经加密过的部分(比如你正在浏览一个 HTTPS 网站,流量本身就是加密的),然后直接放行,不再重复加密。这样既隐藏了代理特征,又保证了接近原生的跑满带宽速度,延迟极低。


自建 Vless+vision+Reality 一键部署脚本#

Vless+vision+Reality 协议一键部署脚本(Alpine)#

bash <(wget -qO- https://raw.githubusercontent.com/xhpx7301/vvr/main/install-xray-reality-alpine.sh)

Vless+vision+Reality 协议一键部署脚本(Alpine-64MB版本)#

bash <(wget -qO- https://raw.githubusercontent.com/xhpx7301/vvr/main/install-xray-reality-alpine-64mb.sh)

Vless+vision+Reality 协议一键部署脚本(Debian)#

sh -c "$(wget -qO- https://raw.githubusercontent.com/xhpx7301/vvr/main/install-xray-reality-debian.sh)"

Sing-box 多协议一键部署脚本#

Sing-box 多协议一键部署脚本

bash -c "$(curl -fsSL https://raw.githubusercontent.com/caigouzi121380/singbox-deploy/main/install-singbox-yyds.sh)"

手动搭建(Alpine)#

一、系统环境准备#

确认系统架构

uname -m

输出架构
x86_64AMD64
aarch64ARM64
armv7lARMv7/

二、安装必要工具#

安装 sudo 和 bash :

apk update && apk add sudo bash

Alpine 安装基础工具( bash sudo curl wget nano htop unzip git ):

apk update && apk add bash sudo curl wget nano htop unzip git

安装网络管理工具包 iproute2(遇到错误-ash: ss: not found)

apk add iproute2

三、下载 Xray#

1.进入临时目录:

2.1下载最新版(ARM64):

wget https://github.com/XTLS/Xray-core/releases/latest/download/Xray-linux-arm64-v8a.zip

2.2下载最新版(AMD64):

wget https://github.com/XTLS/Xray-core/releases/latest/download/Xray-linux-64.zip

3.1解压(ARM64):

unzip Xray-linux-arm64-v8a.zip

3.2解压(AMD64):

unzip Xray-linux-64.zip

4.创建目录:

mkdir -p /usr/local/xray

将当前目录下的 xray 文件复制到 /usr/local/xray/ 文件夹中(无效则先进入文件夹再执行,使用下面的方法)

cp xray /usr/local/xray/

进入Xray-linux-arm64-v8a文件夹后再执行上面的命令:

cd /root/Xray-linux-arm64-v8a

四、生成 Reality 所需参数#

1.赋予执行权限:

chmod +x /usr/local/xray/xray

2.终端随机生成并打印一个标准的 UUID:

/usr/local/xray/xray uuid

3.为 Xray 的 XTLS Vision / Reality 协议生成一对全新的加密密钥(包含一个私钥和一个公钥):

/usr/local/xray/xray x25519

4.利用 OpenSSL 工具生成并打印一串随机的、长度为 16 位的十六进制(Hex)字符串(用来进行客户端的临时身份验证,防止服务器被恶意探测)(shortId):

openssl rand -hex 8

5.选择伪装网站

www.sony.com

五、Alpine 配置文件#

1.创建目录:

mkdir -p /etc/xray

2.创建配置:

nano /etc/xray/config.json

3.填入:

{
"log": {
"loglevel": "warning"
},
"inbounds": [
{
"port": 443,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "你的UUID",
"flow": "xtls-rprx-vision"
}
],
"decryption": "none"
},
"streamSettings": {
"network": "tcp",
"security": "reality",
"realitySettings": {
"dest": "www.microsoft.com:443",
"serverNames": [
"www.microsoft.com"
],
"privateKey": "你的PrivateKey",
"shortIds": [
"你的ShortID"
]
}
}
}
],
"outbounds": [
{
"protocol": "freedom"
}
]
}

4.测试配置

配置写好后先不要启动服务:

/usr/local/xray/xray run -test -config /etc/xray/config.json

如果显示:“Configuration OK.”说明配置正确。


六、Alpine 开机启动(OpenRC)#

1.创建服务文件:

nano /etc/init.d/xray

2.填入内容:

#!/sbin/openrc-run
name="xray"
command="/usr/local/xray/xray"
command_args="run -config /etc/xray/config.json"
pidfile="/run/xray.pid"
command_background="yes"

3.赋予执行权限:

chmod +x /etc/init.d/xray

4.加入开机启动:

rc-update add xray default

5.启动:

rc-service xray start

启动出现格式错误执行:

cat << 'EOF' > /etc/init.d/xray
#!/sbin/openrc-run
name="xray"
description="Xray Service"
command="/usr/local/xray/xray"
command_args="run -config /etc/xray/config.json"
pidfile="/run/xray.pid"
command_background="yes"
depend() {
need net
}
EOF

6.停止:

rc-service xray stop

7.重启:

rc-service xray restart

8.查看状态:

rc-service xray status

查找Xray 进程

ps aux | grep xray

查看全部监听端口

ss -tlnp

通过使用假证书在 NAT 机器实现 3X-UI 面板安装与访问#

3X-UI 面板安装#

创建假证书:

mkdir -p /root/cert && openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /root/cert/private.key -out /root/cert/public.crt -subj “/C=CN/ST=GD/L=SZ/O=Acme/OU=Dev/CN=localhost”

假证书文件位置:

公钥:

/root/cert/public.crt

私钥

/root/cert/private.key

*安装3x-ui面板:

bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh)

通过搭建本地隧道实现 3X-UI 面板安装与访问#

本地电脑运行:

ssh -L <本地端口>:127.0.0.1:<远程面板端口> <服务器用户名>@<服务器IP>

例:

ssh -L 54321:127.0.0.1:55555 root@178.157.58.201

若 SSH 用非默认端口(如 2222),加 -p 2222:

ssh -fN -p 2222 -L <本地端口>:127.0.0.1:<远程面板端口> <服务器用户名>@<服务器IP>

例:

ssh -fN -p 2222 -L 54321:127.0.0.1:55555 root@178.157.58.201

订阅链接转换#

字段对照表

占位符JSON 配置路径示例
{id}settings.id443f6c38-05fc-4d93-a5d4-a34c2e569d16
{address}settings.address193.227.109.23
{port}settings.port21037
{network}streamSettings.networktcp
{encryption}settings.encryptionnone
{security}streamSettings.securityreality
{publicKey}realitySettings.publicKeyn8CR7PcXBtxuq2t9ZjAe16cVvSihSZm61H9g-HgEkVI
{fingerprint}realitySettings.fingerprintchrome
{serverName}realitySettings.serverNamewww.apple.com
{shortId}realitySettings.shortId43fe9a
{spiderX}realitySettings.spiderX(需 URL 编码)/%2F
{tag}tagvless-pvo159zu

vless://________@________:____?type=____&encryption=____&security=____&pbk=________&fp=____&sni=________&sid=____&spx=____#________

填写示例

vless://443f6c38-05fc-4d93-a5d4-a34c2e569d16@193.227.109.23:21037?type=tcp&encryption=none&security=reality&pbk=n8CR7PcXBtxuq2t9ZjAe16cVvSihSZm61H9g-HgEkVI&fp=chrome&sni=www.apple.com&sid=43fe9a&spx=%2F#vless-pvo159zu

注意事项

  1. spiderX/ 时,链接里写 %2F(URL 编码)

  2. flow 为空时不需要加 flow 参数;若 flow 有值(如 xtls-rprx-vision),在 security 后追加 &flow=xtls-rprx-vision

  3. # 后面是节点名称,直接填 tag 的值,无需编码

分享

如果这篇文章对你有帮助,欢迎分享给更多人!

NAT机器搭建节点(Alpine)
bk90.333797.xyz
作者
瓶子
发布于
2026-06-11
许可协议
CC BY-NC-SA 4.0

部分信息可能已经过时