Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows服务中如果打开route and remote access服务后,direct流量必回环,请问改如何避免? #2045

Open
4 of 5 tasks
dowson521 opened this issue Aug 19, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@dowson521
Copy link

dowson521 commented Aug 19, 2024

Operating system

Windows

System version

win10

Installation type

Original sing-box Command Line

If you are using a graphical client, please provide the version of the client.

No response

Version

ANY VERSION

Description

windows服务中如果打开route and remote access服务后,direct流量必回环,导致网络故障,必现。
这个问题和ISSUE中#1862 这个问题应该是一个原因。

configure

{
    "log": {
        "level": "info",
        "timestamp": true
    },
    "dns": {
        "servers": [
            {
                "tag": "dns_proxy",
                "address": "https://1.1.1.1/dns-query",
                "address_resolver": "dns_resolver",
                "strategy": "ipv4_only",
                "detour": "proxy"
            },
            {
                "tag": "dns_direct",
                "address": "114.114.114.114",
                "strategy": "ipv4_only",
                "detour": "direct"
            },
            {
                "tag": "dns_resolver",
                "address": "223.5.5.5",
                "detour": "direct"
            }
        ],
        "rules": [
            {
                "outbound": "any",
                "server": "dns_resolver"
            },
            {
                "rule_set": "geosite-geolocation-!cn",
                "server": "dns_proxy"
            }
        ],
        "final": "dns_direct",
        "independent_cache": true
    },
    "inbounds": [
        {
            "type": "tun",
            "tag": "tun-in",
            "inet4_address": "172.16.0.1/30",
            "mtu": 1492,
            "auto_route": true,
            "strict_route": false,
            "stack": "mixed",
            "sniff": true,
            "sniff_override_destination": false
        }
    ],
    "outbounds": [
        {
            "type": "shadowsocks",
            "tag": "proxy",
            "server": "xxxxx",
            "server_port": xxxx,
            "method": "xxxx",
            "password": "xxxxxx"
        },
        {
            "type": "direct",
            "tag": "direct"
        },
        {
            "type": "block",
            "tag": "block"
        },
        {
            "type": "dns",
            "tag": "dns-out"
        }
    ],
    "route": {
        "rule_set": [
            {
                "tag": "geosite-geolocation-!cn",
                "type": "remote",
                "format": "binary",
                "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-!cn.srs",
                "download_detour": "proxy"
            },
            {
                "tag": "geoip-cn",
                "type": "remote",
                "format": "binary",
                "url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs",
                "download_detour": "proxy"
            }
        ],
        "rules": [
            {
                "protocol": "dns",
                "outbound": "dns-out"
            },
            {
                "domain_suffix": [
                    "google.com",
                    "ip138.com",
                    "youtube.com"
                ],
                "outbound": "proxy"
            }
        ],
        "final": "direct",
        "auto_detect_interface": true
    },
    "experimental": {
        "cache_file": {
            "enabled": true,
            "path": "cache.db"
        }
    }
}

Reproduction

windows services-->open routing and remote access

Logs



+0800 2024-08-19 16:59:29 INFO dns: exchanged ipv6.msftconnecttest.com CNAME ncsiv6-geo.trafficmanager.net. 629 IN CNAME ipv6.msftconnecttest.com.edgesuite.net.
+0800 2024-08-19 16:59:29 ERROR [3718642045 0ms] inbound/tun[tun-in]: reject loopback connection to 8.133.123.144:443
+0800 2024-08-19 16:59:29 ERROR [3078433648 0ms] inbound/tun[tun-in]: reject loopback connection to 180.97.248.248:443
+0800 2024-08-19 16:59:29 INFO dns: exchanged ipv6.msftconnecttest.com CNAME ipv6.msftconnecttest.com.edgesuite.net. 629 IN CNAME a1968.i6g1.akamai.net.
+0800 2024-08-19 16:59:29 INFO [127338946 0ms] inbound/tun[tun-in]: inbound connection from 172.16.0.1:54873
+0800 2024-08-19 16:59:29 INFO [127338946 0ms] inbound/tun[tun-in]: inbound connection to 23.32.77.192:443
+0800 2024-08-19 16:59:29 INFO [127338946 0ms] outbound/direct[direct]: outbound connection to 23.32.77.192:443
+0800 2024-08-19 16:59:29 INFO [3050243563 0ms] inbound/tun[tun-in]: inbound connection from 10.128.0.54:54874
+0800 2024-08-19 16:59:29 INFO [3050243563 0ms] inbound/tun[tun-in]: inbound connection to 23.32.77.192:443
+0800 2024-08-19 16:59:29 ERROR [3050243563 0ms] inbound/tun[tun-in]: reject loopback connection to 23.32.77.192:443
+0800 2024-08-19 16:59:29 ERROR [127338946 1ms] inbound/tun[tun-in]: download: raw-read tcp 10.128.0.54:54874->23.32.77.192:443: An existing connection was forcibly closed by the remote host.
+0800 2024-08-19 16:59:29 INFO [181301483 0ms] inbound/tun[tun-in]: inbound connection from 172.16.0.1:49433
+0800 2024-08-19 16:59:29 INFO [181301483 0ms] inbound/tun[tun-in]: inbound connection to 127.0.0.1:53
+0800 2024-08-19 16:59:29 INFO [1009160200 0ms] inbound/tun[tun-in]: inbound connection from 172.16.0.1:49434
+0800 2024-08-19 16:59:29 INFO [1009160200 0ms] inbound/tun[tun-in]: inbound connection to 23.32.77.192:443
+0800 2024-08-19 16:59:29 INFO [1009160200 0ms] outbound/direct[direct]: outbound connection to 23.32.77.192:443
+0800 2024-08-19 16:59:29 INFO [4084934090 0ms] inbound/tun[tun-in]: inbound connection from 10.128.0.54:49435
+0800 2024-08-19 16:59:29 INFO [4084934090 0ms] inbound/tun[tun-in]: inbound connection to 23.32.77.192:443
+0800 2024-08-19 16:59:29 ERROR [4084934090 0ms] inbound/tun[tun-in]: reject loopback connection to 23.32.77.192:443
+0800 2024-08-19 16:59:29 INFO [3222831514 0ms] inbound/tun[tun-in]: inbound connection from 172.16.0.1:49436
+0800 2024-08-19 16:59:29 INFO [3222831514 0ms] inbound/tun[tun-in]: inbound connection to 23.32.77.192:443
+0800 2024-08-19 16:59:29 INFO [3222831514 0ms] outbound/direct[direct]: outbound connection to 23.32.77.192:443
+0800 2024-08-19 16:59:29 INFO [814068155 0ms] inbound/tun[tun-in]: inbound connection from 10.128.0.54:49437
+0800 2024-08-19 16:59:29 INFO [814068155 0ms] inbound/tun[tun-in]: inbound connection to 23.32.77.192:443
+0800 2024-08-19 16:59:29 ERROR [814068155 0ms] inbound/tun[tun-in]: reject loopback connection to 23.32.77.192:443
+0800 2024-08-19 16:59:29 ERROR [3222831514 0ms] inbound/tun[tun-in]: download: raw-read tcp 10.128.0.54:49437->23.32.77.192:443: An existing connection was forcibly closed by the remote host.
+0800 2024-08-19 16:59:29 INFO [342429805 0ms] inbound/tun[tun-in]: inbound connection from 172.16.0.1:49438
+0800 2024-08-19 16:59:29 INFO [342429805 0ms] inbound/tun[tun-in]: inbound connection to 222.186.18.237:443
+0800 2024-08-19 16:59:29 INFO [342429805 0ms] outbound/direct[direct]: outbound connection to 222.186.18.237:443
+0800 2024-08-19 16:59:29 INFO [4007022258 0ms] inbound/tun[tun-in]: inbound connection from 10.128.0.54:49439
+0800 2024-08-19 16:59:29 INFO [4007022258 0ms] inbound/tun[tun-in]: inbound connection to 222.186.18.237:443
+0800 2024-08-19 16:59:29 ERROR [4007022258 0ms] inbound/tun[tun-in]: reject loopback connection to 222.186.18.237:443
+0800 2024-08-19 16:59:29 INFO [3555102357 0ms] inbound/tun[tun-in]: inbound connection from 172.16.0.1:49440
+0800 2024-08-19 16:59:29 INFO [3555102357 0ms] inbound/tun[tun-in]: inbound connection to 222.186.18.237:443
+0800 2024-08-19 16:59:29 INFO [3555102357 0ms] outbound/direct[direct]: outbound connection to 222.186.18.237:443
+0800 2024-08-19 16:59:29 INFO [2182450629 0ms] inbound/tun[tun-in]: inbound connection from 10.128.0.54:49441
+0800 2024-08-19 16:59:29 INFO [2182450629 0ms] inbound/tun[tun-in]: inbound connection to 222.186.18.237:443
+0800 2024-08-19 16:59:29 ERROR [2182450629 1ms] inbound/tun[tun-in]: reject loopback connection to 222.186.18.237:443
+0800 2024-08-19 16:59:29 INFO [3105615670 0ms] inbound/tun[tun-in]: inbound connection from 172.16.0.1:49442
+0800 2024-08-19 16:59:29 INFO [3105615670 0ms] inbound/tun[tun-in]: inbound connection to 222.186.18.237:443
+0800 2024-08-19 16:59:29 INFO [3105615670 1ms] outbound/direct[direct]: outbound connection to 222.186.18.237:443
+0800 2024-08-19 16:59:29 INFO [3589490769 0ms] inbound/tun[tun-in]: inbound connection from 10.128.0.54:49443
+0800 2024-08-19 16:59:29 INFO [3589490769 0ms] inbound/tun[tun-in]: inbound connection to 222.186.18.237:443
+0800 2024-08-19 16:59:29 ERROR [3589490769 0ms] inbound/tun[tun-in]: reject loopback connection to 222.186.18.237:443
+0800 2024-08-19 16:59:29 INFO [3781120808 0ms] inbound/tun[tun-in]: inbound connection from 172.16.0.1:49444
+0800 2024-08-19 16:59:29 INFO [3781120808 0ms] inbound/tun[tun-in]: inbound connection to 222.186.18.237:443
+0800 2024-08-19 16:59:29 INFO [3781120808 0ms] outbound/direct[direct]: outbound connection to 222.186.18.237:443
+0800 2024-08-19 16:59:29 INFO [4081469977 0ms] inbound/tun[tun-in]: inbound connection from 10.128.0.54:49445
+0800 2024-08-19 16:59:29 INFO [4081469977 0ms] inbound/tun[tun-in]: inbound connection to 222.186.18.237:443
+0800 2024-08-19 16:59:29 ERROR [4081469977 0ms] inbound/tun[tun-in]: reject loopback connection to 222.186.18.237:443
+0800 2024-08-19 16:59:29 INFO [1940015788 0ms] inbound/tun[tun-in]: inbound packet connection from 10.128.0.54:50027
+0800 2024-08-19 16:59:29 INFO [1940015788 0ms] inbound/tun[tun-in]: inbound packet connection to 106.38.222.156:443
+0800 2024-08-19 16:59:29 INFO [1940015788 0ms] outbound/direct[direct]: outbound packet connection
+0800 2024-08-19 16:59:29 INFO [2131930697 0ms] inbound/tun[tun-in]: inbound packet connection from 10.128.0.54:53391
+0800 2024-08-19 16:59:29 INFO [2131930697 0ms] inbound/tun[tun-in]: inbound packet connection to 106.38.222.156:443
+0800 2024-08-19 16:59:29 INFO [2131930697 0ms] outbound/direct[direct]: outbound packet connection
+0800 2024-08-19 16:59:29 INFO [2686623243 0ms] inbound/tun[tun-in]: inbound packet connection from 10.128.0.54:52371
+0800 2024-08-19 16:59:29 INFO [2686623243 0ms] inbound/tun[tun-in]: inbound packet connection to 8.0.0.0:27036
+0800 2024-08-19 16:59:29 INFO [2686623243 0ms] outbound/direct[direct]: outbound packet connection
+0800 2024-08-19 16:59:29 INFO [3876022638 0ms] inbound/tun[tun-in]: inbound packet connection from 10.128.0.54:53392
+0800 2024-08-19 16:59:29 INFO [3876022638 0ms] inbound/tun[tun-in]: inbound packet connection to 106.38.222.156:443
+0800 2024-08-19 16:59:29 INFO [3876022638 0ms] outbound/direct[direct]: outbound packet connection
+0800 2024-08-19 16:59:29 INFO [1562022914 0ms] inbound/tun[tun-in]: inbound connection from 10.128.0.54:62904
+0800 2024-08-19 16:59:29 INFO [1562022914 0ms] inbound/tun[tun-in]: inbound connection to 127.0.0.1:53
+0800 2024-08-19 16:59:29 INFO [1562022914 74ms] outbound/direct[direct]: outbound connection to 127.0.0.1:53


Supporter

Integrity requirements

  • I confirm that I have read the documentation, understand the meaning of all the configuration items I wrote, and did not pile up seemingly useful options or default values.
  • I confirm that I have provided the server and client configuration files and process that can be reproduced locally, instead of a complicated client configuration file that has been stripped of sensitive data.
  • I confirm that I have provided the simplest configuration that can be used to reproduce the error I reported, instead of depending on remote servers, TUN, graphical interface clients, or other closed-source software.
  • I confirm that I have provided the complete configuration files and logs, rather than just providing parts I think are useful out of confidence in my own intelligence.
@dyhkwong
Copy link
Contributor

多个虚拟网卡共存通常需要自行配置路由表,可能还需要手动指定出口网卡,不是 auto_routeauto_detect_interface 负责解决的问题。

@dowson521
Copy link
Author

dowson521 commented Aug 19, 2024

多个虚拟网卡共存通常需要自行配置路由表,可能还需要手动指定出口网卡,不是 auto_routeauto_detect_interface 负责解决的问题。

好的,感谢回复。打开这个服务后是多了一个叫“传入的连接”这个设备。
1724065008419_d

删掉它就好了。
请问有没有什么方式指定所有direct的出口,目前看起来让所有direct流量通过bind_interface指定默认物理网卡,也不生效。

Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days

@github-actions github-actions bot added the Stale label Oct 19, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2024
@nekohasekai nekohasekai reopened this Oct 24, 2024
@nekohasekai nekohasekai added bug Something isn't working and removed Stale labels Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants