ougato Sharing changes the world

CentOS 7 搭建 V2Ray

2021-07-22
ougato
VPN

CentOS 7 搭建 V2Ray

环境

  版本 关联
CentOS 7 x86_64-DVD-2009 下载

安装

同步时间

# 安装服务
yum install -y ntpdate
# 设置时区
timedatectl set-timezone Asia/Shanghai
# 开始同步
ntpdate us.pool.ntp.org

开始安装

# 安装依赖
yum makecache
yum install curl
# 下载脚本
curl -O https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh
# 执行安装
bash install-release.sh

安装完成

# 开机启动
systemctl enable v2ray
# 启动运行
systemctl start v2ray

配置

# 生成 UUID
cat /proc/sys/kernel/random/uuid
# 配置文件
vi /usr/local/etc/v2ray/config.json
{
  "inbounds": [
    {
      "port": 1080,
      "protocol": "vmess",
      "settings": {
        "clients": [
          {
            // 改为上面生成的 UUID
            "id": "faabe58b-7ed5-4f7f-ba3a-bad10c1cb08b",
            "alterId": 64
          }
        ]
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {}
    }
  ]
}
# 重新启动
systemctl restart v2ray

服务商开启入站端口规则

Name Security group rule ID IP version Type Protocol Port range Source Description
sgr-03675f4757067aee3 IPv4 自定义 TCP 1080 0.0.0.0/0 -
sgr-0677b7e838128802f IPv6 自定义 TCP 1080 ::/0 -

Similar Posts

上一篇 开启 SSH 服务

Comments