V2ray搭建教程

获取root权限:

1
sudo -i

##Debian更新系统##

1
apt update -y

##CentOS更新系统##

1
2
yum install epel-release -y
yum update -y

##CentOS更新系统##

1
2
yum update -y
yum install -y curl

V2ray一键安装指令:

1
bash <(curl -s -L https://git.io/v2ray.sh)

如果提示 curl: command not found ,那是因为你的 VPS 没装 Curl
ubuntu/debian 系统安装 Curl 方法:

1
apt-get update -y && apt-get install curl -y

centos 系统安装 Curl 方法:

1
yum update -y && yum install curl -y

安装好 curl 之后就能安装脚本了

安装BBR加速
开启系统自带BBR

1
2
3
4
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p
lsmod | grep bbr

千影版【推荐】

1
wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh

lkl-linux+haproxy hack 版本 bbrplus,在 OpenVZ 工作良好,需要开启 TUN/TAP 和至少 256M 空闲内存

1
wget --no-cache -O lkl-haproxy.sh https://github.com/mzz2017/lkl-haproxy/raw/master/lkl-haproxy.sh && bash lkl-haproxy.sh

备注:非常注意

使用Oracle Cloud free 免费云搭建了v2ray /shadowsockR, 在子网 -> 安全列表 -> 入网规则 里也打开了对应的端口,但还是无法科学上网。
原来oracle cloud与 aws等云不同,需要关闭防火墙或iptable,解决方法:

centos操作如下:
#停止firewall

1
systemctl stop firewalld.service

#禁止firewall开机启动

1
systemctl disable firewalld.service

#关闭iptables

1
service iptables stop

#去掉iptables开机启动

1
chkconfig iptables off

oracle Linux操作如下:
#停止firewall

1
systemctl stop firewalld.service

#禁止firewall开机启动

1
systemctl disable firewalld.service

ubuntu操作如下:
#Oracle自带的Ubuntu镜像默认设置了Iptable规则,关闭它

1
2
apt-get purge netfilter-persistent
reboot

#强制删除

1
rm -rf /etc/iptables && reboot