静看光阴荏苒
不管不顾不问不说也不念

使用V2Ray拯救被TCP阻断的小鸡

在V2Ray内,QUIC和KCP都是基于UDP的,使用V2Ray的这两种方式可以把被TCP阻断的小鸡复活。个人建议使用KCP,QUIC目前连接不稳定,并且有严重的QoS。

我有一台阿里云的轻量香港,前段时间就被TCP阻断了:

食之无味,弃之可惜的一台小鸡。。。现在用V2Ray拯救一下吧。。。

更新系统:

yum -y update

一键安装V2Ray:

bash <(curl -L -s https://install.direct/go.sh)

清空V2Ray的默认配置文件:

echo "" > /etc/v2ray/config.json

生成一个UUID:

cat /proc/sys/kernel/random/uuid

这里先尝试部署基于QUIC的连接方式:

vi /etc/v2ray/config.json

写入:

{
  "inbounds": [
    {
      "port": 10086,
      "protocol": "vmess",
      "settings": {
        "clients": [
          {
            "id": "你之前生成的UUID",
            "alterId": 64
          }
        ]
      },
      "streamSettings": {
        "network": "quic",
        "quicSettings": {
          "security": "chacha20-poly1305",
          "key": "随便设置一个值",
          "header": {
            "type": "wechat-video"
          }
        }
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {}
    }
  ]
}

完成之后启动服务端:

systemctl start v2ray

客户端的配置信息:

{
  "inbounds": [
    {
      "port": 1080,
      "listen": "127.0.0.1",
      "protocol": "socks",
      "settings": {
        "auth": "noauth"
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "你的服务器公网IP",
            "port": 10086,
            "users": [
              {
                "id": "你之前生成的UUID",
                "alterId": 64
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "network": "quic",
        "quicSettings": {
          "security": "chacha20-poly1305",
          "key": "和服务端设置的值要相同",
          "header": {
            "type": "wechat-video"
          }
        }
      }
    }
  ]
}

可以把这个客户端配置信息保存到本地命名为xxxx.json,然后使用v2rayN的添加自定义服务器:

导入你的这个xxxx.json配置文件,然后使用v2rayN连接应该就能使用了。

下面是KCP的连接方式,这个其实我一年前就写过一篇文章了,只不过当时没用v2rayN这个可视化的Windows客户端,现在用v2rayN的话,客户端配置这里就可以方便很多。

直接贴服务端的配置文件吧:

{
  "inbound": {
    "port": 10087,
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "你的UUID",
          "alterId": 64
        }
      ]
    },
    "streamSettings":{
      "network":"kcp",
      "kcpSettings": {
        "mtu": 1350,
        "tti": 20,
        "uplinkCapacity": 30,
        "downlinkCapacity": 100,
        "congestion": false,
        "readBufferSize": 1,
        "writeBufferSize": 1,
        "header": {
          "type": "none"
        }
      }
    }
  },
  "outbound": {
    "protocol": "freedom",
    "settings": {}
  }
}

如果你之前是配置的QUIC,现在换成了KCP,则需要把v2ray重启,让新的配置生效:

systemctl restart v2ray

然后客户端这里,我们直接通过v2rayN配置,按如图填写即可:

本文中两种配置方式用到的端口为10086/10087,如果正确配置后无法连接请检查防火墙的设置,想偷懒可以直接执行下面的命令关闭:

systemctl stop firewalld.service

如果是阿里云这类云服务商,还需要在相应的WEB后台放行端口。

如果在昨天那篇文章的基础上,把域名接入CDN,比如CloudFlare之类的,应该也可以让小鸡复活,不过我没有测试就是了。。。

赞(4)
未经允许不得转载:荒岛 » 使用V2Ray拯救被TCP阻断的小鸡
分享到: 更多 (0)

评论 11

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #1

    我就想问问,都被tcp阻断了,你这是咋配置的v2ray?

    不敢透漏姓名5年前 (2018-12-29) Google Chrome 71.0.3578.98 Google Chrome 71.0.3578.98 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 用另外一台没被墙的机器设置Xshell代理,然后连接上去配置啊。。。

      LALA5年前 (2018-12-29) Google Chrome 70.0.3538.110 Google Chrome 70.0.3538.110 Windows 10 x64 Edition Windows 10 x64 Edition回复
      • 而且很多都提供网页版shell的吧?

        TheEastWind5年前 (2018-12-30) Google Chrome 71.0.3578.80 Google Chrome 71.0.3578.80 Windows 10 x64 Edition Windows 10 x64 Edition回复
  2. #2

    emmmmmmm现在感觉V2Ray最大的阻碍是没有人做多用户

    北原かずさ5年前 (2018-12-30) Google Chrome 71.0.3578.99 Google Chrome 71.0.3578.99 Android 8.1.0 Android 8.1.0回复
  3. #3

    我觉得这个办法最大的问题在于,有些isp,没错点名中国癫信,经常会对udp限流。

    TheEastWind5年前 (2018-12-30) Google Chrome 71.0.3578.80 Google Chrome 71.0.3578.80 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • kcp可以愉快的玩耍,尝鲜quic不能。。我用quic看一个油管4k视频看了30s不到就被限速了。

      LALA5年前 (2018-12-30) Google Chrome 70.0.3538.110 Google Chrome 70.0.3538.110 Windows 10 x64 Edition Windows 10 x64 Edition回复
      • 没错,我就是中国奠信!

        LALA5年前 (2018-12-30) Google Chrome 70.0.3538.110 Google Chrome 70.0.3538.110 Windows 10 x64 Edition Windows 10 x64 Edition回复
  4. #4

    可以啊,我用了一键脚本,可是被阻断一个月不知道何时才能恢复,上个ssh都好麻烦

    我本楚狂人5年前 (2018-12-30) Google Chrome 70.0.3538.102 Google Chrome 70.0.3538.102 Windows 10 x64 Edition Windows 10 x64 Edition回复
  5. #5

    :razz: 你用之前有没有卸载监控的

    FATE命运5年前 (2019-03-24) Google Chrome 73.0.3683.86 Google Chrome 73.0.3683.86 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 没有,那个监控根本不会管这些,我几台李家破的都没卸载监控,安装了SSR都没事。

      LALA5年前 (2019-03-24) Google Chrome 72.0.3626.121 Google Chrome 72.0.3626.121 Windows 10 x64 Edition Windows 10 x64 Edition回复

分享创造快乐

广告合作资源投稿