安装v2sora@y

1. 安装cerbot

1.1) 服务器应具有的环境

$ yum -y install yum-utils
$ yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional

1.2) 针对nginx环境

yum install certbot python2-certbot-nginx

1.3) 装插件

```shell
sudo certbot --nginx

1. 下载脚本

wget https://install.direct/go.sh

2. 执行脚本

bash go.sh

此脚本会自动安装如下文件

/usr/bin/v2r@y/v2r@y:v2r@y 程序;
/usr/bin/v2r@y/v2ctl:v2r@y 工具;
/etc/v2r@y/config.json:配置文件;
/usr/bin/v2r@y/geoip.dat:IP 数据文件
/usr/bin/v2r@y/geosite.dat:域名数据文件 此脚本会配置自动运行脚本。自动运行脚本会在系统重启之后,自动运行 v2r@y。目前自动运行脚本只支持带有 Systemd 的系统,以及 Debian / Ubuntu 全系列。

3. 启动

service v2@ray start|stop|status|reload|restart|force-reload

4. 开放端口

system-cmd --zone=public --add-port=xxx/tcp

5. 服务端配置文件

/etc/v2@ray/config.json

更改配置文件

{
  "log" : {
    "access": "/var/log/v2r@y/access.log",
    "error": "/var/log/v2r@y/error.log",
    "loglevel": "warning"
  },
  "inbound": {
    "port": 10000, //(此端口与nginx配置相关)
    "listen": "127.0.0.1",
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "461aad1f-687c-4188-9abc-80073a618ca3", //你的UUID, 此ID需与客户端保持一致
          "level": 1,
          "alterId": 64 //此ID也需与客户端保持一致
        }
      ]
    },
   "streamSettings":{
      "network": "ws",
      "wsSettings": {
           "path": "/ray" //与nginx配置相关
      }
   }
  },
  "outbound": {
    "protocol": "freedom",
    "settings": {}
  },
  "outboundDetour": [
    {
      "protocol": "blackhole",
      "settings": {},
      "tag": "blocked"
    }
  ],
  "routing": {
    "strategy": "rules",
    "settings": {
      "rules": [
        {
          "type": "field",
          "ip": [
            "0.0.0.0/8",
            "10.0.0.0/8",
            "100.64.0.0/10",
            "127.0.0.0/8",
            "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"
        }
      ]
    }
  }
}

6. 客户端配置文件

{
  "log": {
    "loglevel": "warning"
  },
  "inbound": {
    "port": 1080,
    "listen": "127.0.0.1",
    "protocol": "socks",
    "settings": {
      "auth": "noauth",
      "udp": false
    }
  },
  "inboundDetour": [
    {
        "port": 8123,
        "listen": "127.0.0.1",
        "protocol": "http",
        "settings": {}
    }
  ],
  "outbound": {
    "protocol": "vmess",
    "settings": {
      "vnext": [{
        "address": "[email protected]", // 服务器地址,请修改为你自己的服务器 ip 或域名
        "port": 443,  // 服务器端口
        "users": [{ 
            "id": "461aad1f-687c-4188-9abc-80073a618ca3", //你的UUID, 此ID需与服务端保持一致
            "level": 1,
            "alterId": 64,  //此ID也需与客户端保持一致
            "security": "aes-128-gcm"
        }]
      }]
    },
    "streamSettings":{
        "network": "ws",
        "security": "tls",
        "tlsSettings": {
            "serverName": "[email protected]" //此域名是你服务器的域名
        },
        "wsSettings": {
            "path": "/ray" //与服务器配置及nginx配置相关
        }
    },
    "tag": "forgin"
  },
  "outboundDetour": [
    {
        "protocol": "freedom",
        "settings": {},
        "tag": "direct"
    }
  ],
  "routing": { //此路由配置是自动分流, 国内IP和网站直连
    "strategy": "rules",
    "settings": {
        "domainStrategy": "IPIfNonMatch",
        "rules": [
            {
                "type": "chinaip",
                "outboundTag": "direct"
            },
            {
                "type": "chinasites",
                "outboundTag": "direct"
            },
            {
                "type": "field",
                "ip": [
                    "0.0.0.0/8",
                    "10.0.0.0/8",
                    "100.64.0.0/10",
                    "127.0.0.0/8",
                    "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": "direct"
            }
        ]
    }
  },
  "policy": {
    "levels": {
      "0": {"uplinkOnly": 0}
    }
  }
}

猜你喜欢

转载自www.cnblogs.com/wenbronk/p/11016816.html
y