某云服

1、手动安装v2

1⃣️一键安装v2脚本

bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)

2⃣️编辑config.json文件

config.json文件位置/usr/local/etc/v2ray/config.json

vi /usr/local/etc/v2ray/config.json

修改为以下内容

{
  "log": {
    "access": "",
    "error": "",
    "loglevel": "warning"
  },
  "inbounds": [
    {
      "port": 60502,
      "protocol": "vmess",
      "settings": {
        "udp": false,
        "clients": [
          {
            "id": "3eb73338-1118-4ba9-8542-9ef6c63045dd",
            "alterId": 0
          }
        ],
        "allowTransparent": false
      },
      "streamSettings": {
        "network": "tcp"
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom"
    },
    {
      "tag": "block",
      "protocol": "blackhole",
      "settings": {}
    }
  ],
  "routing": {
    "domainStrategy": "IPIfNonMatch",
    "rules": []
  }
}

3⃣️启动脚本

systemctl start v2ray

4⃣️相关报错修复

原因为客户端和服务端时间差距太大,导致连接报错
VMess MD5 认证信息 污染机制,VMess 的淘汰机制在搞鬼。

报错信息如下:

rejected  common/drain: common/drain: drained connection > proxy/vmess/encoding: invalid user: 
VMessAEAD is enforced and a non VMessAEAD connection is received. You can still disable this 
security feature with environment variable v?ray.vmess.aead.forced = false . You will not be able 
to enable legacy header workaround in the future.

查看路径

systemctl cat v2ray

打开需要修改的文件

vi  /etc/systemd/system/v2ray.service

鼠标光标移动到 [service] 区域中,在ExecStart=...上面,插入一行后保存退出

Environment="V2RAY_VMESS_AEAD_FORCED=false"

更新重启

systemctl daemon-reload
systemctl restart v2ray

5⃣️注脚

留作备份

installed: /usr/local/bin/varay
installed: /usr/local/share/v2ray/geoip.dat
installed: /usr/local/share/v2ray/geosite.dat
installed: /usr/local/etc/v2ray/config.json
installed: /var/log/v2ray/
installed: /var/log/v2ray/access.log
installed: /var/log/v2ray/error.log
installed: /etc/systemd/system/v2ray.service
installed: /etc/systemd/system/v2ray@.service
removed: /tmp/tmp.YMYuJztdgv
info: V2Ray v5.3.0 is installed.
you may need to execute a command to remove dependent software: yum remove curl
unzip
please execute the command: systemctl enable v2ray; systemctl start v2ray

6⃣️开启ipv4转发

修改/etc/sysctl.conf,添加以下内容

net.ipv4.ip_forward = 1

重载

sysctl -p

7⃣️设置东京时间

cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime

2、一键脚本安装v2

依次执行以下脚本

wget https://git.io/v2ray.sh
chmod +x v2ray.sh
./v2ray.sh

接着按照提示进行操作,等待安装完成后输入执行v2ray即可

最后修改:2023 年 05 月 09 日
如果觉得我的文章对你有用,请随意赞赏