【ns内板留档】【教程】CNFaster 多地区v6出站使用教程(Sing-Box) 

koaker 发布于 19 天前 转载


【教程】CNFaster 多地区v6出站使用教程(Sing-Box)  1

Eric4

Eric4楼主

1h 3min ago in 内版

#0

写在前面

教程开始之前先吐槽一下,Sing-Box真是几把事儿稠,每次更新都要弃用东西
本教程按照书写时最新的 Sing-Box Beta 版本1.12.0-rc.3所需的最新格式书写,完全没有弃用的配置项,放心食用
因为用的是Beta版本,所以目前部署的时候一定要注意安装Beta版
使用如下官方脚本安装最新Beta版本:
curl -fsSL https://sing-box.app/install.sh | sh -s -- --beta

配置文件本体

{
    "log": {
        "disabled": false,
        "level": "info",
        "output": "box.log",
        "timestamp": true
    },
    "dns": {
        "servers": [
            {
                "tag": "final",
                "type": "udp",
                "server": "8.8.8.8"
            }
        ]
    },
    "ntp": {
        "enabled": false,
        "server": "time.apple.com",
        "server_port": 123,
        "interval": "30m"
    },
    "inbounds": [
        {
            "type": "vless",
            "tag": "vless-in",
            "listen": "0.0.0.0",  //监听地址,可以自己换成 :: 来监听v6
            "listen_port": 50000,  //监听端口,可以自己选喜欢的
            "users": [
                {
                    "name": "your-username-here",  //任意用户名
                    "uuid": "youre-uuid-here",  //任意uuid,可以使用 cat /proc/sys/kernel/random/uuid 生成
                    "flow": "xtls-rprx-vision"
                }
            ],
            "tls": {
                "enabled": true,
                "server_name": "domain-to-rip-here",  //要“偷”的网站
                "reality": {
                    "enabled": true,
                    "handshake": {
                        "server": "domain-to-rip-here", //要“偷”的网站
                        "server_port": 443
                    },
                    "private_key": "your-reality-private-key-here",  //Reality私钥,注意服务端用私钥客户端用公钥,使用sing-box generate reality-keypair生成
                    "short_id": [
                        "your-short-id-here"  //Short-ID, 使用openssl rand -hex 8生成
                    ]
                }
            }
        }
    ],
    "outbounds": [
        {
            "type": "direct",
            "tag": "v4-out",
            "inet4_bind_address": "your-cnf-v4-addr", //小鸡的v4地址
            "domain_resolver": {
                "server": "final",
                "strategy": "ipv4_only"
              }
        },
        {
            "type": "direct",
            "tag": "sg-out",
            "inet6_bind_address": "sg-v6-addr(2a0f)",  //新加坡v6地址(2a0f开头)
            "domain_resolver": {
                "server": "final",
                "strategy": "ipv6_only"
              }
        },
        {
            "type": "direct",
            "tag": "cn-out",
            "inet6_bind_address": "cn-v6-addr(2401)",  //大陆v6地址(2401开头)
            "domain_resolver": {
                "server": "final",
                "strategy": "ipv6_only"
              }
        },
        {
            "type": "direct",
            "tag": "us-out",
            "inet6_bind_address": "us-v6-addr(2406)",  //美国v6地址(2406开头)
            "domain_resolver": {
                "server": "final",
                "strategy": "ipv6_only"
              }
        },
        {
            "type": "direct",
            "tag": "hk-out",
            "inet6_bind_address": "us-v6-addr(2001)",  //香港v6地址(2001开头)
            "domain_resolver": {
                "server": "final",
                "strategy": "ipv6_only"
              }
        }
    ],
    "route": {
        "rule_set": [
            {
                "type": "remote",
                "tag": "YouTube",
                "format": "binary",
                "url": "https://cdn.jsdelivr.net/gh/senshinya/singbox_ruleset@main/rule/YouTube/YouTube.srs",
            },
            {
                "type": "remote",
                "tag": "Netflix",
                "format": "binary",
                "url": "https://cdn.jsdelivr.net/gh/senshinya/singbox_ruleset@main/rule/Netflix/Netflix.srs",
            },
            {
                "type": "remote",
                "tag": "OpenAI",
                "format": "binary",
                "url": "https://cdn.jsdelivr.net/gh/senshinya/singbox_ruleset@main/rule/OpenAI/OpenAI.srs",
            }
        ],
		/* 这里因为新版Sing-Box不再允许Geosite,因此使用规则集,来自隔壁Linux.do大佬 @shinya,参见https://linux.do/t/topic/188781,你可以自行添加其他站点或规则 */
        "rules": [
            {
                "rule_set": [
                    "YouTube"
                ],
                "action": "route",
                "outbound": "cn-out"
            },
            {
                "rule_set": [
                    "Netflix"
                ],
                "action": "route",
                "outbound": "sg-out"
            },
            {
                "rule_set": [
                    "OpenAI"
                ],
                "action": "route",
                "outbound": "us-out"
            }
			/* 路由规则也可以自己写更多,如果tag书写规范的话这部分很好理解,不需要解释 */


        ]
    }
}

结语

码字不易,Sing-Box文档看的我头大,希望帮到大家!最好能请我吃鸡腿啦! ac01

此作者没有提供个人介绍。
最后更新于 2025-07-29