From 477367ebbc6a3da22681faa89860b6faa16b301c Mon Sep 17 00:00:00 2001 From: 441041 <441041@qq.com> Date: Fri, 25 Mar 2022 14:56:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=85=E5=8A=A9=E5=AE=89=E8=A3=85v2ray?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- v2ray_install.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 v2ray_install.sh diff --git a/v2ray_install.sh b/v2ray_install.sh new file mode 100644 index 0000000..82d9001 --- /dev/null +++ b/v2ray_install.sh @@ -0,0 +1,36 @@ +wget "https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh" -O install-release.sh +. install-release.sh +echo "请输入端口" +read port +uuid=$(cat /proc/sys/kernel/random/uuid) +echo $uuid +echo "{ + \"inbounds\": [ + { + \"port\": $port, + \"protocol\": \"vmess\", + \"settings\": { + \"clients\": [ + { + \"id\": \"$uuid\", + \"alterId\": 0 + } + ] + } + } + ], + \"outbounds\": [ + { + \"protocol\": \"freedom\", + \"settings\": {} + } + ] +}" > /usr/local/etc/v2ray/config.json + +echo net.core.default_qdisc=fq >> /etc/sysctl.conf +echo net.ipv4.tcp_congestion_control=bbr >> /etc/sysctl.conf +sysctl -p +lsmod | grep bbr + +sudo ufw allow $port/tcp +systemctl start v2ray \ No newline at end of file