Linux安装v2Ray
super
2021-02-03 12:16
![views](/static/super/images/icon/evaluate-9a.png)
以CentOS为例
修改权限:
su
1)安装unzip
yum install -y unzip zip
2)下载官方的安装脚本
# 官方脚本
wget https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh --user-agent="Mozilla/5.0"
如果报错 Unable to establish SSL connection. 安装openssl
yum install openssl
查看目录,install-release.sh为我们下载的安装脚本
ls
![](/uploads/article/20210203/c49d2df70c07f8865ec5cc2417386187.png)
3)执行安装脚本
bash install-release.sh
![](/uploads/article/20210203/eae75530c48ff6b3a118aa994889e60c.png)
4)开启v2ray
systemctl enable v2ray
systemctl start v2ray
systemctl status v2ray
绿色或者黄色小灯亮起(running)表示V2Ray已成功运行
![](/uploads/article/20210203/633ba8bc85f64d63d4b36d34872a4faf.png)
5)修改配置文件
vi /usr/local/etc/v2ray/config.json
基本配置如下:
{
"inbound": {
"port": 10086, //监听端口号,建议更改
"protocol": "vmess", //通信协议,建议vmess
"settings": {
"clients": [
{
"id": "54f0f20d-7ff9-4dbd-ada0-fa1e27622d85", // UUID识别码,建议使用V2Ray(客户端)重新生成
"level": 1,
"alterId": 64
}
]
}
},
"streamSettings": {
"network": "tcp"
},
"outbound": {
"protocol": "freedom",
"settings": {}
},
"outboundDetour": [
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}
]
}
6)重启v2ray
systemctl stop v2ray
systemctl start v2ray
7)使用v2rayN客户端测试连接
https://github.com/2dust/v2rayN/releases
https://github.com/2dust/v2rayN/releases/download/4.9/v2rayN-Core.zip
![](/uploads/article/20210203/3886a2adbf958a53a76ced89237fc4b4.png)
![](/uploads/article/20210203/49f71674b495ad72594f5f6c28d10463.png)
点击确定,保存。选中刚才新加的服务器,设置为活动服务器
![](/uploads/article/20210203/be4e12f5c4498e22ff69b72f64c4d62d.png)
右下角 v2ray图标
![](/uploads/article/20210410/27c820d9206105690847cb4e30be4f61.png)
单击右键,系统代理 - 自动配置系统代理 (新版本:Http代理 - 开启PAC,并自动配置系统代理(PAC模式))
测试连接是否成功
注:如果无法连接,请进入服务商控制台检查网络安全组(10086)端口是否放行(本文使用为10086端口,如果使用了其他的端口,那么只需上下文一致即可)
注:本教程仅供学习交流使用,请勿用于非法用途!
0 条讨论