各们好,最近在折腾 sing-box 的全局代理,发现同样的配置在新装的虚拟机 win10 和另一台闲置的 win10 上都无问题。但是放到自己的两台电脑上就死活不通了;最后把配置简化到 tun 透传 direct ,也是同样的状况。折腾几天了,实在想不到什么问题了,有懂的人麻烦指点一二。
测试命令是 curl -v https://www.baidu.com , 症状是

* Host www.baidu.com:443 was resolved.
* IPv6: (none)
* IPv4: 180.101.49.44, 180.101.51.73
*   Trying 180.101.49.44:443...
* connect to 180.101.49.44 port 443 from 0.0.0.0 port 52489 failed: Timed out
*   Trying 180.101.51.73:443...
* connect to 180.101.51.73 port 443 from 0.0.0.0 port 58474 failed: Timed out
* Failed to connect to www.baidu.com port 443 after 42582 ms: Could not connect to server
* closing connection #0
curl: (28) Failed to connect to www.baidu.com port 443 after 42582 ms: Could not connect to server

以下是简化后在自己电脑上仍有问题的配置

{
    "log": {
        "disabled": false,
        "level": "trace",
        "timestamp": true,
        "output": ""
    },
    "inbounds": [{
            "type": "tun",
            "tag": "tun-in",
            "interface_name": "singbox-tun",
            "address": ["192.0.2.0/24"],
            "route_address": ["0.0.0.0/1", "128.0.0.0/1", "::/1", "8000::/1"],
            "route_exclude_address": [
                "10.0.0.0/8",
                "172.16.0.0/12",
                "192.168.0.0/16",
                "fc00::/7"
            ],
            "auto_route": true,
            "strict_route": false
        }, 
        {"tag": "dns-in","type": "direct","listen": "127.0.0.1","listen_port": 53}
    ],
    "outbounds": [
        {"type": "direct","tag": "direct"}, 
        {"type": "block","tag": "block"}
    ],
    "dns": {
        "strategy": "prefer_ipv4",
        "servers": [
            {"type": "local","tag": "local-dns"}, 
            {"type": "udp","tag": "cn-dns","server": "119.29.29.29"}
        ],
        "rules": [
            {"inbound": ["tun-in"],"server": "cn-dns"}
        ]
    },
    "route": {
        "auto_detect_interface": true,
        "default_domain_resolver": "local-dns",
        "final": "direct",
        "rules": [
            {"action": "sniff"}, 
            {"protocol": "dns","action": "hijack-dns"}, 
            {"ip_is_private": true,"outbound": "direct"}, 
            {"inbound": ["tun-in"],"outbound": "direct"}
        ]
    }
}

标签: none

添加新评论