V2ray-core: ipv4优先问题

Created on 6 Dec 2016  ·  5Comments  ·  Source: v2ray/v2ray-core

提交 Issue 之前请先阅读 Issue 指引,然后回答下面的问题,谢谢。
Please answer the following questions before submitting your issue. Thank you.

1) 你正在使用哪个版本的 V2Ray?(如果服务器和客户端使用了不同版本,请注明)
1) What version of V2Ray are you using?
v2.9

2) 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。
2) What your scenario of using V2Ray? E.g., Watching YouTube videos in Chrome via Socks/VMess proxy.
使用 Chrome 通过 VMess 代理访问google。

3) 你看到的不正常的现象是什么?
3) What did you see?
基本每天第一次访问google都会要求输入验证码,有时候一天不止一次。网上查了应该是使用ipv6访问的问题,google屏蔽了好多。vps设置了ipv4优先,使用vps浏览器直接访问确实走ipv4,但本地使用vmess代理访问还是默认走ipv6。但还是有需求访问一部分纯ipv6网站,比如北邮人BT,所以禁用ipv6这个不太好。不知道是否有办法设置使用ipv4优先。
1206

4) 你期待看到的正确表现是怎样的?
4) What do you expected to see instead?
希望可以设置ipv4优先。

5) 请附上你的配置文件。
5) Please attach your configuration file.

Most helpful comment

尝试了下这样配置可以,有需要可以作为参考,sendThrough 填写主机 IPv4 地址

{
  "inbounds": [
    // your inbouds config
  ],
  "routing": {
    "rules": [
      {
        "type": "field",
        "domain": [
          "domain:google.com"
        ],
        "outboundTag": "ipv4"
      }
    ]
  },
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {}
    },
    {
      "tag": "ipv4",
      "sendThrough": "your ip",
      "protocol": "freedom",
      "settings": {}
    }
  ]
}

All 5 comments

v2ray 的 outbound 有一个 sendThrough,设置为 ipv4 的地址就可以了。至于部分网站需要走 ipv6,你可以另外配置一个 sendThrough 为 ipv6 的 outbound,配合路由使用。

暂时不考虑增加 IPv4 优先的选项。如有需求可以使用上述的 sendThrough 来指定本机的 IPv4 地址。

尝试了下这样配置可以,有需要可以作为参考,sendThrough 填写主机 IPv4 地址

{
  "inbounds": [
    // your inbouds config
  ],
  "routing": {
    "rules": [
      {
        "type": "field",
        "domain": [
          "domain:google.com"
        ],
        "outboundTag": "ipv4"
      }
    ]
  },
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {}
    },
    {
      "tag": "ipv4",
      "sendThrough": "your ip",
      "protocol": "freedom",
      "settings": {}
    }
  ]
}
  {
    "type": "field",
    "domain": [
      "domain:google.com"
    ],
    "outboundTag": "ipv4"
  }

有用,非常感谢!!!!

大厂的云服务器的 sendThrough 可能要设成内网 ip 。但配置 sendThrough 后一些网站,例如 google drive 可以感觉到明显变慢,不知道是什么原因导致。

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cnperi picture cnperi  ·  4Comments

ghost picture ghost  ·  4Comments

FTAndy picture FTAndy  ·  4Comments

TheWanderingCoel picture TheWanderingCoel  ·  3Comments

nielspeen picture nielspeen  ·  4Comments