搭建 – sing-box tuic
安装
ARCH=$(dpkg --print-architecture)
VERSION=$(curl -fsSL https://api.github.com/repos/SagerNet/sing-box/releases/latest | grep tag_name | cut -d '"' -f 4 | sed 's/v//')
wget -O /tmp/sing-box.deb "https://github.com/SagerNet/sing-box/releases/download/v${VERSION}/sing-box_${VERSION}_linux_${ARCH}.deb"
dpkg -i /tmp/sing-box.deb
sing-box version
开启 BBR 加速
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
生成自签名 TLS 证书
mkdir -p /etc/sing-box/cert
openssl ecparam -genkey -name prime256v1 -out /etc/sing-box/cert/private.key
openssl req -new -x509 -days 36500 -key /etc/sing-box/cert/private.key -out /etc/sing-box/cert/cert.pem -subj "/CN=www.bing.com"
chown -R sing-box:sing-box /etc/sing-box/cert
生成节点密码
openssl rand -base64 16
生成 UUID(推荐使用 sing-box 命令)
sing-box generate uuid
写入 sing-box 配置文件
cat > /etc/sing-box/config.json <<'EOF'
{
"log": {
"level": "warn",
"timestamp": true
},
"inbounds": [
{
"type": "tuic",
"tag": "tuic-in",
"listen": "::",
"listen_port": 33443,
"users": [
{
"uuid": "06c3548a-7acc-4000-aa4b-51b0b8162ded",
"password": "A123bing123A"
}
],
"congestion_control": "bbr",
"zero_rtt_handshake": false,
"tls": {
"enabled": true,
"server_name": "www.bing.com", // 与证书 CN 一致
"certificate_path": "/etc/sing-box/cert/cert.pem",
"key_path": "/etc/sing-box/cert/private.key",
"alpn": ["h3"]
}
}
],
"outbounds": [
{
"type": "direct",
"tag": "direct"
}
]
}
配置说明:
- 端口 33443 可以改成其他值(建议 10000-65535 之间的随机数)
- masquerade 是伪装地址,外人探测时会看到 Bing 首页
- listen: “::” 表示同时监听 IPv4 和 IPv6
使用
sing-box check -c /etc/sing-box/config.json
systemctl enable --now sing-box
systemctl status sing-box
systemctl restart sing-box
ss -ulnp | grep 33443
配置客户端
按你的实际信息拼接这个链接(密码里的 + 要编码成 %2B,= 要编码成 %3D):
tuic://06c3548a-7acc-4000-aa4b-51b0b8162ded%[email protected]:33443?sni=bing.com&alpn=h3&insecure=1&allowInsecure=1&congestion_control=bbr#normal-tuic
📌 版权声明
文章作者:大神K
原文链接:https://dashenk.com/2026/05/09/%e6%90%ad%e5%bb%ba-sing-box-tuic/
版权说明:本文为原创内容,转载请注明出处。