v2fly / v2ray-core

A platform for building proxies to bypass network restrictions.
https://v2fly.org
MIT License
29.48k stars 4.66k forks source link

使用useipv4时依然会用ipv6地址进行连接 #482

Closed k79e closed 3 years ago

k79e commented 3 years ago

服务端版本4.33.0 ipv6.lookup.test-ipv6.com 这是纯ipv6地址 访问他 我这里出现的是5次重试 都是空域名 都是读缓存 但是第六次dial确直接用v6地址了

...
2020/12/02 15:38:15 [Info] [49101249] v2ray.com/core/proxy/freedom: failed to get IP address for domain ipv6.lookup.test-ipv6.com > empty response
2020/12/02 15:38:15 [Info] [49101249] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:ipv6.lookup.test-ipv6.com:80
2020/12/02 15:38:15 [Info] [49101249] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/freedom: connection ends > context canceled
...
2020/12/02 15:38:15 [Info] v2ray.com/core/app/dns: UDP:1.1.1.1:53 **cache HIT** ipv6.lookup.test-ipv6.com -> [] > empty response
2020/12/02 15:38:15 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain ipv6.lookup.test-ipv6.com at server UDP:1.1.1.1:53 > **empty response**
2020/12/02 15:38:15 [Info] [49101249] v2ray.com/core/proxy/freedom: **failed to get IP address for** domain ipv6.lookup.test-ipv6.com > empty response
2020/12/02 15:38:15 [Info] [49101249] v2ray.com/core/transport/internet/tcp: **dialing TCP to tcp**:ipv6.lookup.test-ipv6.com:80
2020/12/02 15:38:15 [Info] [49101249] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/freedom: failed to open connection to tcp:ipv6.lookup.test-ipv6.com:80 > v2ray.com/core/common/**retry**: [dial tcp [**2001:470:1:18::223:250**]:80: connect: network is unreachable dial tcp [2a00:dd80:3c::b3f]:80: connect: network is unreachable dial tcp [2001:470:1:18::223:250]:80: connect: network is unreachable dial tcp [2a00:dd80:3c::b3f]:80: connect: network is unreachable dial tcp [2001:470:1:18::223:250]:80: connect: network is unreachable] > v2ray.com/core/common/retry: all retry attempts failed
kslr commented 3 years ago

你的配置文件呢

k79e commented 3 years ago

这呢

{
  "log" : {
    "#access": "",
    "#error": "",
    "loglevel": "none"
  },
  "inbounds": [{
    "port": 877,
    "listen":"0.0.0.0",
    "protocol": "vless",
    "settings": {
      "clients": [
        {
          "id": "",
          "level": 0,
          "flow": "",
          "alterId": 32
        }
      ],
          "decryption": "none"
    },
    "streamSettings": {
        "network": "ws",
        #"security": "tls",
        "tlsSettings": {
        #"servername":"",
        #"disableSystemRoot":true,
        #"certificates": [ {
        #"usage": "encipherment",
        #"certificateFile": "",
        #"keyFile": ""       }]
},
        "quicsettings":{
        "security": "aes-128-gcm",
        "key": "1234",
        "header": {
    "type": "none" }
        },
        "wsSettings": {
        "path": "/addr" }
        }
  }
],

  "outbounds": [
  {
    "protocol": "freedom",
    "settings": {"domainStrategy": "useipv4"}
  }
],

"dns": {
     "servers": [
       "1.1.1.1"
     ]
   },

"policy":{
    "levels": {
        "0": {
            "handshake": 4,
            "connIdle": 300,
            "uplinkOnly": 0,
            "downlinkOnly": 0,
            "statsUserUplink": false,
            "statsUserDownlink": false,
            "bufferSize": 0
        }
    }
#    "system": {
#        "statsInboundUplink": false,
#        "statsInboundDownlink": false
#    }
},

"transport": {}

}
ghost commented 3 years ago

UseIPv4,大小写对了没

k79e commented 3 years ago

不分大小写吧 否则这网早废了

kslr commented 3 years ago

当然是分大小写的

k79e commented 3 years ago

怎么会这样. 如果分大小写他为什么开头还用v4连接了很多次. 那我大小写写错了他会默认跑到啥模式上? 我改回去 然后观察下看看

k79e commented 3 years ago

是这样 他最后还是显示了v6地址

2020/12/17 15:36:41 [Info] [1788899186] v2ray.com/core/common/mux: received request for tcp:ipv6.lookup.test-ipv6.com:80
2020/12/17 15:36:41 [Info] [1788899186] v2ray.com/core/app/dispatcher: default route for tcp:ipv6.lookup.test-ipv6.com:80
2020/12/17 15:36:41 tcp:139.219.0.215:0 accepted tcp:ipv6.lookup.test-ipv6.com:80 
2020/12/17 15:36:41 [Info] [1788899186] v2ray.com/core/proxy/freedom: opening connection to tcp:ipv6.lookup.test-ipv6.com:80
2020/12/17 15:36:41 [Info] v2ray.com/core/app/dns: UDP:1.1.1.1:53 cache HIT ipv6.lookup.test-ipv6.com -> [] > empty response
2020/12/17 15:36:41 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain ipv6.lookup.test-ipv6.com at server UDP:1.1.1.1:53 > empty response
2020/12/17 15:36:41 [Info] [1788899186] v2ray.com/core/proxy/freedom: failed to get IP address for domain ipv6.lookup.test-ipv6.com > empty response
2020/12/17 15:36:41 [Info] [1788899186] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:ipv6.lookup.test-ipv6.com:80
2020/12/17 15:36:41 [Info] v2ray.com/core/app/dns: UDP:1.1.1.1:53 cache HIT ipv6.lookup.test-ipv6.com -> [] > empty response
2020/12/17 15:36:41 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain ipv6.lookup.test-ipv6.com at server UDP:1.1.1.1:53 > empty response
2020/12/17 15:36:41 [Info] [1788899186] v2ray.com/core/proxy/freedom: failed to get IP address for domain ipv6.lookup.test-ipv6.com > empty response
2020/12/17 15:36:41 [Info] [1788899186] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:ipv6.lookup.test-ipv6.com:80
2020/12/17 15:36:42 [Info] v2ray.com/core/app/dns: UDP:1.1.1.1:53 cache HIT ipv6.lookup.test-ipv6.com -> [] > empty response
2020/12/17 15:36:42 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain ipv6.lookup.test-ipv6.com at server UDP:1.1.1.1:53 > empty response
2020/12/17 15:36:42 [Info] [1788899186] v2ray.com/core/proxy/freedom: failed to get IP address for domain ipv6.lookup.test-ipv6.com > empty response
2020/12/17 15:36:42 [Info] [1788899186] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:ipv6.lookup.test-ipv6.com:80
2020/12/17 15:36:42 [Info] v2ray.com/core/app/dns: UDP:1.1.1.1:53 cache HIT ipv6.lookup.test-ipv6.com -> [] > empty response
2020/12/17 15:36:42 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain ipv6.lookup.test-ipv6.com at server UDP:1.1.1.1:53 > empty response
2020/12/17 15:36:42 [Info] [1788899186] v2ray.com/core/proxy/freedom: failed to get IP address for domain ipv6.lookup.test-ipv6.com > empty response
2020/12/17 15:36:42 [Info] [1788899186] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:ipv6.lookup.test-ipv6.com:80
2020/12/17 15:36:42 [Info] v2ray.com/core/app/dns: UDP:1.1.1.1:53 cache HIT ipv6.lookup.test-ipv6.com -> [] > empty response
2020/12/17 15:36:42 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain ipv6.lookup.test-ipv6.com at server UDP:1.1.1.1:53 > empty response
2020/12/17 15:36:42 [Info] [1788899186] v2ray.com/core/proxy/freedom: failed to get IP address for domain ipv6.lookup.test-ipv6.com > empty response
2020/12/17 15:36:42 [Info] [1788899186] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:ipv6.lookup.test-ipv6.com:80
2020/12/17 15:36:42 [Info] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/freedom: connection ends > context canceled
2020/12/17 15:36:42 [Info] v2ray.com/core/transport/internet/udp: failed to handle UDP input > io: read/write on closed pipe
2020/12/17 15:36:42 [Info] [1788899186] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/freedom: failed to open connection to tcp:ipv6.lookup.test-ipv6.com:80 > v2ray.com/core/common/retry: [dial tcp [2001:470:1:18::223:250]:80: connect: network is unreachable dial tcp [2a00:dd80:3c::b3f]:80: connect: network is unreachable dial tcp [2001:470:1:18::223:250]:80: connect: network is unreachable dial tcp [2a00:dd80:3c::b3f]:80: connect: network is unreachable dial tcp [2001:470:1:18::223:250]:80: connect: network is unreachable] > v2ray.com/core/common/retry: all retry attempts failed
AkinoKaede commented 3 years ago

https://github.com/v2fly/v2ray-core/blob/ee673062afa52afdc181f49df7e86c4d1559641b/infra/conf/freedom.go#L24-L31
的确是不分大小写的,DNS App 部分重构了,现在再试试?

k79e commented 3 years ago

还是老样子 v4.34

Loyalsoldier commented 3 years ago

Fixed in #794