前提

  1. 去商家后台查看vps是否已经附带ipv6的地址
  2. 在控制台使用ping -6 netflix.com 或ping -6 google.com查看ipv6是否通,如下图所示

    (通)


    (不通)

  3. 如果测试ipv6是通的,使用脚本bash <(curl -sSL "https://github.com/CoiaPrant/MediaUnlock_Test/raw/main/check.sh")(https://www.pai.ma/archives/308)检测ipv6是否支持解锁netflix,因为ipv6用的人少,并且地址多,所有netflix暂时屏蔽的并不多。测试通过就可以进行下面的步骤了。

使用本地vps的ipv6观看netflix

  1. 首先找到配置文件。如果是使用一键脚本的,看下脚本的文档,一般生成的配置文件的路径都会说明,如果没有可以使用whereis v2ray命令来查找。

    (config.json为配置文件)
  2. 使用ftp工具下载config.js配置文件并使用富文本编辑器(vscode等)打开进行编辑(也可以使用vim或者nano直接更改,建议还是下载到本地再更改)
//注释 这是原config
{
  "log": {
    "access": "/var/log/v2ray/access.log",
    "error": "/var/log/v2ray/error.log",
    "loglevel": "info"
  },
  "inbounds": [
    {
      "port": 11063,
      "protocol": "vmess",
      "settings": {
        "clients": [
          {
            "alterId": 0,
            "id": "22ca19ba-8c84-11eb-a094-00163e58b244"
          }
        ]
      },
      "streamSettings": {
        "network": "kcp",
        "security": "none",
        "tlsSettings": {},
        "tcpSettings": {},
        "httpSettings": {},
        "kcpSettings": {
          "mtu": 1350,
          "tti": 50,
          "uplinkCapacity": 100,
          "downlinkCapacity": 100,
          "congestion": false,
          "readBufferSize": 2,
          "writeBufferSize": 2,
          "header": {
            "type": "dtls"
          }
        },
        "wsSettings": {},
        "quicSettings": {}
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {}
    },
    {
      "protocol": "blackhole",
      "settings": {},
      "tag": "blocked"
    }
  ],
  "routing": {
    "rules": [
      {
        "type": "field",
        "ip": [
          "0.0.0.0/8",
          "10.0.0.0/8",
          "100.64.0.0/10",
          "169.254.0.0/16",
          "172.16.0.0/12",
          "192.0.0.0/24",
          "192.0.2.0/24",
          "192.168.0.0/16",
          "198.18.0.0/15",
          "198.51.100.0/24",
          "203.0.113.0/24",
          "::1/128",
          "fc00::/7",
          "fe80::/10"
        ],
        "outboundTag": "blocked"
      }
    ]
  }
}

下面是更改后的配置文件,主要是:
– 在inbounds入口文件中增加了sniffing字段(主要是嗅探作用,如果嗅探出了流量是哪种(http、tls、bt),就会标记一下协议,如果还配置了destOverride并且与嗅探出的协议匹配的话,就会把outbound target的address设置成域名或者IP。)
– outbounds出口分成了两个标签一个是IP6_out一个是IP4_out
– routing中增加了两个规则 其中”outboundTag”: “IP6_out”这个规则中domain字段中的参数为[“geosite:netflix”],这个参数的值代表的其实就是domain-list-community/netflix at master · v2ray/domain-list-community (github.com)中的域名列表。

{
  "log": {
    "access": "/var/log/v2ray/access.log",
    "error": "/var/log/v2ray/error.log",
    "loglevel": "info"
  },
  "inbounds": [
    {
      "port": 11063,
      "protocol": "vmess",
      "settings": {
        "clients": [
          {
            "alterId": 0,
            "id": "22ca19ba-8c84-11eb-a094-00163e58b244"
          }
        ]
      },
      "streamSettings": {
        "network": "kcp",
        "security": "none",
        "tlsSettings": {},
        "tcpSettings": {},
        "httpSettings": {},
        "kcpSettings": {
          "mtu": 1350,
          "tti": 50,
          "uplinkCapacity": 100,
          "downlinkCapacity": 100,
          "congestion": false,
          "readBufferSize": 2,
          "writeBufferSize": 2,
          "header": {
            "type": "dtls"
          }
        },
        "wsSettings": {},
        "quicSettings": {}
      },
      "sniffing": {
        "enabled": true, //一定要开启 sniffing,V2Ray 才能识别 Netflix 的流量
        "destOverride": [
          "http",
          "tls"
        ]
      }
    }
  ],
  "outbounds": [
    {
      "tag": "IP4_out",
      "protocol": "freedom",
      "settings": {}
    },
    {
      "tag": "IP6_out",
      "protocol": "freedom",
      "settings": {
        "domainStrategy": "UseIPv6" // 指定使用 IPv6
      }
    },
    {
      "protocol": "blackhole",
      "settings": {},
      "tag": "blocked"
    }
  ],
  "routing": {
    "rules": [
      {
        "type": "field",
        "outboundTag": "IP6_out",
        "domain": [
          "geosite:netflix"
        ] // netflix 走 IPv6
      },
      {
        "type": "field",
        "outboundTag": "IP4_out",
        "network": "udp,tcp" // 其余走 IPv4
      },
      {
        "type": "field",
        "ip": [
          "0.0.0.0/8",
          "10.0.0.0/8",
          "100.64.0.0/10",
          "169.254.0.0/16",
          "172.16.0.0/12",
          "192.0.0.0/24",
          "192.0.2.0/24",
          "192.168.0.0/16",
          "198.18.0.0/15",
          "198.51.100.0/24",
          "203.0.113.0/24",
          "::1/128",
          "fc00::/7",
          "fe80::/10"
        ],
        "outboundTag": "blocked"
      }
    ]
  }
}

  1. 上传config.json并覆盖原来配置文件(在覆盖之前最好备份下原来的配置文件),然后重启v2。注意上传之前一定要把“//以及后面的注释文字全部删除”
    然后就能愉快的观看netflix了

使用vps的ipv6通过dns解锁netflix

后续更新