centos7 v2ray 5.0 安装
v2ray,是一个开源的网络代理工具,旨在提供更强大、更灵活的网络代理和隐私保护解决方案。它支持多种传输协议和代理协议,可以用于科学上网、绕过网络封锁、保护隐私等用途。
1.安装V2Ray
bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)
安裝最新發行的 geoip.dat 和 geosite.dat
bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-dat-release.sh)
移除 V2Ray
bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh) --remove
指定版本安装
bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh) --version v5.1.0
配置文件添加
vi /usr/local/etc/v2ray/config.json
{
"log" : {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbounds": [{
"port": 41135,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "b139ced7-79ea-40ae-8681-22b59092ee45",
"level": 1,
"alterId": 0
}
]
},
"streamSettings": {
"network": "ws",
"wsSettings": {
"path": "/home"
}
}
}],
"outbounds": [{
"protocol": "freedom",
"settings": {}
},{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}],
"routing": {
"rules": [
{
"type": "field",
"ip": ["geoip:private"],
"outboundTag": "blocked"
}
]
}
}
查看状态
systemctl status v2ray
设置开机启动
systemctl enable v2ray
运行v2ray
systemctl start v2ray
查看v2ray是否正在运行
ss -ntlp | grep v2ray
配置文件检查
/usr/local/bin/v2ray test -config /usr/local/etc/v2ray/config.json
2.防火墙放行监听的端口
systemctl stop firewalld
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --reload
3.安装nginx
yum install -y epel-release && yum install -y nginx
添加配置文件
vi /etc/nginx/conf.d/default.conf
server {
listen 80;
location /home {
proxy_redirect off;
proxy_pass http://127.0.0.1:41135;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
配置文件检查
nginx -t
重启nginx
systemctl restart nginx
设置开机启动
systemctl enable nginx
查看状态
systemctl status nginx
4.安装bbr加速
wget --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh && chmod +x bbr.sh && ./bbr.sh
查看是否安装成功
返回值为 net.ipv4.tcp_available_congestion_control = bbr cubic reno 表示安装成功
sysctl net.ipv4.tcp_available_congestion_control
5.客户端
下载地址
参数配置
服务器选择添加VMess服务器