Forev3rNAlway5
INTP / UvA / Accountancy
SJH.MOE
V2ray 之 路由实例0

遇到一个实际使用场景,VPS 分配有 IPv6,V2ray 的 freedom 出站协议会优先走 IPv6,谷歌等网站可能将 IPv6 识别为 machine 并触发 CAPTCHA 。这种情况就希望流量通过 IPv4 出口访问互联网,或是仅有部分 IPv6-ONLY 网站通过 IPv6 出口。此时可以通过 V2ray 的路由策略实现分流。

多Inbounds 对 多Outbounds

以下 V2ray 配置可实现 ipv4-in 进站的流量,通过 ipv4-out 出口; ipv6-in 进站流量通过 ipv6-out 出口。

配置 ipv4-out 中的 "sendThrough":"YOUR_LOCAL_IPV4_ADDR" 是实现 IPv4 ONLY 出口的关键配置。

{
  "inbounds": [
    {
      ...
      "tag": "ipv4-in"
    },
    {
      ...
      "tag": "ipv6-in"
    }
  ],
  "routing":{
    "rules":[
      {
        "type": "field",
        "inboundTag": "ipv4-in",
        "outboundTag": "ipv4-out"
      },
      {
        "type": "field",
        "inboundTag": "ipv6-in",
        "outboundTag": "ipv6-out"
      }
    ]
  },
  "outbounds": [
    {
      "tag": "ipv6-out",
      "protocol": "freedom",
      "settings": {}
    },
    {
      "tag": "ipv4-out",
      "sendThrough": "YOUR_LOCAL_IPV4_ADDR",
      "protocol": "freedom",
      "settings": {}
    }
  ]
}

在此配置下,ipv4-in 的入站流量,出站将仅通过 IPv4 地址出站。而 ipv6-in 的入站流量将优先通过 IPv6 地址出站。

IPv6-ONLY 网站分流

以下配置仅有一个 Inbound ,默认出口为 IPv4 地址,某些指定 IPv6-ONLY 域名将通过 IPv6 地址出站。

{
  "inbounds": [
    {
      ...
    }
  ],
  "routing":{
    "rules":[
      {
        "type": "field",
        "domain": [
          "bt.byr.cn"
        ],
        "outboundTag": "ipv6-out"
      }
    ]
  },
  "outbounds": [
    {
      "tag":"ipv4-out",
      "sendThrough": "YOUR_LOCAL_IPV4_ADDR",
      "protocol": "freedom",
      "settings": {}
    },
    {
      "tag":"ipv6-out",
      "protocol": "freedom",
      "settings":{}
    }
  ]
}
赞赏
本文链接:https://sjh.moe/tutorial/2041
本文采用 CC BY-NC-SA 4.0 协议进行许可
首页      教程      V2ray 之 路由实例0

发表评论

textsms
account_circle
email

  • Absolutely stimulating points you have remarked, thanks a lot for publishing. Emmy Hersch Dyanna

    3周前 回复
  • If you want to use the photo it would also be good to check with the artist beforehand in case it is subject to copyright. Best wishes. Aaren Reggis Sela

    3周前 回复
  • If you want to use the photo it would also be good to check with the artist beforehand in case it is subject to copyright. Best wishes. Aaren Reggis Sela

    3周前 回复
  • You made a number of nice points there. I did a search on the matter and found the majority of persons will go along with with your blog. Aleece Paten Lantz

    3周前 回复
  • You made some nice points there. I looked on the internet for the subject matter and found most individuals will agree with your site.

    2周前 回复
  • Hello! I could have sworn I’ve been to this blog before but after browsing through some of the post I realized it’s new to me. Anyways, I’m definitely happy I found it and I’ll be book-marking and checking back frequently!

    2周前 回复
  • Hello! I could have sworn I’ve been to this blog before but after browsing through some of the post I realized it’s new to me. Anyways, I’m definitely happy I found it and I’ll be book-marking and checking back frequently!

    2周前 回复
  • Hello! I could have sworn I’ve been to this blog before but after browsing through some of the post I realized it’s new to me. Anyways, I’m definitely happy I found it and I’ll be book-marking and checking back frequently!

    2周前 回复
  • You made some nice points there. I looked on the internet for the subject matter and found most individuals will agree with your site.

    2周前 回复
  • Hello! I could have sworn I’ve been to this blog before but after browsing through some of the post I realized it’s new to me. Anyways, I’m definitely happy I found it and I’ll be book-marking and checking back frequently!

    2周前 回复
  • Hello! I could have sworn I’ve been to this blog before but after browsing through some of the post I realized it’s new to me. Anyways, I’m definitely happy I found it and I’ll be book-marking and checking back frequently!

    2周前 回复
  • Hello! I could have sworn I’ve been to this blog before but after browsing through some of the post I realized it’s new to me. Anyways, I’m definitely happy I found it and I’ll be book-marking and checking back frequently!

    1周前 回复
  • You made some nice points there. I looked on the internet for the subject matter and found most individuals will agree with your site.

    2天前 回复
  • You made some nice points there. I looked on the internet for the subject matter and found most individuals will agree with your site.

    10小时前 回复
  • Hello! I could have sworn I’ve been to this blog before but after browsing through some of the post I realized it’s new to me. Anyways, I’m definitely happy I found it and I’ll be book-marking and checking back frequently!

    2小时前 回复

SJH.MOE

V2ray 之 路由实例0
本文介绍使用 V2ray 路由策略解决 IPv6 出站问题。
扫描二维码继续阅读
2020-06-01