├── wgcf ├── root.sh ├── LICENSE ├── upcore.sh ├── README.md └── multi.sh /wgcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanglc721/CFWarp-Pro/HEAD/wgcf -------------------------------------------------------------------------------- /root.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sudo lsattr /etc/passwd /etc/shadow 4 | sudo chattr -i /etc/passwd /etc/shadow 5 | sudo chattr -a /etc/passwd /etc/shadow 6 | sudo lsattr /etc/passwd /etc/shadow 7 | 8 | read -p "自定义ROOT密码:" mima 9 | echo root:$mima | sudo chpasswd root 10 | sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config; 11 | sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config; 12 | sudo service sshd restart 13 | sudo reboot 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 YG-tsj 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /upcore.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | #彩色 4 | red(){ 5 | echo -e "\033[31m\033[01m$1\033[0m" 6 | } 7 | green(){ 8 | echo -e "\033[32m\033[01m$1\033[0m" 9 | } 10 | yellow(){ 11 | echo -e "\033[33m\033[01m$1\033[0m" 12 | } 13 | blue(){ 14 | echo -e "\033[36m\033[01m$1\033[0m" 15 | } 16 | 17 | function c8(){ 18 | rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org 19 | yum install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm -y 20 | yum --enablerepo=elrepo-kernel install kernel-ml -y 21 | grub2-set-default 0 22 | grub2-mkconfig -o /boot/grub2/grub.cfg 23 | reboot 24 | } 25 | 26 | function c7(){ 27 | rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org 28 | yum install https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm -y 29 | yum --enablerepo=elrepo-kernel install kernel-ml -y 30 | grub2-set-default 0 31 | grub2-mkconfig -o /boot/grub2/grub.cfg 32 | reboot 33 | } 34 | 35 | function ub(){ 36 | 37 | function v46(){ 38 | cd /tmp 39 | wget --no-check-certificate -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11/amd64/linux-headers-5.11.0-051100_5.11.0-051100.202102142330_all.deb 40 | wget --no-check-certificate -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11/amd64/linux-headers-5.11.0-051100-generic_5.11.0-051100.202102142330_amd64.deb 41 | wget --no-check-certificate -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11/amd64/linux-image-unsigned-5.11.0-051100-generic_5.11.0-051100.202102142330_amd64.deb 42 | wget --no-check-certificate -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11/amd64/linux-modules-5.11.0-051100-generic_5.11.0-051100.202102142330_amd64.deb 43 | sudo dpkg -i *.deb 44 | reboot 45 | } 46 | 47 | function v6(){ 48 | echo -e nameserver 2a00:1098:2c::1 > /etc/resolv.conf 49 | cd /tmp 50 | wget --no-check-certificate -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11/amd64/linux-headers-5.11.0-051100_5.11.0-051100.202102142330_all.deb 51 | wget --no-check-certificate -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11/amd64/linux-headers-5.11.0-051100-generic_5.11.0-051100.202102142330_amd64.deb 52 | wget --no-check-certificate -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11/amd64/linux-image-unsigned-5.11.0-051100-generic_5.11.0-051100.202102142330_amd64.deb 53 | wget --no-check-certificate -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11/amd64/linux-modules-5.11.0-051100-generic_5.11.0-051100.202102142330_amd64.deb 54 | sudo dpkg -i *.deb 55 | reboot 56 | } 57 | 58 | function menu(){ 59 | clear 60 | green " 请确认当前的VPS属于以下哪种IP表现形式!" 61 | blue " 1. 纯IPV4/双栈IPV4+IPV6 " 62 | blue " 2. 纯IPV6 " 63 | red " 0. 返回上一层 " 64 | echo 65 | read -p "请输入数字:" menuNumberInput 66 | case "$menuNumberInput" in 67 | 1 ) 68 | v46 69 | ;; 70 | 2 ) 71 | v6 72 | ;; 73 | 0 ) 74 | start_menu 75 | ;; 76 | esac 77 | } 78 | 79 | menu 80 | } 81 | 82 | function de(){ 83 | echo 'deb http://deb.debian.org/debian buster-backports main'>> /etc/apt/sources.list 84 | apt update 85 | apt install -t buster-backports linux-image-amd64 linux-headers-amd64 -y 86 | update-grub 87 | reboot 88 | } 89 | 90 | function start_menu(){ 91 | clear 92 | green " 更新系统内核到官方源最新版本!注意,别手滑哦!" 93 | blue " 1. Centos7 " 94 | blue " 2. Centos8 " 95 | blue " 3. Ubuntu20 " 96 | blue " 4. Debain10 " 97 | red " 0. 退出脚本 " 98 | echo 99 | read -p "请输入数字:" menuNumberInput 100 | case "$menuNumberInput" in 101 | 1 ) 102 | c7 103 | ;; 104 | 2 ) 105 | c8 106 | ;; 107 | 3 ) 108 | ub 109 | ;; 110 | 4 ) 111 | de 112 | ;; 113 | 0 ) 114 | exit 1 115 | ;; 116 | esac 117 | } 118 | 119 | start_menu "first" 120 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ## 支持kvm/xen/microsoft等架构VPS的WARP一键综合脚本 3 | 4 | - [x] 支持自动识别系统类型,CPU架构(X86/ARM),内核版本,虚拟化架构类型! 5 | - [x] 支持纯IPV4,纯IPV6,双栈IPV4+IPV6 三大类VPS! 6 | - [x] 支持Ubuntu/Centos/Debain最新系统! 7 | - [x] 支持共9种形态的WARP形式,安装过程无需手动干预! 8 | - [x] 支持即时显示当前WARP状态与IP地址! 9 | 10 | 11 | ![cb94fcd50b9bf53a956a3052565e2fd](https://user-images.githubusercontent.com/80431714/123580329-32e4e180-d80c-11eb-9821-f1367cc710ad.png) 12 | ------------------------------------------------------------------------------------------------------- 13 | ![4a1ef3e2f3a62195a8417cd53003fc9](https://user-images.githubusercontent.com/80431714/123580335-35473b80-d80c-11eb-9e44-1417963a927e.png) 14 | 15 | 16 | 17 | ### 更新已测试通过的VPS名单 18 | 19 | - [x] 已支持:oracle(甲骨文云),gpc(谷歌云),buyvm,racknerd,aws(亚马逊云),virmach,vultr,azure(微软云),bandwagonhost(搬瓦工)………………欢迎大家补充反馈……… 20 | 21 | ### 提醒: 22 | 23 | 1、有些KVM VPS仅提供较低的系统内核版本,如不能升级内核版本,建议DD到最新系统,可参考本[issues](https://github.com/YG-tsj/CFWarp-Pro/issues/11),推荐ubuntu20、centos7、debain10以上。 24 | 25 | 2、OpenVZ、LXC架构的VPS并不集成在此脚本中。 26 | 27 | 3、内核必须5.6以上,脚本自带稳定版内核升级功能。 28 | 29 | #### OpenVZ、LXC架构VPS脚本:[EUserv 纯ipv6(OpenVZ、LXC架构VPS)WARP项目](https://github.com/YG-tsj/EUserv-warp)后续也将整合。 30 | 31 | -------------------------------------------------------------------------------------------- 32 | 33 | # 目录 34 | 35 | * [root一键脚本](#root一键脚本) 36 | 37 | * [vps的ip套上warp功能的优势及不足](#vps的ip套上warp功能的优势及不足) 38 | 39 | * [warp多功能一键脚本](#warp多功能一键脚本) 40 | 41 | * [warp多功能一键脚本各功能简析](#warp多功能一键脚本各功能简析) 42 | 43 | * [自定义ip分流配置模板说明](#自定义ip分流配置模板说明) 44 | 45 | * [相关附加说明](#相关附加说明) 46 | ----------------------------------------------------------------------------------------- 47 | ### 相关视频教程及项目 48 | 49 | - [纯IPV4 VPS添加WARP 如何查看专用IP地址](https://youtu.be/o7e_ikV-m-g) 50 | - [甲骨文添加真IPV6,如何选择WARP脚本看奈非](https://youtu.be/ap_krqWnikE) 51 | - [EUserv 纯ipv6(OpenVZ、LXC架构VPS)WARP项目](https://github.com/YG-tsj/EUserv-warp) 52 | --------------------------------------------------------------------------------------------- 53 | ### root一键脚本 54 | 55 | 用户名:root,密码自定义。方便登录与编辑文件!!(已测试支持甲骨文与谷歌云) 56 | 57 | 提示:密码不要设置得过于简单,容易被破解。如有密钥文件要保存好,以防万一! 58 | 59 | 统一适用于纯IPV4、纯IPV6、双栈IPV4+IPV6,非root/root模式下都可直接输入以下脚本,后续再次执行脚本意味着更改root密码!! 60 | 61 | ``` 62 | bash <(curl -sSL https://cdn.jsdelivr.net/gh/YG-tsj/CFWarp-Pro/root.sh) 63 | ``` 64 | ----------------------------------------------------------------------------------------- 65 | ### vps的ip套上warp功能的优势及不足 66 | 67 |
68 | 给纯IPV4/纯IPV6 VPS添加WARP的好处 69 | 70 | ```bash 71 | 1:使只有IPV4/IPV6的VPS获取访问IPV6/IPV4的能力,套上WARP的ip,变成双栈VPS! 72 | 73 | 2:基本能隐藏VPS的真实IP! 74 | 75 | 3:WARP分配的IPV4或者IPV6的IP段,都支持奈非Netflix流媒体,无视VPS原IP限制! 76 | 77 | 4:加速VPS到CloudFlare CDN节点访问速度! 78 | 79 | 5:避开原VPS的IP需要谷歌验证码问题! 80 | 81 | 6:原IPV4下,WARP的IPV6替代HE tunnelbroker IPV6的隧道代理方案,做IPV6 VPS跳板机代理更加稳定! 82 | ``` 83 |
84 | 85 |
86 | 给IPV4+IPV6双栈VPS添加WARP的好处 87 | 88 | ```bash 89 | 1:基本能隐藏VPS的真实IP! 90 | 91 | 2:WARP分配的IPV4或者IPV6的IP段,都支持奈非Netflix流媒体,无视VPS原IP限制! 92 | 93 | 3:加速VPS到CloudFlare CDN节点访问速度! 94 | 95 | 4:避开原VPS的IP需要谷歌验证码问题! 96 | ``` 97 |
98 | 99 |
100 | 不稳定或者不足点 101 | 102 | ```bash 103 | 1:warp的IP与原生IP在Youtube上速度对比,并不一定有优势,具体看网络环境! 104 | 105 | 2:warp的IP归属国家一般与原生IP一致,但可能会自动改变! 106 | 107 | 3:由于warp是虚拟的IP,类似宝塔面板等相关工具可能需要另外的设置,请自行谷歌。 108 | ``` 109 |
110 | 111 | ------------------------------------------------------------------------------------------------------- 112 | ### warp多功能一键脚本 113 | 114 | - **:支持X86/ARM架构的纯IPV4、纯IPV6、双栈IPV4+IPV6 VPS脚本** 115 | 116 | ``` 117 | wget -N --no-check-certificate https://cdn.jsdelivr.net/gh/YG-tsj/CFWarp-Pro/multi.sh && chmod +x multi.sh && ./multi.sh 118 | ``` 119 | 120 | 进入脚本快捷方式 ```bash multi.sh``` 121 | 122 | - [刷新脚本](https://purge.jsdelivr.net/gh/YG-tsj/CFWarp-Pro/multi.sh) 123 | 124 | --------------------------------------------------------------------------------------------------- 125 | 126 | ### warp多功能一键脚本各功能简析 127 | 128 | - **一、开启甲骨文VPS所有端口(甲骨文专用,务必选择):** 129 | 130 | 解决代理协议申请证书发生Nginx等相关报错问题,完成后将自动断开VPS连接! 131 | 132 | - **二、更新系统内核:** 133 | 134 | 因为5.6版本以上内核才集成Wireguard,内核集成方案在理论上网络效率最高!(网络性能:内核集成>内核模块>Wireguard-Go) 135 | 136 | 而网络上很多项目大多都为“内核模块”方案。所以本项目就来pro版的,后续随着VPS厂商对系统的升级,内核集成必定是主流。 137 | 138 | 自动检测内核版本功能已集成于5-13脚本中,5.6以下内核将自动终止脚本运行并提示升级内核! 139 | 140 | 更新完成后将自动断开VPS连接! 141 | 142 | - **三、开启原生BBR加速:** 143 | 144 | 检测原生BBR是否生效,最后显示有tcp_bbr字样,说明成功。 145 | 146 | - **四、奈非Netflix检测(sjlleo版):** 147 | 148 | 支持IPV4/IPV6检测,结果非常详细。 149 | 150 | ![4f396307256bfefd7c92d6f667fea45](https://user-images.githubusercontent.com/80431714/121798699-62b3b700-cc5a-11eb-81f0-49a0d2fcdaf7.png) 151 | 152 | 153 | - **五、安装WARP脚本** 154 | 155 | - **(仅支持 纯IPV4 VPS)** 156 | 157 | 脚本5、结果表现为2个IP:VPS本地IPV4+WARP虚拟IPV6 158 | 159 | 脚本6、结果表现为3个IP:VPS本地IPV4+WARP虚拟IPV4+WARP虚拟IPV6 160 | 161 | 脚本7、结果表现为2个IP:VPS本地IPV4+WARP虚拟IPV4 162 | 163 | - **(仅支持双栈IPV4+IPV6 VPS)** 164 | 165 | 脚本8、结果表现为3个IP:VPS本地IPV4+VPS本地IPV6+WARP虚拟IPV6 166 | 167 | 脚本9、结果表现为4个IP:VPS本地IPV4+VPS本地IPV6+WARP虚拟IPV6+WARP虚拟IPV4 168 | 169 | 脚本10、结果表现为3个IP:VPS本地IPV4+VPS本地IPV6+WARP虚拟IPV4 170 | 171 | - **(仅支持 纯IPV6 VPS)** 172 | 173 | 脚本11、结果表现为2个IP:VPS本地IPV6+WARP虚拟IPV6 (注意、无IPV4) 174 | 175 | 脚本12、结果表现为3个IP:VPS本地IPV6+WARP虚拟IPV6+WARP虚拟IPV4 176 | 177 | 脚本13、结果表现为2个IP:VPS本地IPV6+WARP虚拟IPV4 178 | 179 | - **六、统一DNS功能(推荐有IPV4访问能力的VPS使用):** 180 | 181 | VPS可能会强制初始化DNS设置,使WARP设置的DNS失效,导致进入SSH后无法访问外网,虽然说重启VPS能恢复WARP的DNS并能正常访问外网,但很不方便。 182 | 183 | 本功能会强制固定VPS的DNS为WARP设置的DNS,这样就不会出现SHH无法访问外网的问题。 184 | 185 | - **七、永久关闭WARP功能:** 186 | 187 | 作用1:永久关闭WARP分配的虚拟IP,还原当前VPS的本地IP。 188 | 189 | 作用2:如之前已安装了一种WARP方案,现更换另一种WARP方案,请先关闭WARP功能,再执行安装WARP脚本。 190 | 191 | - **八、启动并开机自启WARP功能:** 192 | 193 | 作用:永久关闭WARP功能后的再次启用。 194 | 195 | 因WARP脚本默认集成该功能,所以脚本安装成功后不必再执行该项。 196 | 197 | - **九、代理协议脚本选择** 198 | 199 | 支持IPV4/IPV6/X86/ARM的全面脚本 ,推荐! 200 | mack-a脚本地址:https://github.com/mack-a/v2ray-agent 201 | 202 | 支持IPV4/IPV6/X86的脚本 203 | phlinhng脚本地址:https://github.com/phlinhng/v2ray-tcp-tls-web 204 | 205 | 如有好的脚本会继续添加,欢迎大家推荐哦!! 206 | 207 | 注意:域名解析所填写的IP必须是VPS本地IP,与WARP分配的IP没关系! 208 | 209 | - **十、重启VPS实例(俗话说:重启解决99%的问题)** 210 | 211 | 甲骨文云也可以登录网页,进入实例后台,执行“重新引导”,在后台重启。 212 | 213 | ------------------------------------------------------------------------------------------------------ 214 | ### 自定义ip分流配置模板说明 215 | 216 | 分流配置文件:outbounds配置文件或者routing配置文件,让IP、域名自定义。大家可根据代理脚本作者说明来查找文件路径! 217 | 218 | ``` 219 | { 220 | "outbounds": [ 221 | { 222 | "tag":"IP4-out", 223 | "protocol": "freedom", 224 | "settings": {} 225 | }, 226 | { 227 | "tag":"IP6-out", 228 | "protocol": "freedom", 229 | "settings": { 230 | "domainStrategy": "UseIPv6" 231 | } 232 | } 233 | ], 234 | "routing": { 235 | "rules": [ 236 | { 237 | "type": "field", 238 | "outboundTag": "IP4-out", 239 | "domain": [""] 240 | }, 241 | { 242 | "type": "field", 243 | "outboundTag": "IP6-out", 244 | "network": "udp,tcp" 245 | } 246 | ] 247 | } 248 | } 249 | ``` 250 | 251 | outbounds部分:以上是代理脚本默认为IPV4优先设置模版。如果IPV6优先,则把4改成6,6改成4。只改三处(三个数字)!! 252 | 253 | routing部分:设置自由度太高啦!可参考IP、域名自定义德鸡IPV6教程:https://youtu.be/fY9HDLJ7mnM) 254 | 255 | ---------------------------------------------------------------------------------------------- 256 | 257 | ### 相关附加说明 258 | 259 | - 纯IPV6下登录SSH(确保本地支持IPV6,可参考德鸡EUserv相关教程) 260 | 261 | - 提示:配置文件wgcf.conf和注册文件wgcf-account.toml都已备份在/etc/wireguard目录下! 262 | 263 | - 查看WARP当前统计状态:wg 264 | 265 | - 相关WARP进程命令 266 | 267 | 手动临时关闭WARP网络接口 268 | 269 | wg-quick down wgcf 270 | 271 | 手动开启WARP网络接口 272 | 273 | wg-quick up wgcf 274 | 275 | 启动systemctl enable wg-quick@wgcf 276 | 277 | 开始systemctl start wg-quick@wgcf 278 | 279 | 重启systemctl restart wg-quick@wgcf 280 | 281 | 停止systemctl stop wg-quick@wgcf 282 | 283 | 关闭systemctl disable wg-quick@wgcf 284 | 285 | #### 感谢P3terx大及原创者们,参考来源: 286 | 287 | https://p3terx.com/archives/debian-linux-vps-server-wireguard-installation-tutorial.html 288 | 289 | https://p3terx.com/archives/use-cloudflare-warp-to-add-extra-ipv4-or-ipv6-network-support-to-vps-servers-for-free.html 290 | 291 | https://luotianyi.vc/5252.html 292 | 293 | https://hiram.wang/cloudflare-wrap-vps/ 294 | -------------------------------------------------------------------------------- /multi.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | export PATH=$PATH:/usr/local/bin 3 | 4 | red(){ 5 | echo -e "\033[31m\033[01m$1\033[0m" 6 | } 7 | green(){ 8 | echo -e "\033[32m\033[01m$1\033[0m" 9 | } 10 | yellow(){ 11 | echo -e "\033[33m\033[01m$1\033[0m" 12 | } 13 | blue(){ 14 | echo -e "\033[36m\033[01m$1\033[0m" 15 | } 16 | white(){ 17 | echo -e "\033[1;37m\033[01m$1\033[0m" 18 | } 19 | 20 | bblue(){ 21 | echo -e "\033[1;34m\033[01m$1\033[0m" 22 | } 23 | 24 | rred(){ 25 | echo -e "\033[1;35m\033[01m$1\033[0m" 26 | } 27 | 28 | 29 | if [[ -f /etc/redhat-release ]]; then 30 | release="Centos" 31 | elif cat /etc/issue | grep -q -E -i "debian"; then 32 | release="Debian" 33 | elif cat /etc/issue | grep -q -E -i "ubuntu"; then 34 | release="Ubuntu" 35 | elif cat /etc/issue | grep -q -E -i "centos|red hat|redhat"; then 36 | release="Centos" 37 | elif cat /proc/version | grep -q -E -i "debian"; then 38 | release="Debian" 39 | elif cat /proc/version | grep -q -E -i "ubuntu"; then 40 | release="Ubuntu" 41 | elif cat /proc/version | grep -q -E -i "centos|red hat|redhat"; then 42 | release="Centos" 43 | fi 44 | 45 | 46 | bit=`uname -m` 47 | version=`uname -r | awk -F "-" '{print $1}'` 48 | main=`uname -r | awk -F . '{print $1 }'` 49 | minor=`uname -r | awk -F . '{print $2}'` 50 | rv4=`ip a | grep global | awk 'NR==1 {print $2}' | cut -d'/' -f1` 51 | rv6=`ip a | grep inet6 | awk 'NR==2 {print $2}' | cut -d'/' -f1` 52 | op=`hostnamectl | grep -i Operating | awk -F ':' '{print $2}'` 53 | vi=`hostnamectl | grep -i Virtualization | awk -F ':' '{print $2}'` 54 | 55 | if [[ ${vi} == " kvm" ]]; then 56 | green " ---VPS扫描中---> " 57 | 58 | elif [[ ${vi} == " xen" ]]; then 59 | green " ---VPS扫描中---> " 60 | 61 | elif [[ ${vi} == " microsoft" ]]; then 62 | green " ---VPS扫描中---> " 63 | 64 | else 65 | yellow " 虚拟架构类型 - $vi " 66 | yellow " 对此vps架构不支持,脚本安装自动退出,赶紧提醒甬哥加上你的架构吧!" 67 | exit 1 68 | fi 69 | 70 | yellow " VPS相关信息如下:" 71 | white "------------------------------------------" 72 | blue " 操作系统名称 -$op " 73 | blue " 系统内核版本 - $version " 74 | blue " CPU架构名称 - $bit " 75 | blue " 虚拟架构类型 -$vi " 76 | white " -----------------------------------------------" 77 | sleep 3s 78 | 79 | warpwg=$(systemctl is-active wg-quick@wgcf) 80 | case ${warpwg} in 81 | active) 82 | WireGuardStatus=$(green "运行中") 83 | ;; 84 | *) 85 | WireGuardStatus=$(red "未运行") 86 | esac 87 | 88 | 89 | v44=`ping4 google.com -c 1 | grep received | awk 'NR==1 {print $4}'` 90 | 91 | if [[ ${v44} == "1" ]]; then 92 | v4=`wget -qO- ipv4.ip.sb` 93 | WARPIPv4Status=$(curl -s4 https://www.cloudflare.com/cdn-cgi/trace | grep warp | cut -d= -f2) 94 | case ${WARPIPv4Status} in 95 | on) 96 | WARPIPv4Status=$(green "WARP已开启,当前IPV4地址:$v4 ") 97 | ;; 98 | off) 99 | WARPIPv4Status=$(yellow "WARP未开启,当前IPV4地址:$v4 ") 100 | esac 101 | else 102 | WARPIPv4Status=$(red "不存在IPV4地址 ") 103 | 104 | fi 105 | 106 | v66=`ping6 google.com -c 1 | grep received | awk 'NR==1 {print $4}'` 107 | 108 | if [[ ${v66} == "1" ]]; then 109 | v6=`wget -qO- ipv6.ip.sb` 110 | WARPIPv6Status=$(curl -s6 https://www.cloudflare.com/cdn-cgi/trace | grep warp | cut -d= -f2) 111 | case ${WARPIPv6Status} in 112 | on) 113 | WARPIPv6Status=$(green "WARP已开启,当前IPV6地址:$v6 ") 114 | ;; 115 | off) 116 | WARPIPv6Status=$(yellow "WARP未开启,当前IPV6地址:$v6 ") 117 | esac 118 | else 119 | WARPIPv6Status=$(red "不存在IPV6地址 ") 120 | 121 | fi 122 | 123 | Print_ALL_Status_menu() { 124 | blue "-----------------------" 125 | blue "WireGuard 运行状态\t: ${WireGuardStatus}" 126 | blue "IPv4 网络状态\t: ${WARPIPv4Status}" 127 | blue "IPv6 网络状态\t: ${WARPIPv6Status}" 128 | blue "-----------------------" 129 | } 130 | 131 | if [[ ${bit} == "x86_64" ]]; then 132 | 133 | function wo646(){ 134 | yellow " 检测系统内核版本是否大于5.6版本 " 135 | if [ "$main" -lt 5 ]|| [ "$minor" -lt 6 ]; then 136 | red " 检测到内核版本小于5.6,回到菜单,选择2,自动更新内核吧" 137 | exit 1 138 | fi 139 | 140 | if [ $release = "Centos" ] 141 | then 142 | yum update -y 143 | yum install curl wget -y && yum install sudo -y 144 | yum install epel-release -y 145 | yum install -y \ 146 | https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 147 | curl -o /etc/yum.repos.d/jdoss-wireguard-epel-7.repo \ 148 | https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/repo/epel-7/jdoss-wireguard-epel-7.repo 149 | yum install wireguard-tools -y 150 | elif [ $release = "Debian" ] 151 | then 152 | apt-get update -y 153 | apt-get install curl wget -y && apt install sudo -y 154 | apt-get install openresolv -y 155 | echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable-wireguard.list 156 | printf 'Package: *\nPin: release a=unstable\nPin-Priority: 150\n' > /etc/apt/preferences.d/limit-unstable 157 | apt-get install linux-headers-`uname -r` -y 158 | apt-get install wireguard-tools -y 159 | elif [ $release = "Ubuntu" ] 160 | then 161 | apt-get update -y 162 | apt-get install curl wget -y && apt install sudo -y 163 | apt -y --no-install-recommends install openresolv dnsutils wireguard-tools 164 | else 165 | yellow " 不支持当前系统 " 166 | exit 1 167 | fi 168 | wget -N -6 https://cdn.jsdelivr.net/gh/YG-tsj/EUserv-warp/wgcf 169 | cp wgcf /usr/local/bin/wgcf 170 | sudo chmod +x /usr/local/bin/wgcf 171 | echo | wgcf register 172 | until [ $? -eq 0 ] 173 | do 174 | sleep 1s 175 | echo | wgcf register 176 | done 177 | wgcf generate 178 | sed -i "5 s/^/PostUp = ip -6 rule add from $rv6 table main\n/" wgcf-profile.conf 179 | sed -i "6 s/^/PostDown = ip -6 rule delete from $rv6 table main\n/" wgcf-profile.conf 180 | sed -i 's/engage.cloudflareclient.com/2606:4700:d0::a29f:c001/g' wgcf-profile.conf 181 | sed -i 's/1.1.1.1/8.8.8.8,2001:4860:4860::8888/g' wgcf-profile.conf 182 | cp wgcf-account.toml /etc/wireguard/wgcf-account.toml 183 | cp wgcf-profile.conf /etc/wireguard/wgcf.conf 184 | systemctl enable wg-quick@wgcf 185 | systemctl start wg-quick@wgcf 186 | rm -f wgcf* 187 | grep -qE '^[ ]*precedence[ ]*::ffff:0:0/96[ ]*100' /etc/gai.conf || echo 'precedence ::ffff:0:0/96 100' | sudo tee -a /etc/gai.conf 188 | yellow " 检测是否成功启动(IPV4+IPV6)双栈Warp!\n 显示IPV4地址:$(wget -qO- ipv4.ip.sb) 显示IPV6地址:$(wget -qO- ipv6.ip.sb) " 189 | green " 如上方显示IPV4地址:8.…………,IPV6地址:2a09:…………,则说明成功啦!\n 如上方IPV4无IP显示,IPV6显示本地IP,则说明失败喽!! " 190 | } 191 | 192 | function wo66(){ 193 | yellow " 检测系统内核版本是否大于5.6版本 " 194 | if [ "$main" -lt 5 ]|| [ "$minor" -lt 6 ]; then 195 | red " 检测到内核版本小于5.6,回到菜单,选择2,自动更新内核吧" 196 | exit 1 197 | fi 198 | 199 | if [ $release = "Centos" ] 200 | then 201 | yum update -y 202 | yum install curl wget -y && yum install sudo -y 203 | yum install epel-release -y 204 | yum install -y \ 205 | https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 206 | curl -o /etc/yum.repos.d/jdoss-wireguard-epel-7.repo \ 207 | https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/repo/epel-7/jdoss-wireguard-epel-7.repo 208 | yum install wireguard-tools -y 209 | elif [ $release = "Debian" ] 210 | then 211 | apt-get update -y 212 | apt-get install curl wget -y && apt install sudo -y 213 | apt-get install openresolv -y 214 | echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable-wireguard.list 215 | printf 'Package: *\nPin: release a=unstable\nPin-Priority: 150\n' > /etc/apt/preferences.d/limit-unstable 216 | apt-get install linux-headers-`uname -r` -y 217 | apt-get install wireguard-tools -y 218 | elif [ $release = "Ubuntu" ] 219 | then 220 | apt-get update -y 221 | apt-get install curl wget -y && apt install sudo -y 222 | apt -y --no-install-recommends install openresolv dnsutils wireguard-tools 223 | else 224 | yellow " 不支持当前系统 " 225 | exit 1 226 | fi 227 | wget -N -6 https://cdn.jsdelivr.net/gh/YG-tsj/EUserv-warp/wgcf 228 | cp wgcf /usr/local/bin/wgcf 229 | sudo chmod +x /usr/local/bin/wgcf 230 | echo | wgcf register 231 | until [ $? -eq 0 ] 232 | do 233 | sleep 1s 234 | echo | wgcf register 235 | done 236 | wgcf generate 237 | sed -i "5 s/^/PostUp = ip -6 rule add from $rv6 table main\n/" wgcf-profile.conf 238 | sed -i "6 s/^/PostDown = ip -6 rule delete from $rv6 table main\n/" wgcf-profile.conf 239 | sed -i 's/engage.cloudflareclient.com/2606:4700:d0::a29f:c001/g' wgcf-profile.conf 240 | sed -i '/0\.0\.0\.0\/0/d' wgcf-profile.conf 241 | sed -i 's/1.1.1.1/2001:4860:4860::8888,8.8.8.8/g' wgcf-profile.conf 242 | cp wgcf-account.toml /etc/wireguard/wgcf-account.toml 243 | cp wgcf-profile.conf /etc/wireguard/wgcf.conf 244 | systemctl enable wg-quick@wgcf 245 | systemctl start wg-quick@wgcf 246 | rm -f wgcf* 247 | grep -qE '^[ ]*label[ ]*2002::/16[ ]*2' /etc/gai.conf || echo 'label 2002::/16 2' | sudo tee -a /etc/gai.conf 248 | yellow " 检测是否成功启动Warp!\n 显示IPV6地址:$(wget -qO- ipv6.ip.sb) " 249 | green " 如上方显示IPV6地址:2a09:…………,则说明成功!\n 如上方IPV6显示本地IP,则说明失败喽! " 250 | } 251 | 252 | function wo64(){ 253 | yellow " 检测系统内核版本是否大于5.6版本 " 254 | if [ "$main" -lt 5 ]|| [ "$minor" -lt 6 ]; then 255 | red " 检测到内核版本小于5.6,回到菜单,选择2,自动更新内核吧" 256 | exit 1 257 | fi 258 | 259 | if [ $release = "Centos" ] 260 | then 261 | yum update -y 262 | yum install curl wget -y && yum install sudo -y 263 | yum install epel-release -y 264 | yum install -y \ 265 | https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 266 | curl -o /etc/yum.repos.d/jdoss-wireguard-epel-7.repo \ 267 | https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/repo/epel-7/jdoss-wireguard-epel-7.repo 268 | yum install wireguard-tools -y 269 | elif [ $release = "Debian" ] 270 | then 271 | apt-get update -y 272 | apt-get install curl wget -y && apt install sudo -y 273 | apt-get install openresolv -y 274 | echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable-wireguard.list 275 | printf 'Package: *\nPin: release a=unstable\nPin-Priority: 150\n' > /etc/apt/preferences.d/limit-unstable 276 | apt-get install linux-headers-`uname -r` -y 277 | apt-get install wireguard-tools -y 278 | elif [ $release = "Ubuntu" ] 279 | then 280 | apt-get update -y 281 | apt-get install curl wget -y && apt install sudo -y 282 | apt -y --no-install-recommends install openresolv dnsutils wireguard-tools 283 | else 284 | yellow " 不支持当前系统 " 285 | exit 1 286 | fi 287 | wget -N -6 https://cdn.jsdelivr.net/gh/YG-tsj/EUserv-warp/wgcf 288 | cp wgcf /usr/local/bin/wgcf 289 | sudo chmod +x /usr/local/bin/wgcf 290 | echo | wgcf register 291 | until [ $? -eq 0 ] 292 | do 293 | sleep 1s 294 | echo | wgcf register 295 | done 296 | wgcf generate 297 | sed -i 's/engage.cloudflareclient.com/2606:4700:d0::a29f:c001/g' wgcf-profile.conf 298 | sed -i '/\:\:\/0/d' wgcf-profile.conf 299 | sed -i 's/1.1.1.1/8.8.8.8,2001:4860:4860::8888/g' wgcf-profile.conf 300 | cp wgcf-account.toml /etc/wireguard/wgcf-account.toml 301 | cp wgcf-profile.conf /etc/wireguard/wgcf.conf 302 | systemctl enable wg-quick@wgcf 303 | systemctl start wg-quick@wgcf 304 | rm -f wgcf* 305 | grep -qE '^[ ]*precedence[ ]*::ffff:0:0/96[ ]*100' /etc/gai.conf || echo 'precedence ::ffff:0:0/96 100' | sudo tee -a /etc/gai.conf 306 | yellow " 检测是否成功启动Warp!\n 显示IPV4地址:$(wget -qO- ipv4.ip.sb) " 307 | green " 如上方显示IPV4地址:8.…………,则说明成功啦!\n 如上方显示VPS本地IP,则说明失败喽! " 308 | } 309 | 310 | function warp6(){ 311 | yellow " 检测系统内核版本是否大于5.6版本 " 312 | if [ "$main" -lt 5 ]|| [ "$minor" -lt 6 ]; then 313 | red " 检测到内核版本小于5.6,回到菜单,选择2,自动更新内核吧" 314 | exit 1 315 | fi 316 | 317 | if [ $release = "Centos" ] 318 | then 319 | yum update -y 320 | yum install curl wget -y && yum install sudo -y 321 | yum install epel-release -y 322 | yum install -y \ 323 | https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 324 | curl -o /etc/yum.repos.d/jdoss-wireguard-epel-7.repo \ 325 | https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/repo/epel-7/jdoss-wireguard-epel-7.repo 326 | yum install wireguard-tools -y 327 | elif [ $release = "Debian" ] 328 | then 329 | apt-get update -y 330 | apt-get install curl wget -y && apt install sudo -y 331 | apt-get install openresolv -y 332 | echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable-wireguard.list 333 | printf 'Package: *\nPin: release a=unstable\nPin-Priority: 150\n' > /etc/apt/preferences.d/limit-unstable 334 | apt-get install linux-headers-`uname -r` -y 335 | apt-get install wireguard-tools -y 336 | elif [ $release = "Ubuntu" ] 337 | then 338 | apt-get update -y 339 | apt-get install curl wget -y && apt install sudo -y 340 | apt -y --no-install-recommends install openresolv dnsutils wireguard-tools 341 | else 342 | yellow " 不支持当前系统 " 343 | exit 1 344 | fi 345 | wget -N https://github.com/ViRb3/wgcf/releases/download/v2.2.3/wgcf_2.2.3_linux_amd64 -O /usr/local/bin/wgcf 346 | sudo chmod +x /usr/local/bin/wgcf 347 | echo | wgcf register 348 | until [ $? -eq 0 ] 349 | do 350 | sleep 1s 351 | echo | wgcf register 352 | done 353 | wgcf generate 354 | sudo sed -i 's/engage.cloudflareclient.com/162.159.192.1/g' wgcf-profile.conf 355 | sudo sed -i '/0\.0\.0\.0\/0/d' wgcf-profile.conf 356 | sudo sed -i 's/1.1.1.1/8.8.8.8,2001:4860:4860::8888/g' wgcf-profile.conf 357 | sudo cp wgcf-account.toml /etc/wireguard/wgcf-account.toml 358 | sudo cp wgcf-profile.conf /etc/wireguard/wgcf.conf 359 | systemctl enable wg-quick@wgcf 360 | systemctl start wg-quick@wgcf 361 | rm -f wgcf* 362 | yellow " 检测是否成功启动Warp!\n 显示IPV6地址:$(wget -qO- ipv6.ip.sb) " 363 | green " 如上方显示IPV6地址:2a09:…………,则说明成功!\n 如上方无IP显示,则说明失败喽! " 364 | } 365 | 366 | function warp64(){ 367 | yellow " 检测系统内核版本是否大于5.6版本 " 368 | if [ "$main" -lt 5 ]|| [ "$minor" -lt 6 ]; then 369 | red " 检测到内核版本小于5.6,回到菜单,选择2,自动更新内核吧" 370 | exit 1 371 | fi 372 | 373 | if [ $release = "Centos" ] 374 | then 375 | yum update -y 376 | yum install curl wget -y && yum install sudo -y 377 | yum install epel-release -y 378 | yum install -y \ 379 | https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 380 | curl -o /etc/yum.repos.d/jdoss-wireguard-epel-7.repo \ 381 | https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/repo/epel-7/jdoss-wireguard-epel-7.repo 382 | yum install wireguard-tools -y 383 | elif [ $release = "Debian" ] 384 | then 385 | apt-get update -y 386 | apt-get install curl wget -y && apt install sudo -y 387 | apt-get install openresolv -y 388 | echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable-wireguard.list 389 | printf 'Package: *\nPin: release a=unstable\nPin-Priority: 150\n' > /etc/apt/preferences.d/limit-unstable 390 | apt-get install linux-headers-`uname -r` -y 391 | apt-get install wireguard-tools -y 392 | elif [ $release = "Ubuntu" ] 393 | then 394 | apt-get update -y 395 | apt-get install curl wget -y && apt install sudo -y 396 | apt -y --no-install-recommends install openresolv dnsutils wireguard-tools 397 | else 398 | yellow " 不支持当前系统 " 399 | exit 1 400 | fi 401 | wget -N https://github.com/ViRb3/wgcf/releases/download/v2.2.3/wgcf_2.2.3_linux_amd64 -O /usr/local/bin/wgcf 402 | chmod +x /usr/local/bin/wgcf 403 | echo | wgcf register 404 | until [ $? -eq 0 ] 405 | do 406 | sleep 1s 407 | echo | wgcf register 408 | done 409 | wgcf generate 410 | sed -i "5 s/^/PostUp = ip -4 rule add from $rv4 table main\n/" wgcf-profile.conf 411 | sed -i "6 s/^/PostDown = ip -4 rule delete from $rv4 table main\n/" wgcf-profile.conf 412 | sed -i 's/engage.cloudflareclient.com/162.159.192.1/g' wgcf-profile.conf 413 | sed -i 's/1.1.1.1/8.8.8.8,2001:4860:4860::8888/g' wgcf-profile.conf 414 | cp wgcf-account.toml /etc/wireguard/wgcf-account.toml 415 | cp wgcf-profile.conf /etc/wireguard/wgcf.conf 416 | systemctl enable wg-quick@wgcf 417 | systemctl start wg-quick@wgcf 418 | rm -f wgcf* 419 | yellow " 检测是否成功启动(IPV4+IPV6)双栈Warp!\n 显示IPV4地址:$(wget -qO- ipv4.ip.sb) 显示IPV6地址:$(wget -qO- ipv6.ip.sb) " 420 | green " 如上方显示IPV4地址:8.…………,IPV6地址:2a09:…………,则说明成功啦!\n 如上方IPV4显示本地IP,IPV6无ip显示,则说明失败喽!! " 421 | } 422 | 423 | function warp4(){ 424 | yellow " 检测系统内核版本是否大于5.6版本 " 425 | if [ "$main" -lt 5 ]|| [ "$minor" -lt 6 ]; then 426 | red " 检测到内核版本小于5.6,回到菜单,选择2,自动更新内核吧" 427 | exit 1 428 | fi 429 | 430 | if [ $release = "Centos" ] 431 | then 432 | yum update -y 433 | yum install curl wget -y && yum install sudo -y 434 | yum install epel-release -y 435 | yum install -y \ 436 | https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 437 | curl -o /etc/yum.repos.d/jdoss-wireguard-epel-7.repo \ 438 | https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/repo/epel-7/jdoss-wireguard-epel-7.repo 439 | yum install wireguard-tools -y 440 | elif [ $release = "Debian" ] 441 | then 442 | apt-get update -y 443 | apt-get install curl wget -y && apt install sudo -y 444 | apt-get install openresolv -y 445 | echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable-wireguard.list 446 | printf 'Package: *\nPin: release a=unstable\nPin-Priority: 150\n' > /etc/apt/preferences.d/limit-unstable 447 | apt-get install linux-headers-`uname -r` -y 448 | apt-get install wireguard-tools -y 449 | elif [ $release = "Ubuntu" ] 450 | then 451 | apt-get update -y 452 | apt-get install curl wget -y && apt install sudo -y 453 | apt -y --no-install-recommends install openresolv dnsutils wireguard-tools 454 | else 455 | yellow " 不支持当前系统 " 456 | exit 1 457 | fi 458 | wget -N https://github.com/ViRb3/wgcf/releases/download/v2.2.3/wgcf_2.2.3_linux_amd64 -O /usr/local/bin/wgcf 459 | chmod +x /usr/local/bin/wgcf 460 | echo | wgcf register 461 | until [ $? -eq 0 ] 462 | do 463 | sleep 1s 464 | echo | wgcf register 465 | done 466 | wgcf generate 467 | sed -i "5 s/^/PostUp = ip -4 rule add from $rv4 table main\n/" wgcf-profile.conf 468 | sed -i "6 s/^/PostDown = ip -4 rule delete from $rv4 table main\n/" wgcf-profile.conf 469 | sed -i 's/engage.cloudflareclient.com/162.159.192.1/g' wgcf-profile.conf 470 | sed -i '/\:\:\/0/d' wgcf-profile.conf 471 | sed -i 's/1.1.1.1/8.8.8.8,2001:4860:4860::8888/g' wgcf-profile.conf 472 | cp wgcf-account.toml /etc/wireguard/wgcf-account.toml 473 | cp wgcf-profile.conf /etc/wireguard/wgcf.conf 474 | systemctl enable wg-quick@wgcf 475 | systemctl start wg-quick@wgcf 476 | rm -f wgcf* 477 | yellow " 检测是否成功启动Warp!\n 显示IPV4地址:$(wget -qO- ipv4.ip.sb) " 478 | green " 如上方显示IPV4地址:8.…………,则说明成功啦!\n 如上方显示VPS本地IP,则说明失败喽! " 479 | } 480 | 481 | function warp466(){ 482 | yellow " 检测系统内核版本是否大于5.6版本 " 483 | if [ "$main" -lt 5 ]|| [ "$minor" -lt 6 ]; then 484 | red " 检测到内核版本小于5.6,回到菜单,选择2,自动更新内核吧" 485 | exit 1 486 | fi 487 | 488 | if [ $release = "Centos" ] 489 | then 490 | yum update -y 491 | yum install curl wget -y && yum install sudo -y 492 | yum install epel-release -y 493 | yum install -y \ 494 | https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 495 | curl -o /etc/yum.repos.d/jdoss-wireguard-epel-7.repo \ 496 | https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/repo/epel-7/jdoss-wireguard-epel-7.repo 497 | yum install wireguard-tools -y 498 | elif [ $release = "Debian" ] 499 | then 500 | apt-get update -y 501 | apt-get install curl wget -y && apt install sudo -y 502 | apt-get install openresolv -y 503 | echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable-wireguard.list 504 | printf 'Package: *\nPin: release a=unstable\nPin-Priority: 150\n' > /etc/apt/preferences.d/limit-unstable 505 | apt-get install linux-headers-`uname -r` -y 506 | apt-get install wireguard-tools -y 507 | elif [ $release = "Ubuntu" ] 508 | then 509 | apt-get update -y 510 | apt-get install curl wget -y && apt install sudo -y 511 | apt -y --no-install-recommends install openresolv dnsutils wireguard-tools 512 | else 513 | yellow " 不支持当前系统 " 514 | exit 1 515 | fi 516 | wget -N https://github.com/ViRb3/wgcf/releases/download/v2.2.3/wgcf_2.2.3_linux_amd64 -O /usr/local/bin/wgcf 517 | chmod +x /usr/local/bin/wgcf 518 | echo | wgcf register 519 | until [ $? -eq 0 ] 520 | do 521 | sleep 1s 522 | echo | wgcf register 523 | done 524 | wgcf generate 525 | sed -i "5 s/^/PostUp = ip -6 rule add from $rv6 table main\n/" wgcf-profile.conf 526 | sed -i "6 s/^/PostDown = ip -6 rule delete from $rv6 table main\n/" wgcf-profile.conf 527 | sed -i '/0\.0\.0\.0\/0/d' wgcf-profile.conf 528 | sed -i 's/1.1.1.1/8.8.8.8,2001:4860:4860::8888/g' wgcf-profile.conf 529 | cp wgcf-account.toml /etc/wireguard/wgcf-account.toml 530 | cp wgcf-profile.conf /etc/wireguard/wgcf.conf 531 | systemctl enable wg-quick@wgcf 532 | systemctl start wg-quick@wgcf 533 | rm -f wgcf* 534 | yellow " 检测是否成功启动Warp!\n 显示IPV6地址:$(wget -qO- ipv6.ip.sb) " 535 | green " 如上方显示IPV6地址:2a09:…………,则说明成功啦!\n 如上方无IP显示,则说明失败喽! " 536 | } 537 | 538 | function warp4646(){ 539 | yellow " 检测系统内核版本是否大于5.6版本 " 540 | if [ "$main" -lt 5 ]|| [ "$minor" -lt 6 ]; then 541 | red " 检测到内核版本小于5.6,回到菜单,选择2,自动更新内核吧" 542 | exit 1 543 | fi 544 | 545 | if [ $release = "Centos" ] 546 | then 547 | yum update -y 548 | yum install curl wget -y && yum install sudo -y 549 | yum install epel-release -y 550 | yum install -y \ 551 | https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 552 | curl -o /etc/yum.repos.d/jdoss-wireguard-epel-7.repo \ 553 | https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/repo/epel-7/jdoss-wireguard-epel-7.repo 554 | yum install wireguard-tools -y 555 | elif [ $release = "Debian" ] 556 | then 557 | apt-get update -y 558 | apt-get install curl wget -y && apt install sudo -y 559 | apt-get install openresolv -y 560 | echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable-wireguard.list 561 | printf 'Package: *\nPin: release a=unstable\nPin-Priority: 150\n' > /etc/apt/preferences.d/limit-unstable 562 | apt-get install linux-headers-`uname -r` -y 563 | apt-get install wireguard-tools -y 564 | elif [ $release = "Ubuntu" ] 565 | then 566 | apt-get update -y 567 | apt-get install curl wget -y && apt install sudo -y 568 | apt -y --no-install-recommends install openresolv dnsutils wireguard-tools 569 | else 570 | yellow " 不支持当前系统 " 571 | exit 1 572 | fi 573 | wget -N https://github.com/ViRb3/wgcf/releases/download/v2.2.3/wgcf_2.2.3_linux_amd64 -O /usr/local/bin/wgcf 574 | chmod +x /usr/local/bin/wgcf 575 | echo | wgcf register 576 | until [ $? -eq 0 ] 577 | do 578 | sleep 1s 579 | echo | wgcf register 580 | done 581 | wgcf generate 582 | sed -i "5 s/^/PostUp = ip -4 rule add from $rv4 table main\n/" wgcf-profile.conf 583 | sed -i "6 s/^/PostDown = ip -4 rule delete from $rv4 table main\n/" wgcf-profile.conf 584 | sed -i "7 s/^/PostUp = ip -6 rule add from $rv6 table main\n/" wgcf-profile.conf 585 | sed -i "8 s/^/PostDown = ip -6 rule delete from $rv6 table main\n/" wgcf-profile.conf 586 | sed -i 's/1.1.1.1/8.8.8.8,2001:4860:4860::8888/g' wgcf-profile.conf 587 | cp wgcf-account.toml /etc/wireguard/wgcf-account.toml 588 | cp wgcf-profile.conf /etc/wireguard/wgcf.conf 589 | systemctl enable wg-quick@wgcf 590 | systemctl start wg-quick@wgcf 591 | rm -f wgcf* 592 | yellow " 检测是否成功启动(IPV4+IPV6)双栈Warp!\n 显示IPV4地址:$(wget -qO- ipv4.ip.sb) 显示IPV6地址:$(wget -qO- ipv6.ip.sb) " 593 | green " 如上方显示IPV4地址:8.…………,IPV6地址:2a09:…………,则说明成功啦!\n 如上方IPV4显示本地IP,IPV6显示本地IP,则说明失败喽! " 594 | } 595 | 596 | function warp464(){ 597 | yellow " 检测系统内核版本是否大于5.6版本 " 598 | if [ "$main" -lt 5 ]|| [ "$minor" -lt 6 ]; then 599 | red " 检测到内核版本小于5.6,回到菜单,选择2,自动更新内核吧" 600 | exit 1 601 | fi 602 | 603 | if [ $release = "Centos" ] 604 | then 605 | yum update -y 606 | yum install curl wget -y && yum install sudo -y 607 | yum install epel-release -y 608 | yum install -y \ 609 | https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 610 | curl -o /etc/yum.repos.d/jdoss-wireguard-epel-7.repo \ 611 | https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/repo/epel-7/jdoss-wireguard-epel-7.repo 612 | yum install wireguard-tools -y 613 | elif [ $release = "Debian" ] 614 | then 615 | apt-get update -y 616 | apt-get install curl wget -y && apt install sudo -y 617 | apt-get install openresolv -y 618 | echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable-wireguard.list 619 | printf 'Package: *\nPin: release a=unstable\nPin-Priority: 150\n' > /etc/apt/preferences.d/limit-unstable 620 | apt-get install linux-headers-`uname -r` -y 621 | apt-get install wireguard-tools -y 622 | elif [ $release = "Ubuntu" ] 623 | then 624 | apt-get update -y 625 | apt-get install curl wget -y && apt install sudo -y 626 | apt -y --no-install-recommends install openresolv dnsutils wireguard-tools 627 | else 628 | yellow " 不支持当前系统 " 629 | exit 1 630 | fi 631 | wget -N https://github.com/ViRb3/wgcf/releases/download/v2.2.3/wgcf_2.2.3_linux_amd64 -O /usr/local/bin/wgcf 632 | chmod +x /usr/local/bin/wgcf 633 | echo | wgcf register 634 | until [ $? -eq 0 ] 635 | do 636 | sleep 1s 637 | echo | wgcf register 638 | done 639 | wgcf generate 640 | sed -i "5 s/^/PostUp = ip -4 rule add from $rv4 table main\n/" wgcf-profile.conf 641 | sed -i "6 s/^/PostDown = ip -4 rule delete from $rv4 table main\n/" wgcf-profile.conf 642 | sed -i '/\:\:\/0/d' wgcf-profile.conf 643 | sed -i 's/1.1.1.1/8.8.8.8,2001:4860:4860::8888/g' wgcf-profile.conf 644 | cp wgcf-account.toml /etc/wireguard/wgcf-account.toml 645 | cp wgcf-profile.conf /etc/wireguard/wgcf.conf 646 | systemctl enable wg-quick@wgcf 647 | systemctl start wg-quick@wgcf 648 | rm -f wgcf* 649 | yellow " 检测是否成功启动Warp!\n 显示IPV4地址:$(wget -qO- ipv4.ip.sb) " 650 | green " 如上方显示IPV4地址:8.…………,则说明成功啦!\n 如上方显示VPS本地IP,则说明失败喽! " 651 | } 652 | 653 | function upcore(){ 654 | wget -N --no-check-certificate https://cdn.jsdelivr.net/gh/YG-tsj/CFWarp-Pro/upcore.sh&& chmod +x upcore.sh && ./upcore.sh 655 | } 656 | 657 | function iptables(){ 658 | sudo iptables -P INPUT ACCEPT 659 | sudo iptables -P FORWARD ACCEPT 660 | sudo iptables -P OUTPUT ACCEPT 661 | sudo iptables -F 662 | sudo apt-get purge netfilter-persistent -y 663 | sudo reboot 664 | } 665 | 666 | function BBR(){ 667 | echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf 668 | echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf 669 | sysctl -p 670 | lsmod | grep bbr 671 | } 672 | 673 | function cwarp(){ 674 | systemctl stop wg-quick@wgcf 675 | systemctl disable wg-quick@wgcf 676 | sudo reboot 677 | } 678 | 679 | function owarp(){ 680 | systemctl enable wg-quick@wgcf 681 | systemctl start wg-quick@wgcf 682 | } 683 | 684 | function macka(){ 685 | sudo iptables -P INPUT ACCEPT 686 | sudo iptables -P FORWARD ACCEPT 687 | sudo iptables -P OUTPUT ACCEPT 688 | sudo iptables -F 689 | wget -P /root -N --no-check-certificate "https://raw.githubusercontent.com/mack-a/v2ray-agent/master/install.sh" && chmod 700 /root/install.sh && /root/install.sh 690 | } 691 | 692 | function phlinhng(){ 693 | sudo iptables -P INPUT ACCEPT 694 | sudo iptables -P FORWARD ACCEPT 695 | sudo iptables -P OUTPUT ACCEPT 696 | sudo iptables -F 697 | curl -fsSL https://raw.staticdn.net/phlinhng/v2ray-tcp-tls-web/main/src/xwall.sh -o ~/xwall.sh && bash ~/xwall.sh 698 | } 699 | 700 | function cv46(){ 701 | yellow "开始检测IPV4地址" 702 | v4=`wget -qO- ipv4.ip.sb` 703 | pingv4=$(ping -c 1 www.google.com| sed '2{s/[^(]*(//;s/).*//;q;}' | tail -n +2) 704 | if [[ -z "${pingv4}" ]]; then 705 | red " ---> VPS当前检测不到IPV4地址 " 706 | else 707 | green " VPS当前正使用的IPV4地址: $v4 " 708 | fi 709 | 710 | 711 | yellow "开始检测IPV6地址" 712 | v6=`wget -qO- ipv6.ip.sb` 713 | pingv6=$(ping6 -c 1 www.google.com| sed '2{s/[^(]*(//;s/).*//;q;}' | tail -n +2) 714 | if [[ -z "${pingv6}" ]]; then 715 | red " ---> VPS当前检测不到IPV6地址 " 716 | else 717 | green " VPS当前正使用的IPV6地址: $v6 " 718 | fi 719 | } 720 | 721 | function Netflix(){ 722 | wget -O nf https://cdn.jsdelivr.net/gh/sjlleo/netflix-verify/CDNRelease/nf_2.60_linux_amd64 && chmod +x nf && clear && ./nf -method full 723 | } 724 | 725 | function reboot(){ 726 | sudo reboot 727 | } 728 | 729 | function dns(){ 730 | echo 'DNS=8.8.8.8 2001:4860:4860::8888'>> /etc/systemd/resolved.conf 731 | systemctl restart systemd-resolved 732 | systemctl enable systemd-resolved 733 | mv /etc/resolv.conf /etc/resolv.conf.bak 734 | ln -s /run/systemd/resolve/resolv.conf /etc/ 735 | sudo reboot 736 | } 737 | 738 | function status(){ 739 | systemctl status wg-quick@wgcf 740 | } 741 | 742 | function up4(){ 743 | wget -N --no-check-certificate https://raw.githubusercontent.com/YG-tsj/CFWarp-Pro/main/multi.sh && chmod +x multi.sh && ./multi.sh 744 | } 745 | 746 | function up6(){ 747 | echo -e nameserver 2a00:1098:2c::1 > /etc/resolv.conf 748 | wget -6 -N --no-check-certificate https://raw.githubusercontent.com/YG-tsj/CFWarp-Pro/main/multi.sh && chmod +x multi.sh && ./multi.sh 749 | } 750 | 751 | #主菜单 752 | function start_menu(){ 753 | clear 754 | yellow " 详细说明 https://github.com/YG-tsj/CFWarp-Pro YouTube频道:甬哥探世界 " 755 | 756 | red " 切记:进入脚本快捷方式 bash multi.sh " 757 | 758 | white " ==================一、VPS相关调整选择(更新中)==========================================" 759 | 760 | green " 1. 永久开启甲骨文VPS的ubuntu系统所有端口 " 761 | 762 | green " 2. 更新系统内核 " 763 | 764 | green " 3. 开启原生BBR加速 " 765 | 766 | green " 4. 检测奈飞Netflix是否解锁 " 767 | 768 | white " ==================二、“内核集成模式”WARP功能选择(更新中)======================================" 769 | 770 | yellow " ----VPS原生IP数------------------------------------添加WARP虚拟IP的位置--------------" 771 | 772 | green " 5. 纯IPV4的VPS。 添加WARP虚拟IPV6 " 773 | 774 | green " 6. 纯IPV4的VPS。 添加WARP虚拟IPV4+虚拟IPV6 " 775 | 776 | green " 7. 纯IPV4的VPS。 添加WARP虚拟IPV4 " 777 | 778 | green " 8. 双栈IPV4+IPV6的VPS。 添加WARP虚拟IPV6 " 779 | 780 | green " 9. 双栈IPV4+IPV6的VPS。 添加WARP虚拟IPV4+虚拟IPV6 " 781 | 782 | green " 10. 双栈IPV4+IPV6的VPS。 添加WARP虚拟IPV4 " 783 | 784 | green " 11. 纯IPV6的VPS。 添加WARP虚拟IPV6 " 785 | 786 | green " 12. 纯IPV6的VPS。 添加WARP虚拟IPV4+虚拟IPV6 " 787 | 788 | green " 13. 纯IPV6的VPS。 添加WARP虚拟IPV4 " 789 | 790 | white " ------------------------------------------------------------------------------------------------" 791 | 792 | green " 14. 统一DNS功能(建议选择) " 793 | 794 | green " 15. 永久关闭WARP功能 " 795 | 796 | green " 16. 自动开启WARP功能 " 797 | 798 | green " 17. 有IPV4:更新脚本 " 799 | 800 | green " 18. 无IPV4:更新脚本 " 801 | 802 | white " ==================三、代理协议脚本选择(更新中)===========================================" 803 | 804 | green " 19.使用mack-a脚本(支持Xray, V2ray, Trojan-go) " 805 | 806 | green " 20.使用phlinhng脚本(支持Xray, Trojan-go, SS+v2ray-plugin) " 807 | 808 | white " =============================================================================================" 809 | 810 | green " 21. 重启VPS实例,请重新连接SSH " 811 | 812 | white " ===============================================================================================" 813 | 814 | green " 0. 退出脚本 " 815 | Print_ALL_Status_menu 816 | echo 817 | read -p "请输入数字:" menuNumberInput 818 | case "$menuNumberInput" in 819 | 1 ) 820 | iptables 821 | ;; 822 | 2 ) 823 | upcore 824 | ;; 825 | 3 ) 826 | BBR 827 | ;; 828 | 4 ) 829 | Netflix 830 | ;; 831 | 5 ) 832 | warp6 833 | ;; 834 | 6 ) 835 | warp64 836 | ;; 837 | 7 ) 838 | warp4 839 | ;; 840 | 8 ) 841 | warp466 842 | ;; 843 | 9 ) 844 | warp4646 845 | ;; 846 | 10 ) 847 | warp464 848 | ;; 849 | 11 ) 850 | wo66 851 | ;; 852 | 12 ) 853 | wo646 854 | ;; 855 | 13 ) 856 | wo64 857 | ;; 858 | 14 ) 859 | dns 860 | ;; 861 | 15 ) 862 | cwarp 863 | ;; 864 | 16 ) 865 | owarp 866 | ;; 867 | 17 ) 868 | up4 869 | ;; 870 | 18 ) 871 | up6 872 | ;; 873 | 19 ) 874 | macka 875 | ;; 876 | 20 ) 877 | phlinhng 878 | ;; 879 | 21 ) 880 | reboot 881 | ;; 882 | 0 ) 883 | exit 1 884 | ;; 885 | esac 886 | } 887 | 888 | 889 | start_menu "first" 890 | 891 | elif [[ ${bit} == "aarch64" ]]; then 892 | 893 | function warp6(){ 894 | if [ "$main" -lt 5 ]|| [ "$minor" -lt 6 ]; then 895 | red " 检测到内核版本小于5.6,回到菜单,选择2,更新内核吧" 896 | exit 1 897 | fi 898 | 899 | apt update 900 | apt -y --no-install-recommends install openresolv dnsutils wireguard-tools 901 | wget -N https://github.com/YG-tsj/CFWarp-Pro/raw/main/wgcf 902 | cp wgcf /usr/local/bin/wgcf 903 | chmod +x /usr/local/bin/wgcf 904 | echo | wgcf register 905 | until [ $? -eq 0 ] 906 | do 907 | sleep 1s 908 | echo | wgcf register 909 | done 910 | wgcf generate 911 | sed -i 's/engage.cloudflareclient.com/162.159.192.1/g' wgcf-profile.conf 912 | sed -i '/0\.0\.0\.0\/0/d' wgcf-profile.conf 913 | sed -i 's/1.1.1.1/8.8.8.8,2001:4860:4860::8888/g' wgcf-profile.conf 914 | cp wgcf-account.toml /etc/wireguard/wgcf-account.toml 915 | cp wgcf-profile.conf /etc/wireguard/wgcf.conf 916 | systemctl enable wg-quick@wgcf 917 | systemctl start wg-quick@wgcf 918 | rm -f wgcf* 919 | yellow " 检测是否成功启动Warp!\n 显示IPV6地址:$(wget -qO- ipv6.ip.sb) " 920 | green " 如上方显示IPV6地址:2a09:…………,则说明成功啦!\n 如上方无IP显示,则说明失败喽! " 921 | } 922 | 923 | function warp64(){ 924 | if [ "$main" -lt 5 ]|| [ "$minor" -lt 6 ]; then 925 | red " 检测到内核版本小于5.6,回到菜单,选择2,更新内核吧" 926 | exit 1 927 | fi 928 | 929 | apt update 930 | apt -y --no-install-recommends install openresolv dnsutils wireguard-tools 931 | wget -N https://github.com/YG-tsj/CFWarp-Pro/raw/main/wgcf 932 | cp wgcf /usr/local/bin/wgcf 933 | chmod +x /usr/local/bin/wgcf 934 | echo | wgcf register 935 | until [ $? -eq 0 ] 936 | do 937 | sleep 1s 938 | echo | wgcf register 939 | done 940 | wgcf generate 941 | sed -i "5 s/^/PostUp = ip -4 rule add from $rv4 table main\n/" wgcf-profile.conf 942 | sed -i "6 s/^/PostDown = ip -4 rule delete from $rv4 table main\n/" wgcf-profile.conf 943 | sed -i 's/engage.cloudflareclient.com/162.159.192.1/g' wgcf-profile.conf 944 | sed -i 's/1.1.1.1/8.8.8.8,2001:4860:4860::8888/g' wgcf-profile.conf 945 | cp wgcf-account.toml /etc/wireguard/wgcf-account.toml 946 | cp wgcf-profile.conf /etc/wireguard/wgcf.conf 947 | systemctl enable wg-quick@wgcf 948 | systemctl start wg-quick@wgcf 949 | rm -f wgcf* 950 | yellow " 检测是否成功启动(IPV4+IPV6)双栈Warp!\n 显示IPV4地址:$(wget -qO- ipv4.ip.sb) 显示IPV6地址:$(wget -qO- ipv6.ip.sb) " 951 | green " 如上方显示IPV4地址:8.…………,IPV6地址:2a09:…………,则说明成功啦!\n 如上方IPV4无IP显示,IPV6显示本地IP,则说明失败喽! " 952 | } 953 | 954 | function warp4(){ 955 | if [ "$main" -lt 5 ]|| [ "$minor" -lt 6 ]; then 956 | red " 检测到内核版本小于5.6,回到菜单,选择2,更新内核吧" 957 | exit 1 958 | fi 959 | 960 | apt update 961 | apt -y --no-install-recommends install openresolv dnsutils wireguard-tools 962 | wget -N https://github.com/YG-tsj/CFWarp-Pro/raw/main/wgcf 963 | cp wgcf /usr/local/bin/wgcf 964 | chmod +x /usr/local/bin/wgcf 965 | echo | wgcf register 966 | until [ $? -eq 0 ] 967 | do 968 | sleep 1s 969 | echo | wgcf register 970 | done 971 | wgcf generate 972 | sed -i "5 s/^/PostUp = ip -4 rule add from $rv4 table main\n/" wgcf-profile.conf 973 | sed -i "6 s/^/PostDown = ip -4 rule delete from $rv4 table main\n/" wgcf-profile.conf 974 | sed -i 's/engage.cloudflareclient.com/162.159.192.1/g' wgcf-profile.conf 975 | sed -i '/\:\:\/0/d' wgcf-profile.conf 976 | sed -i 's/1.1.1.1/8.8.8.8,2001:4860:4860::8888/g' wgcf-profile.conf 977 | cp wgcf-account.toml /etc/wireguard/wgcf-account.toml 978 | cp wgcf-profile.conf /etc/wireguard/wgcf.conf 979 | systemctl enable wg-quick@wgcf 980 | systemctl start wg-quick@wgcf 981 | rm -f wgcf* 982 | yellow " 检测是否成功启动Warp!\n 显示IPV4地址:$(wget -qO- ipv4.ip.sb) " 983 | green " 如上方显示IPV4地址:8.…………,则说明成功啦!\n 如上方显示VPS本地IP,则说明失败喽! " 984 | } 985 | 986 | function warp466(){ 987 | if [ "$main" -lt 5 ]|| [ "$minor" -lt 6 ]; then 988 | red " 检测到内核版本小于5.6,回到菜单,选择2,更新内核吧" 989 | exit 1 990 | fi 991 | 992 | apt update 993 | apt -y --no-install-recommends install openresolv dnsutils wireguard-tools 994 | wget -N https://github.com/YG-tsj/CFWarp-Pro/raw/main/wgcf 995 | cp wgcf /usr/local/bin/wgcf 996 | chmod +x /usr/local/bin/wgcf 997 | echo | wgcf register 998 | until [ $? -eq 0 ] 999 | do 1000 | sleep 1s 1001 | echo | wgcf register 1002 | done 1003 | wgcf generate 1004 | sed -i "5 s/^/PostUp = ip -6 rule add from $rv6 table main\n/" wgcf-profile.conf 1005 | sed -i "6 s/^/PostDown = ip -6 rule delete from $rv6 table main\n/" wgcf-profile.conf 1006 | sed -i '/0\.0\.0\.0\/0/d' wgcf-profile.conf 1007 | sed -i 's/1.1.1.1/8.8.8.8,2001:4860:4860::8888/g' wgcf-profile.conf 1008 | cp wgcf-account.toml /etc/wireguard/wgcf-account.toml 1009 | cp wgcf-profile.conf /etc/wireguard/wgcf.conf 1010 | systemctl enable wg-quick@wgcf 1011 | systemctl start wg-quick@wgcf 1012 | rm -f wgcf* 1013 | yellow " 检测是否成功启动Warp!\n 显示IPV6地址:$(wget -qO- ipv6.ip.sb) " 1014 | green " 如上方显示IPV6地址:2a09:…………,则说明成功啦!\n 如上方无IP显示,则说明失败喽! " 1015 | } 1016 | 1017 | function warp4646(){ 1018 | if [ "$main" -lt 5 ]|| [ "$minor" -lt 6 ]; then 1019 | red " 检测到内核版本小于5.6,回到菜单,选择2,更新内核吧" 1020 | exit 1 1021 | fi 1022 | 1023 | apt update 1024 | apt -y --no-install-recommends install openresolv dnsutils wireguard-tools 1025 | wget -N https://github.com/YG-tsj/CFWarp-Pro/raw/main/wgcf 1026 | cp wgcf /usr/local/bin/wgcf 1027 | chmod +x /usr/local/bin/wgcf 1028 | echo | wgcf register 1029 | until [ $? -eq 0 ] 1030 | do 1031 | sleep 1s 1032 | echo | wgcf register 1033 | done 1034 | wgcf generate 1035 | sed -i "5 s/^/PostUp = ip -4 rule add from $rv4 table main\n/" wgcf-profile.conf 1036 | sed -i "6 s/^/PostDown = ip -4 rule delete from $rv4 table main\n/" wgcf-profile.conf 1037 | sed -i "7 s/^/PostUp = ip -6 rule add from $rv6 table main\n/" wgcf-profile.conf 1038 | sed -i "8 s/^/PostDown = ip -6 rule delete from $rv6 table main\n/" wgcf-profile.conf 1039 | sed -i 's/1.1.1.1/8.8.8.8,2001:4860:4860::8888/g' wgcf-profile.conf 1040 | cp wgcf-account.toml /etc/wireguard/wgcf-account.toml 1041 | cp wgcf-profile.conf /etc/wireguard/wgcf.conf 1042 | systemctl enable wg-quick@wgcf 1043 | systemctl start wg-quick@wgcf 1044 | rm -f wgcf* 1045 | yellow " 检测是否成功启动(IPV4+IPV6)双栈Warp!\n 显示IPV4地址:$(wget -qO- ipv4.ip.sb) 显示IPV6地址:$(wget -qO- ipv6.ip.sb) " 1046 | green " 如上方显示IPV4地址:8.…………,IPV6地址:2a09:…………,则说明成功啦!\n 如上方IPV4无IP显示,IPV6显示本地IP,则说明失败喽! " 1047 | } 1048 | 1049 | function warp464(){ 1050 | if [ "$main" -lt 5 ]|| [ "$minor" -lt 6 ]; then 1051 | red " 检测到内核版本小于5.6,回到菜单,选择2,更新内核吧" 1052 | exit 1 1053 | fi 1054 | 1055 | apt update 1056 | apt -y --no-install-recommends install openresolv dnsutils wireguard-tools 1057 | wget -N https://github.com/YG-tsj/CFWarp-Pro/raw/main/wgcf 1058 | cp wgcf /usr/local/bin/wgcf 1059 | chmod +x /usr/local/bin/wgcf 1060 | echo | wgcf register 1061 | until [ $? -eq 0 ] 1062 | do 1063 | sleep 1s 1064 | echo | wgcf register 1065 | done 1066 | wgcf generate 1067 | sed -i "5 s/^/PostUp = ip -4 rule add from $rv4 table main\n/" wgcf-profile.conf 1068 | sed -i "6 s/^/PostDown = ip -4 rule delete from $rv4 table main\n/" wgcf-profile.conf 1069 | sed -i '/\:\:\/0/d' wgcf-profile.conf 1070 | sed -i 's/1.1.1.1/8.8.8.8,2001:4860:4860::8888/g' wgcf-profile.conf 1071 | cp wgcf-account.toml /etc/wireguard/wgcf-account.toml 1072 | cp wgcf-profile.conf /etc/wireguard/wgcf.conf 1073 | systemctl enable wg-quick@wgcf 1074 | systemctl start wg-quick@wgcf 1075 | rm -f wgcf* 1076 | yellow " 检测是否成功启动Warp!\n 显示IPV4地址:$(wget -qO- ipv4.ip.sb) " 1077 | green " 如上方显示IPV4地址:8.…………,则说明成功啦!\n 如上方显示VPS本地IP,则说明失败喽! " 1078 | } 1079 | 1080 | 1081 | function iptables(){ 1082 | sudo iptables -P INPUT ACCEPT 1083 | sudo iptables -P FORWARD ACCEPT 1084 | sudo iptables -P OUTPUT ACCEPT 1085 | sudo iptables -F 1086 | sudo apt-get purge netfilter-persistent -y 1087 | sudo reboot 1088 | } 1089 | 1090 | function BBR(){ 1091 | echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf 1092 | echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf 1093 | sysctl -p 1094 | lsmod | grep bbr 1095 | } 1096 | 1097 | function cwarp(){ 1098 | systemctl stop wg-quick@wgcf 1099 | systemctl disable wg-quick@wgcf 1100 | sudo reboot 1101 | } 1102 | 1103 | function owarp(){ 1104 | systemctl enable wg-quick@wgcf 1105 | systemctl start wg-quick@wgcf 1106 | } 1107 | 1108 | function macka(){ 1109 | sudo iptables -P INPUT ACCEPT 1110 | sudo iptables -P FORWARD ACCEPT 1111 | sudo iptables -P OUTPUT ACCEPT 1112 | sudo iptables -F 1113 | wget -P /root -N --no-check-certificate "https://raw.githubusercontent.com/mack-a/v2ray-agent/master/install.sh" && chmod 700 /root/install.sh && /root/install.sh 1114 | } 1115 | 1116 | function phlinhng(){ 1117 | sudo iptables -P INPUT ACCEPT 1118 | sudo iptables -P FORWARD ACCEPT 1119 | sudo iptables -P OUTPUT ACCEPT 1120 | sudo iptables -F 1121 | curl -fsSL https://raw.staticdn.net/phlinhng/v2ray-tcp-tls-web/main/src/xwall.sh -o ~/xwall.sh && bash ~/xwall.sh 1122 | } 1123 | 1124 | function cv46(){ 1125 | yellow "开始检测IPV4地址" 1126 | v4=`wget -qO- ipv4.ip.sb` 1127 | if [[ -z $v4 ]]; then 1128 | red " VPS当前检测不到IPV4地址 " 1129 | else 1130 | green " VPS当前正使用的IPV4地址: $v4 " 1131 | fi 1132 | yellow "开始检测IPV6地址" 1133 | v6=`wget -qO- ipv6.ip.sb` 1134 | if [[ -z $v6 ]]; then 1135 | red " VPS当前检测不到IPV6地址 " 1136 | else 1137 | green " VPS当前正使用的IPV6地址: $v6 " 1138 | fi 1139 | } 1140 | 1141 | function Netflix(){ 1142 | wget -O nf https://github.com/sjlleo/netflix-verify/releases/download/2.6/nf_2.6_linux_arm64 && chmod +x nf && clear && ./nf -method full 1143 | } 1144 | 1145 | function reboot(){ 1146 | sudo reboot 1147 | } 1148 | 1149 | function dns(){ 1150 | echo 'DNS=8.8.8.8 2001:4860:4860::8888'>> /etc/systemd/resolved.conf 1151 | systemctl restart systemd-resolved 1152 | systemctl enable systemd-resolved 1153 | mv /etc/resolv.conf /etc/resolv.conf.bak 1154 | ln -s /run/systemd/resolve/resolv.conf /etc/ 1155 | sudo reboot 1156 | } 1157 | 1158 | function arm5.11(){ 1159 | 1160 | function v46(){ 1161 | cd /tmp 1162 | wget --no-check-certificate -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11/arm64/linux-headers-5.11.0-051100-generic_5.11.0-051100.202102142330_arm64.deb 1163 | wget --no-check-certificate -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11/arm64/linux-image-unsigned-5.11.0-051100-generic_5.11.0-051100.202102142330_arm64.deb 1164 | wget --no-check-certificate -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11/arm64/linux-modules-5.11.0-051100-generic_5.11.0-051100.202102142330_arm64.deb 1165 | sudo dpkg -i *.deb 1166 | sudo apt -f install -y 1167 | sudo reboot 1168 | } 1169 | 1170 | function v6(){ 1171 | echo -e nameserver 2a00:1098:2c::1 > /etc/resolv.conf 1172 | cd /tmp 1173 | wget --no-check-certificate -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11/arm64/linux-headers-5.11.0-051100-generic_5.11.0-051100.202102142330_arm64.deb 1174 | wget --no-check-certificate -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11/arm64/linux-image-unsigned-5.11.0-051100-generic_5.11.0-051100.202102142330_arm64.deb 1175 | wget --no-check-certificate -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.11/arm64/linux-modules-5.11.0-051100-generic_5.11.0-051100.202102142330_arm64.deb 1176 | sudo dpkg -i *.deb 1177 | sudo apt -f install -y 1178 | sudo reboot 1179 | } 1180 | 1181 | function menu(){ 1182 | clear 1183 | green " 请确认当前的VPS属于以下哪种IP表现形式!" 1184 | blue " 1. 纯IPV4/双栈IPV4+IPV6 " 1185 | blue " 2. 纯IPV6 " 1186 | red " 0. 返回上一层 " 1187 | echo 1188 | read -p "请输入数字:" menuNumberInput 1189 | case "$menuNumberInput" in 1190 | 1 ) 1191 | v46 1192 | ;; 1193 | 2 ) 1194 | v6 1195 | ;; 1196 | 0 ) 1197 | start_menu 1198 | ;; 1199 | esac 1200 | } 1201 | 1202 | menu 1203 | } 1204 | 1205 | function status(){ 1206 | systemctl status wg-quick@wgcf 1207 | } 1208 | 1209 | function up4(){ 1210 | wget -N --no-check-certificate https://raw.githubusercontent.com/YG-tsj/CFWarp-Pro/main/multi.sh && chmod +x multi.sh && ./multi.sh 1211 | } 1212 | 1213 | function up6(){ 1214 | echo -e nameserver 2a00:1098:2c::1 > /etc/resolv.conf 1215 | wget -6 -N --no-check-certificate https://raw.githubusercontent.com/YG-tsj/CFWarp-Pro/main/multi.sh && chmod +x multi.sh && ./multi.sh 1216 | } 1217 | 1218 | function wro646(){ 1219 | yellow " 检测系统内核版本是否大于5.6版本 " 1220 | if [ "$main" -lt 5 ]|| [ "$minor" -lt 6 ]; then 1221 | red " 检测到内核版本小于5.6,回到菜单,选择2,自动更新内核吧" 1222 | exit 1 1223 | fi 1224 | apt update 1225 | apt -y --no-install-recommends install openresolv dnsutils wireguard-tools 1226 | wget -N -6 https://cdn.jsdelivr.net/gh/YG-tsj/CFWarp-Pro/wgcf 1227 | cp wgcf /usr/local/bin/wgcf 1228 | sudo chmod +x /usr/local/bin/wgcf 1229 | echo | wgcf register 1230 | until [ $? -eq 0 ] 1231 | do 1232 | sleep 1s 1233 | echo | wgcf register 1234 | done 1235 | wgcf generate 1236 | sed -i "5 s/^/PostUp = ip -6 rule add from $rv6 table main\n/" wgcf-profile.conf 1237 | sed -i "6 s/^/PostDown = ip -6 rule delete from $rv6 table main\n/" wgcf-profile.conf 1238 | sed -i 's/engage.cloudflareclient.com/2606:4700:d0::a29f:c001/g' wgcf-profile.conf 1239 | sed -i 's/1.1.1.1/8.8.8.8,2001:4860:4860::8888/g' wgcf-profile.conf 1240 | cp wgcf-account.toml /etc/wireguard/wgcf-account.toml 1241 | cp wgcf-profile.conf /etc/wireguard/wgcf.conf 1242 | systemctl enable wg-quick@wgcf 1243 | systemctl start wg-quick@wgcf 1244 | rm -f wgcf* 1245 | grep -qE '^[ ]*precedence[ ]*::ffff:0:0/96[ ]*100' /etc/gai.conf || echo 'precedence ::ffff:0:0/96 100' | sudo tee -a /etc/gai.conf 1246 | yellow " 检测是否成功启动(IPV4+IPV6)双栈Warp!\n 显示IPV4地址:$(wget -qO- ipv4.ip.sb) 显示IPV6地址:$(wget -qO- ipv6.ip.sb) " 1247 | green " 如上方显示IPV4地址:8.…………,IPV6地址:2a09:…………,则说明成功啦!\n 如上方IPV4无IP显示,IPV6显示本地IP,则说明失败喽!! " 1248 | } 1249 | 1250 | 1251 | 1252 | function wro66(){ 1253 | yellow " 检测系统内核版本是否大于5.6版本 " 1254 | if [ "$main" -lt 5 ]|| [ "$minor" -lt 6 ]; then 1255 | red " 检测到内核版本小于5.6,回到菜单,选择2,自动更新内核吧" 1256 | exit 1 1257 | fi 1258 | apt update 1259 | apt -y --no-install-recommends install openresolv dnsutils wireguard-tools 1260 | wget -N -6 https://cdn.jsdelivr.net/gh/YG-tsj/CFWarp-Pro/wgcf 1261 | cp wgcf /usr/local/bin/wgcf 1262 | sudo chmod +x /usr/local/bin/wgcf 1263 | echo | wgcf register 1264 | until [ $? -eq 0 ] 1265 | do 1266 | sleep 1s 1267 | echo | wgcf register 1268 | done 1269 | wgcf generate 1270 | sed -i "5 s/^/PostUp = ip -6 rule add from $rv6 table main\n/" wgcf-profile.conf 1271 | sed -i "6 s/^/PostDown = ip -6 rule delete from $rv6 table main\n/" wgcf-profile.conf 1272 | sed -i 's/engage.cloudflareclient.com/2606:4700:d0::a29f:c001/g' wgcf-profile.conf 1273 | sed -i '/0\.0\.0\.0\/0/d' wgcf-profile.conf 1274 | sed -i 's/1.1.1.1/2001:4860:4860::8888,8.8.8.8/g' wgcf-profile.conf 1275 | cp wgcf-account.toml /etc/wireguard/wgcf-account.toml 1276 | cp wgcf-profile.conf /etc/wireguard/wgcf.conf 1277 | systemctl enable wg-quick@wgcf 1278 | systemctl start wg-quick@wgcf 1279 | rm -f wgcf* 1280 | yellow " 检测是否成功启动Warp!\n 显示IPV6地址:$(wget -qO- ipv6.ip.sb) " 1281 | green " 如上方显示IPV6地址:2a09:…………,则说明成功!\n 如上方无IP显示,则说明失败喽! " 1282 | } 1283 | 1284 | 1285 | function wro64(){ 1286 | yellow " 检测系统内核版本是否大于5.6版本 " 1287 | if [ "$main" -lt 5 ]|| [ "$minor" -lt 6 ]; then 1288 | red " 检测到内核版本小于5.6,回到菜单,选择2,自动更新内核吧" 1289 | exit 1 1290 | fi 1291 | apt update 1292 | apt -y --no-install-recommends install openresolv dnsutils wireguard-tools 1293 | wget -N -6 https://cdn.jsdelivr.net/gh/YG-tsj/CFWarp-Pro/wgcf 1294 | cp wgcf /usr/local/bin/wgcf 1295 | sudo chmod +x /usr/local/bin/wgcf 1296 | echo | wgcf register 1297 | until [ $? -eq 0 ] 1298 | do 1299 | sleep 1s 1300 | echo | wgcf register 1301 | done 1302 | wgcf generate 1303 | sed -i 's/engage.cloudflareclient.com/2606:4700:d0::a29f:c001/g' wgcf-profile.conf 1304 | sed -i '/\:\:\/0/d' wgcf-profile.conf 1305 | sed -i 's/1.1.1.1/8.8.8.8,2001:4860:4860::8888/g' wgcf-profile.conf 1306 | cp wgcf-account.toml /etc/wireguard/wgcf-account.toml 1307 | cp wgcf-profile.conf /etc/wireguard/wgcf.conf 1308 | systemctl enable wg-quick@wgcf 1309 | systemctl start wg-quick@wgcf 1310 | rm -f wgcf* 1311 | grep -qE '^[ ]*precedence[ ]*::ffff:0:0/96[ ]*100' /etc/gai.conf || echo 'precedence ::ffff:0:0/96 100' | sudo tee -a /etc/gai.conf 1312 | yellow " 检测是否成功启动Warp!\n 显示IPV4地址:$(wget -qO- ipv4.ip.sb) " 1313 | green " 如上方显示IPV4地址:8.…………,则说明成功啦!\n 如上方显示VPS本地IP,则说明失败喽! " 1314 | } 1315 | 1316 | 1317 | #主菜单 1318 | function start_menu(){ 1319 | clear 1320 | 1321 | yellow " 详细说明 https://github.com/YG-tsj/CFWarp-Pro YouTube频道:甬哥探世界 " 1322 | 1323 | red " 切记:进入脚本快捷方式 bash multi.sh " 1324 | 1325 | white " ================一、VPS调整选择(更新中)==============================================" 1326 | 1327 | green " 1. 永久开启甲骨文VPS的ubuntu系统所有端口 " 1328 | 1329 | green " 2. 更新ARM架构Ubuntu系统内核至5.11版 " 1330 | 1331 | green " 3. 开启原生BBR加速 " 1332 | 1333 | green " 4. 检测奈飞Netflix是否解锁 " 1334 | 1335 | white " ================二、“内核集成模式”WARP功能选择(更新中)==================================" 1336 | 1337 | white " ----VPS原生IP数-------------------------------------添加WARP虚拟IP的位置----------" 1338 | 1339 | green " 5. 纯IPV4的VPS。 添加WARP虚拟IPV6 " 1340 | 1341 | green " 6. 纯IPV4的VPS。 添加WARP虚拟IPV4+虚拟IPV6 " 1342 | 1343 | green " 7. 纯IPV4的VPS。 添加WARP虚拟IPV4 " 1344 | 1345 | green " 8. 双栈IPV4+IPV6的VPS。 添加WARP虚拟IPV6 " 1346 | 1347 | green " 9. 双栈IPV4+IPV6的VPS。 添加WARP虚拟IPV4+虚拟IPV6 " 1348 | 1349 | green " 10. 双栈IPV4+IPV6的VPS。 添加WARP虚拟IPV4 " 1350 | 1351 | green " 11. 纯IPV6的VPS。 添加WARP虚拟IPV6 " 1352 | 1353 | green " 12. 纯IPV6的VPS。 添加WARP虚拟IPV4+虚拟IPV6 " 1354 | 1355 | green " 13. 纯IPV6的VPS。 添加WARP虚拟IPV4 " 1356 | 1357 | white " ------------------------------------------------------------------------------------------------" 1358 | 1359 | green " 14. 统一DNS功能(建议选择) " 1360 | 1361 | green " 15. 永久关闭WARP功能 " 1362 | 1363 | green " 16. 自动开启WARP功能 " 1364 | 1365 | green " 17. 有IPV4:更新脚本 " 1366 | 1367 | green " 18. 无IPV4:更新脚本 " 1368 | 1369 | white " ===============三、代理协议脚本选择(更新中)===========================================" 1370 | 1371 | green " 19.使用mack-a脚本(支持ARM架构VPS,支持协议:Xray, V2ray, Trojan-go) " 1372 | 1373 | white " =============================================================================================" 1374 | 1375 | green " 20. 重启VPS实例,请重新连接SSH " 1376 | 1377 | white " =============================================================================================" 1378 | 1379 | green " 0. 退出脚本 " 1380 | Print_ALL_Status_menu 1381 | echo 1382 | read -p "请输入数字:" menuNumberInput 1383 | case "$menuNumberInput" in 1384 | 1 ) 1385 | iptables 1386 | ;; 1387 | 2 ) 1388 | arm5.11 1389 | ;; 1390 | 3 ) 1391 | BBR 1392 | ;; 1393 | 4 ) 1394 | Netflix 1395 | ;; 1396 | 5 ) 1397 | warp6 1398 | ;; 1399 | 6 ) 1400 | warp64 1401 | ;; 1402 | 7 ) 1403 | warp4 1404 | ;; 1405 | 8 ) 1406 | warp466 1407 | ;; 1408 | 9 ) 1409 | warp4646 1410 | ;; 1411 | 10 ) 1412 | warp464 1413 | ;; 1414 | 11 ) 1415 | wro66 1416 | ;; 1417 | 12 ) 1418 | wro646 1419 | ;; 1420 | 13 ) 1421 | wro64 1422 | ;; 1423 | 14 ) 1424 | dns 1425 | ;; 1426 | 15 ) 1427 | cwarp 1428 | ;; 1429 | 16 ) 1430 | owarp 1431 | ;; 1432 | 17 ) 1433 | up4 1434 | ;; 1435 | 18 ) 1436 | up6 1437 | ;; 1438 | 19 ) 1439 | macka 1440 | ;; 1441 | 20 ) 1442 | reboot 1443 | ;; 1444 | 0 ) 1445 | exit 1 1446 | ;; 1447 | esac 1448 | } 1449 | 1450 | 1451 | start_menu "first" 1452 | 1453 | else 1454 | yellow "此CPU架构不是X86,也不是ARM!奥特曼架构?" 1455 | exit 1 1456 | fi 1457 | --------------------------------------------------------------------------------