v2ray搭建

系统+安全 Liemer_Lius 84℃

安装:

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

启动和停止:

# 启动
sudo systemctl start v2ray
# 停止
sudo systemctl stop v2ray
# 重启
sudo systemctl restart v2ray

生成UUID:

cat /proc/sys/kernel/random/uuid

配置文件:/usr/local/etc/v2ray/config.json

{
  "inbounds": [{
    "port": 20001, # 端口,自定义,主要放开安全组策略
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "b72dc422-5813-4a98-98fc-e14c3e9904d8",  # 生成的UUID
          "level": 1,
          "alterId": 64    # 另一个参数
     }
      ]
    }
  }],
  "outbounds": [{
    "protocol": "freedom",
    "settings": {}
  },{
    "protocol": "blackhole",
    "settings": {},
    "tag": "blocked"
  }],
  "routing": {
    "rules": [
      {
        "type": "field",
        "ip": ["geoip:private"],
        "outboundTag": "blocked"
      }
    ]
  }
}

客户端:

 Windows:
下载v2ray-windows-64.zip和v2rayN.zip文件
https://github.com/v2fly/v2ray-core/releases/download/v4.31.0/v2ray-windows-64.zip
https://github.com/2dust/v2rayN/releases/download/3.29/v2rayN.zip
将v2rayN.zip的内容,拷贝到v2ray-windows-64.zip解压后的目录做一下集合。
点击v2rayN.exe打开即可。
Android: https://github.com/2dust/v2rayNG/releases/download/1.4.13/v2rayNG_1.4.13_arm64-v8a.apk

地址:搭建v2ray的主机公网ip

port:config.json中定义的端口

用户ID:config.json中定义的ID,也就是我们之前生成的UUID

额外ID:和config.json中定义的要保持一致

别名:方便存储的一个server的配置别名

其他地方默认即可,启动v2ray,保证安全组放通的情况下,启动并测试一下即可。

 

转载请注明:skelchina.com » v2ray搭建

喜欢 (3)