豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Routing module Bug: 路由功能无法分流ipv4 or ipv6 #5977

@cupidads

Description

@cupidads

完整性要求

  • 我读完了 issue 模板中的所有注释,确保填写符合要求。
  • 我保证阅读了文档,了解所有我编写的配置文件项的含义,而不是大量堆砌看似有用的选项或默认值。
  • 我提供了完整的配置文件和日志,而不是出于自己的判断只给出截取的部分。
  • 我搜索了 issues, 没有发现已提出的类似问题。
  • 问题在 Release 最新的版本上可以成功复现

描述

测试版本v26.4.17疑似路由功能有问题,无法匹配ipv4或ipv6出站,主版本v26.3.27相同的配置没有问题。

重现方式

路由匹配ip:
ip:["0.0.0.0/0"]
outboundTag: out-v4
ip:["::/0"]
outboundTag: out-v6

出站按顺序:

  1. out-v6
  2. out-v4

打开google等同时有v6v4的网站肯定没问题
问题出现在只有v4(X)或只有v6(ipv6.google.com)的网站
按上面的配置只能访问带有v6地址的网站,带v4的网站无法访问

这时把出站顺序改成:

  1. out-v4
  2. out-v6

或路由最后增加一条:
outboundTag: out-v4 or outboundTag: out-v6
"强制所有流量走"
反过来带v4的网站能正常访问,只带v6的网站无法访问

似乎是路由没匹配上ip直接走默认的第一个出站。

要么绑定0.0.0.0全交给网卡判断算了。

客户端配置

目前在服务端发现问题,没再更新部署到客户端测试

服务端配置

{
"vsersion": null,
"log": {
"loglevel": "none",
"dnsLog": true,
"maskAddress": ""
},
"dns": {
"hosts": {
"dns.google": [
"2001:4860:4860::8888",
"8.8.8.8"
],
"dns11.quad9.net": [
"2620:fe::11",
"9.9.9.11"
]
},
"servers": [
{
"tag": "fakedns",
"address": "fakedns",
"domains": [
"geosite:sogou",
"geosite:adblock",
"geosite:adblockplus",
"geosite:adguard",
"geosite:category-ads",
"geosite:category-ads-all",
"geosite:category-ads-ir"
],
"expectedIPs": null,
"unexpectedIPs": null,
"skipFallback": true,
"queryStrategy": "UseIP",
"timeoutMs": 5000,
"disableCache": false,
"finalQuery": false,
"serveStale": true,
"serveExpiredTTL": 86400
},
{
"tag": "google",
"address": "https://dns.google/dns-query",
"port": 443,
"expectedIPs": null,
"unexpectedIPs": null,
"skipFallback": true,
"queryStrategy": "UseIP",
"timeoutMs": 5000,
"disableCache": false,
"finalQuery": false,
"serveStale": true,
"serveExpiredTTL": 900
}
],
"queryStrategy": "UseIP",
"disableCache": false,
"disableFallback": false,
"disableFallbackIfMatch": false,
"useSystemHosts": false,
"serveStale": true,
"serveExpiredTTL": 900,
"enableParallelQuery": true,
"tag": "dns"
},
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"inboundTag": [
"fakedns"
],
"outboundTag": "drop",
"ruleTag": "reject-rule"
},
{
"inboundTag": [
"dns"
],
"outboundTag": "dns-direct",
"ruleTag": "all-out"
},
{
"inboundTag": [
"vless-reality-in2"
],
"domain": [
"geosite:google",
"geosite:google-registry",
"geosite:google-registry-tld",
"geosite:google-scholar",
"geosite:google-trust-services",
"geosite:googlefcm",
"geosite:google-play",
"geosite:google-gemini",
"geosite:google-deepmind",
"geosite:greatfire",
"geosite:bilibili-game",
"geosite:bilibili",
"geosite:bilibili2",
"geosite:github",
"geosite:x",
"geosite:telegram",
"geosite:twitter",
"geosite:steam",
"geosite:steamunlocked",
"geosite:youtube"
],
"ip": [
"::/0"
],
"outboundTag": "direct-out-ipv6",
"ruleTag": "all-out"
},
{
"inboundTag": [
"vless-reality-in2"
],
"domain": [
"geosite:google",
"geosite:google-registry",
"geosite:google-registry-tld",
"geosite:google-scholar",
"geosite:google-trust-services",
"geosite:googlefcm",
"geosite:google-play",
"geosite:google-gemini",
"geosite:google-deepmind",
"geosite:greatfire",
"geosite:bilibili-game",
"geosite:bilibili",
"geosite:bilibili2",
"geosite:github",
"geosite:x",
"geosite:telegram",
"geosite:twitter",
"geosite:steam",
"geosite:steamunlocked",
"geosite:youtube"
],
"ip": [
"0.0.0.0/0"
],
"outboundTag": "direct-out-ipv4",
"ruleTag": "all-out"
},
{
"domain": [
"geosite:sogou",
"geosite:adblock",
"geosite:adblockplus",
"geosite:adguard",
"geosite:category-ads",
"geosite:category-ads-all",
"geosite:category-ads-ir"
],
"inboundTag": [
"vless-reality-in2"
],
"outboundTag": "drop",
"ruleTag": "reject-rule"
},
{
"inboundTag": [
"vless-reality-in2"
],
"ip": [
"::/0"
],
"outboundTag": "direct-out-ipv6",
"ruleTag": "all-out"
},
{
"inboundTag": [
"vless-reality-in2"
],
"ip": [
"0.0.0.0/0"
],
"outboundTag": "direct-out-ipv4",
"ruleTag": "all-out"
}
],
"balancers": null
},
"policy": null,
"inbounds": [...],
"outbounds": [
{
"sendThrough": "123::123::",
"protocol": "freedom",
"settings": {
"domainStrategy": "ForceIPv6",
"redirect": null,
"userLevel": 0,
"proxyProtocol": 0
},
"tag": "direct-out-ipv6",
"streamSettings": {
"network": "raw",
"security": "none",
"rawSettings": null,
"sockopt": {
"tproxy": "off",
"domainStrategy": "ForceIPv6",
"happyEyeballs": null,
"dialerProxy": null,
"acceptProxyProtocol": false,
"tcpCongestion": "bbr",
"interface": "eth0",
"v6only": true
}
},
"mux": null,
"targetStrategy": "ForceIPv6"
},
{
"sendThrough": "3333.3333.3333.3333",
"protocol": "freedom",
"settings": {
"testpre": 5,
"domainStrategy": "ForceIPv4",
"redirect": null,
"userLevel": 0,
"proxyProtocol": 0
},
"tag": "direct-out-ipv4",
"streamSettings": {
"network": "raw",
"security": "none",
"rawSettings": null,
"sockopt": {
"tproxy": "off",
"domainStrategy": "ForceIPv4",
"dialerProxy": null,
"acceptProxyProtocol": false,
"tcpCongestion": "bbr",
"interface": "eth1",
"v6only": false
}
},
"mux": null,
"targetStrategy": "ForceIPv4"
},
{
"protocol": "blackhole",
"settings": {
"response": {
"type": "none"
}
},
"tag": "drop"
},
......
],
"fakedns": [...],
"api": null,
"transport": null,
"stats": null,
"reverse": null,
"metrics": null,
"observatory": null,
"burstObservatory": null
}

客户端日志

服务端日志

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions