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

路由规则无法匹配DNS解析后的IPV4地址 #720

Closed
4 tasks done
CC-3301 opened this issue Jul 18, 2023 · 3 comments
Closed
4 tasks done

路由规则无法匹配DNS解析后的IPV4地址 #720

CC-3301 opened this issue Jul 18, 2023 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@CC-3301
Copy link

CC-3301 commented Jul 18, 2023

Welcome

  • Yes, I'm using the latest major release. Only such installations are supported.
  • Yes, I'm using the latest Golang release. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, FULL config, FULL log, etc).

Description of the problem

请教一下,我所写的配置只能匹配纯IPV4连接(例如Telegram),对于不包含IPV4地址的域名(例如github.com)无法连接,不知是否是我的配置有问题

Version of sing-box

sing-box version 1.3.0

Environment: go1.20.6 linux/amd64
Tags: with_wireguard
CGO: enabled

Server and client configuration file

{
    "log": {
        "disabled": false,
        "level": "debug",
        "output": "/var/log/sing-box/box.log",
        "timestamp": true
    },
    "dns": {
        "servers": [
            {
                "tag": "cloudflare-dns",
                "address": "2606:4700:4700::1111",
                "strategy": "prefer_ipv6"
            }
        ]
    },
    "inbounds": [
        {
            "listen": "::",
            "listen_port": 25555,
            "sniff": true,
            "sniff_override_destination": true,
            "type": "shadowsocks",
            "tag": "shadowsocks-in",
            "method": "2022-blake3-aes-128-gcm",
            "password": "脱敏"
        }
    ],
    "outbounds": [
        {
            "type": "direct",
            "tag": "direct",
            "domain_strategy": "prefer_ipv6"
        },
        {
            "type": "wireguard",
            "tag": "warp",
            "server": "2606:4700:d0::a29f:c001",
            "server_port": 2408,
            "local_address": "2606:4700:110:8269:6d39:ad94:f14d:bcb5/128",
            "private_key": "脱敏",
            "peer_public_key": "bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=",
            "reserved": [0, 0, 0],
            "mtu": 1280
        },
        {
            "type": "dns",
            "tag": "dns-out"
        }
    ],
    "route": {
        "rules": [
            {
                "ip_version": 4,
                "outbound": "warp"
            },
            {
                "ip_version": 6,
                "outbound": "direct"
            },
            {
                "protocol": "dns",
                "outbound": "dns-out"
            }
        ]
    }
}

Server and client log file

+0800 2023-07-18 13:05:47 DEBUG [2344156227 47.80s] dns: lookup domain api.termius.com
+0800 2023-07-18 13:05:47 DEBUG [2344156227 47.80s] dns: lookup succeed for api.termius.com: 54.176.238.224 54.193.238.191
+0800 2023-07-18 13:05:47 ERROR [2344156227 47.80s] router: dial tcp 54.176.238.224:443: connect: network is unreachable | dial tcp 54.193.238.191:443: connect: network is unreachable

+0800 2023-07-18 13:08:13 INFO [747368681 1.88s] router: inbound multiplex connection to 91.108.56.156:443
+0800 2023-07-18 13:08:13 DEBUG [747368681 1.88s] router: match[0] ip_version=4 => warp
+0800 2023-07-18 13:08:13 INFO [747368681 1.88s] outbound/wireguard[warp]: outbound connection to 91.108.56.156:443

@CC-3301
Copy link
Author

CC-3301 commented Jul 18, 2023

补充:VPS只拥有IPV6地址

@CC-3301
Copy link
Author

CC-3301 commented Jul 18, 2023

预期效果:IPV6连接走直连,IPV4连接走Cloudflare-Warp

@nekohasekai
Copy link
Member

#694 (comment)

@nekohasekai nekohasekai closed this as not planned Won't fix, can't repro, duplicate, stale Jul 18, 2023
@nekohasekai nekohasekai added the duplicate This issue or pull request already exists label Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants