├── scripts ├── down └── up ├── README.md ├── dnsmasq └── warp.conf ├── warp_change_ip.sh ├── switch_hk.sh ├── switch_jp.sh ├── switch_sg.sh ├── switch_us.sh ├── run_192.sh ├── run.sh └── run_arm.sh /scripts/down: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | iptables -t mangle -D PREROUTING -j fwmark 4 | iptables -t mangle -D OUTPUT -j fwmark 5 | iptables -t mangle -D fwmark -m set --match-set warp dst -j MARK --set-mark 2 6 | ip rule del fwmark 2 table warp 7 | iptables -t mangle -D POSTROUTING -o wg -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu 8 | iptables -t nat -D POSTROUTING -m mark --mark 0x2 -j MASQUERADE 9 | iptables -t mangle -F fwmark 10 | iptables -t mangle -X fwmark 11 | sleep 2 12 | ipset destroy warp -------------------------------------------------------------------------------- /scripts/up: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ipset create warp hash:ip 4 | iptables -t mangle -N fwmark 5 | iptables -t mangle -A PREROUTING -j fwmark 6 | iptables -t mangle -A OUTPUT -j fwmark 7 | iptables -t mangle -A fwmark -m set --match-set warp dst -j MARK --set-mark 2 8 | ip rule add fwmark 2 table warp 9 | ip route add default dev wg table warp 10 | iptables -t nat -A POSTROUTING -m mark --mark 0x2 -j MASQUERADE 11 | iptables -t mangle -A POSTROUTING -o wg -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### Project-WARP-Unlock 2 | 3 | #### Intro 4 | 5 | 旨在借由Cloudflare WARP一键解锁大部分流媒体的脚本 6 | 7 | 工作原理: 8 | 9 | - 安装ipset+dnsmasq+wireguard 10 | - 禁用wireguard的自动路由 11 | - 将vps的解析交由dnsmasq处理,为了将解析结果自动放入ipset 12 | - 使用iptables为ipset中的ip打上mark,再让这些ip走特定的路由表 13 | - 特定的路由表中仅存在一条使用wireguard的默认路由 14 | 15 | 特点: 16 | 17 | - 汉化了原版脚本,同时Warp分流规则增加了Twitter for AWS,Cygames等等 18 | 19 | 20 | 21 | 一键起飞: 22 | 23 | For AMD64: 24 | ```` 25 | curl -sL https://raw.githubusercontent.com/GeorgeXie2333/Project-WARP-Unlock/main/run.sh | bash 26 | ```` 27 | For ARM64: 28 | ```` 29 | curl -sL https://raw.githubusercontent.com/GeorgeXie2333/Project-WARP-Unlock/main/run_arm.sh | bash 30 | ```` 31 | Warp自动换IP为NF解锁IP(修改自luoxue-bot/warp_auto_change_ip): 32 | ```` 33 | wget https://github.com/GeorgeXie2333/Project-WARP-Unlock/raw/main/warp_change_ip.sh && chmod +x warp_change_ip.sh && ./warp_change_ip.sh 34 | ```` 35 | 如果遇到解决不了的问题,欢迎加入Telegram频道:@cutenicobest 探讨 36 | 37 | 依赖并不多,所以并无卸载脚本提供,`systemctl disable wg-quick@wg --now` 然后重启即可 38 | 39 | 40 | 41 | #### 后话 42 | 43 | - 能力强的可以根据脚本内容自行改动,该方法适用性强,可应用于其他的VPN应用分流 44 | 45 | - WireGuard因为需要适配太多数情况,所以iptables规则清除较为暴力。如果原本配有iptables规则的建议自行修改部分清除规则,以达到最佳效果 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /dnsmasq/warp.conf: -------------------------------------------------------------------------------- 1 | server=1.1.1.1 2 | server=8.8.8.8 3 | # ----- WARP ----- # 4 | # > Youtube Premium 5 | server=/googlevideo.com/1.1.1.1 6 | server=/youtube.com/1.1.1.1 7 | server=/youtubei.googleapis.com/1.1.1.1 8 | server=/fonts.googleapis.com/1.1.1.1 9 | server=/yt3.ggpht.com/1.1.1.1 10 | server=/gstatic.com/1.1.1.1 11 | 12 | ipset=/googlevideo.com/warp 13 | ipset=/youtube.com/warp 14 | ipset=/youtubei.googleapis.com/warp 15 | ipset=/fonts.googleapis.com/warp 16 | ipset=/yt3.ggpht.com/warp 17 | 18 | # > Netflix 19 | ipset=/fast.com/warp 20 | ipset=/netflix.com/warp 21 | ipset=/netflix.net/warp 22 | ipset=/nflxext.com/warp 23 | ipset=/nflximg.com/warp 24 | ipset=/nflximg.net/warp 25 | ipset=/nflxso.net/warp 26 | ipset=/nflxvideo.net/warp 27 | 28 | # > TVBAnywhere+ 29 | ipset=/uapisfm.tvbanywhere.com.sg/warp 30 | 31 | # > Disney+ 32 | ipset=/bamgrid.com/warp 33 | ipset=/disney-plus.net/warp 34 | ipset=/disneyplus.com/warp 35 | ipset=/dssott.com/warp 36 | ipset=/disneynow.com/warp 37 | ipset=/disneystreaming.com/warp 38 | ipset=/cdn.registerdisney.go.com/warp 39 | 40 | # > TikTok 41 | ipset=/byteoversea.com/warp 42 | ipset=/ibytedtos.com/warp 43 | ipset=/ipstatp.com/warp 44 | ipset=/muscdn.com/warp 45 | ipset=/musical.ly/warp 46 | ipset=/tiktok.com/warp 47 | ipset=/tik-tokapi.com/warp 48 | ipset=/tiktokcdn.com/warp 49 | ipset=/tiktokv.com/warp 50 | 51 | # > Games 52 | ipset=/cygames.jp/warp 53 | ipset=/cygames.co.jp/warp 54 | 55 | # > Twitter for AWS 56 | ipset=/twitter.com/warp 57 | ipset=/twitter.jp/warp 58 | ipset=/twitterfeed.com/warp 59 | ipset=/twittergadget.com/warp 60 | ipset=/twitterkr.com/warp 61 | ipset=/twittermail.com/warp 62 | -------------------------------------------------------------------------------- /warp_change_ip.sh: -------------------------------------------------------------------------------- 1 | #bin/bash! 2 | 3 | #Github @luoxue-bot 4 | #Blog https://ty.al 5 | 6 | UA_Browser="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36" 7 | read -r -p "WARP是否已安装? [y/n] " input 8 | if [[ "$input" == "n" ]];then 9 | curl -sL https://raw.githubusercontent.com/GeorgeXie2333/Project-WARP-Unlock/main/run.sh | bash 10 | elif [[ "$input" == "y" ]];then 11 | read -r -p "请输入你需要的国家/地区代码(e.g. HK,SG):" area 12 | fi 13 | while [[ "$input" == "y" ]] 14 | do 15 | result=$(curl --user-agent "${UA_Browser}" -fsL --write-out %{http_code} --output /dev/null --max-time 10 "https://www.netflix.com/title/81215567" 2>&1) 16 | if [[ "$result" == "404" ]];then 17 | echo -e "检测结果:Originals Only, 正在更换IP..." 18 | systemctl restart wg-quick@wg 19 | sleep 5 20 | 21 | elif [[ "$result" == "403" ]];then 22 | echo -e "检测结果:No, 正在更换IP..." 23 | systemctl restart wg-quick@wg 24 | sleep 5 25 | 26 | elif [[ "$result" == "200" ]];then 27 | region=`tr [:lower:] [:upper:] <<< $(curl --user-agent "${UA_Browser}" -fs --max-time 10 --write-out %{redirect_url} --output /dev/null "https://www.netflix.com/title/80018499" | cut -d '/' -f4 | cut -d '-' -f1)` ; 28 | if [[ ! "$region" ]];then 29 | region="US"; 30 | fi 31 | if [[ "$region" != "$area" ]];then 32 | echo -e "Netflix Region: ${region} 并非需要的地区, 正在更换IP..." 33 | systemctl restart wg-quick@wg 34 | sleep 5 35 | else 36 | echo -e "Netflix Region: ${region} 成功, 监控中...5分钟后将再次检测" 37 | sleep 300 38 | fi 39 | 40 | elif [[ "$result" == "000" ]];then 41 | echo -e "失败,正在重试..." 42 | systemctl restart wg-quick@wg 43 | sleep 5 44 | fi 45 | done 46 | -------------------------------------------------------------------------------- /switch_hk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /etc/profile 4 | 5 | # Variation 6 | Interface=wg 7 | Region=hk 8 | Hostname= 9 | Telegram_Token= 10 | Telegram_ChatID= 11 | Count=0 12 | URL_Message="https://api.telegram.org/bot$Telegram_Token/sendMessage" 13 | UA_Browser="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36" 14 | 15 | function Start { 16 | echo -e " [Intro] One-Click Automatically Change IP Script for Cloudflare-WARP" 17 | echo -e " [Intro] Test System:Ubuntu 20" 18 | echo -e " [Intro] OpenSource-Project:https://github.com/acacia233/Project-WARP-Unlock" 19 | echo -e " [Intro] Telegram Channel:https://t.me/cutenicobest" 20 | echo -e " [Intro] Version:2021-10-7-1" 21 | Test_Netflix_Access 22 | } 23 | 24 | function Test_Netflix_Access { 25 | local result1="$(curl --interface $Interface --user-agent "${UA_Browser}" -fsL --write-out %{http_code} --output /dev/null --max-time 5 "https://www.netflix.com/title/81215567" 2>&1)" 26 | local result2="$(curl --interface $Interface --user-agent "${UA_Browser}" -fs --max-time 10 --write-out %{redirect_url} --output /dev/null "https://www.netflix.com/title/80018499" | cut -d '/' -f4 | cut -d '-' -f1 2>&1)" 27 | if [[ "$result1" == "200" ]] && [[ "$result2" == "$Region" ]]; then 28 | Judge 29 | else 30 | ChangeIP 31 | fi 32 | } 33 | 34 | function ChangeIP { 35 | wg-quick down $Interface >/dev/null 2>&1 36 | sleep 2 37 | wg-quick up $Interface >/dev/null 2>&1 38 | let Count++ 39 | Test_Netflix_Access 40 | } 41 | 42 | function Judge { 43 | if [[ $Count == 0 ]];then 44 | sleep 10 45 | echo -e " [Info] Still Working,Skipped..." 46 | Test_Netflix_Access 47 | else 48 | PushNotification 49 | Test_Netflix_Access 50 | fi 51 | } 52 | 53 | function PushNotification { 54 | local Message="New WARP IP for Netflix%0ANode:$Hostname%0AChange Times:$Count" 55 | echo -e " [Info] Change Times:$Count" 56 | curl -s -X POST $URL_Message -d chat_id=$Telegram_ChatID -d text="$Message" >/dev/null 57 | Count=0 58 | } 59 | 60 | Start 61 | -------------------------------------------------------------------------------- /switch_jp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /etc/profile 4 | 5 | # Variation 6 | Interface=wg 7 | Region=jp 8 | Hostname= 9 | Telegram_Token= 10 | Telegram_ChatID= 11 | Count=0 12 | URL_Message="https://api.telegram.org/bot$Telegram_Token/sendMessage" 13 | UA_Browser="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36" 14 | 15 | function Start { 16 | echo -e " [Intro] One-Click Automatically Change IP Script for Cloudflare-WARP" 17 | echo -e " [Intro] Test System:Ubuntu 20" 18 | echo -e " [Intro] OpenSource-Project:https://github.com/acacia233/Project-WARP-Unlock" 19 | echo -e " [Intro] Telegram Channel:https://t.me/cutenicobest" 20 | echo -e " [Intro] Version:2021-10-7-1" 21 | Test_Netflix_Access 22 | } 23 | 24 | function Test_Netflix_Access { 25 | local result1="$(curl --interface $Interface --user-agent "${UA_Browser}" -fsL --write-out %{http_code} --output /dev/null --max-time 5 "https://www.netflix.com/title/81215567" 2>&1)" 26 | local result2="$(curl --interface $Interface --user-agent "${UA_Browser}" -fs --max-time 10 --write-out %{redirect_url} --output /dev/null "https://www.netflix.com/title/80018499" | cut -d '/' -f4 | cut -d '-' -f1 2>&1)" 27 | if [[ "$result1" == "200" ]] && [[ "$result2" == "$Region" ]]; then 28 | Judge 29 | else 30 | ChangeIP 31 | fi 32 | } 33 | 34 | function ChangeIP { 35 | wg-quick down $Interface >/dev/null 2>&1 36 | sleep 2 37 | wg-quick up $Interface >/dev/null 2>&1 38 | let Count++ 39 | Test_Netflix_Access 40 | } 41 | 42 | function Judge { 43 | if [[ $Count == 0 ]];then 44 | sleep 10 45 | echo -e " [Info] Still Working,Skipped..." 46 | Test_Netflix_Access 47 | else 48 | PushNotification 49 | Test_Netflix_Access 50 | fi 51 | } 52 | 53 | function PushNotification { 54 | local Message="New WARP IP for Netflix%0ANode:$Hostname%0AChange Times:$Count" 55 | echo -e " [Info] Change Times:$Count" 56 | curl -s -X POST $URL_Message -d chat_id=$Telegram_ChatID -d text="$Message" >/dev/null 57 | Count=0 58 | } 59 | 60 | Start 61 | -------------------------------------------------------------------------------- /switch_sg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /etc/profile 4 | 5 | # Variation 6 | Interface=wg 7 | Region=sg 8 | Hostname= 9 | Telegram_Token= 10 | Telegram_ChatID= 11 | Count=0 12 | URL_Message="https://api.telegram.org/bot$Telegram_Token/sendMessage" 13 | UA_Browser="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36" 14 | 15 | function Start { 16 | echo -e " [Intro] One-Click Automatically Change IP Script for Cloudflare-WARP" 17 | echo -e " [Intro] Test System:Ubuntu 20" 18 | echo -e " [Intro] OpenSource-Project:https://github.com/acacia233/Project-WARP-Unlock" 19 | echo -e " [Intro] Telegram Channel:https://t.me/cutenicobest" 20 | echo -e " [Intro] Version:2021-10-7-1" 21 | Test_Netflix_Access 22 | } 23 | 24 | function Test_Netflix_Access { 25 | local result1="$(curl --interface $Interface --user-agent "${UA_Browser}" -fsL --write-out %{http_code} --output /dev/null --max-time 5 "https://www.netflix.com/title/81215567" 2>&1)" 26 | local result2="$(curl --interface $Interface --user-agent "${UA_Browser}" -fs --max-time 10 --write-out %{redirect_url} --output /dev/null "https://www.netflix.com/title/80018499" | cut -d '/' -f4 | cut -d '-' -f1 2>&1)" 27 | if [[ "$result1" == "200" ]] && [[ "$result2" == "$Region" ]]; then 28 | Judge 29 | else 30 | ChangeIP 31 | fi 32 | } 33 | 34 | function ChangeIP { 35 | wg-quick down $Interface >/dev/null 2>&1 36 | sleep 2 37 | wg-quick up $Interface >/dev/null 2>&1 38 | let Count++ 39 | Test_Netflix_Access 40 | } 41 | 42 | function Judge { 43 | if [[ $Count == 0 ]];then 44 | sleep 10 45 | echo -e " [Info] Still Working,Skipped..." 46 | Test_Netflix_Access 47 | else 48 | PushNotification 49 | Test_Netflix_Access 50 | fi 51 | } 52 | 53 | function PushNotification { 54 | local Message="New WARP IP for Netflix%0ANode:$Hostname%0AChange Times:$Count" 55 | echo -e " [Info] Change Times:$Count" 56 | curl -s -X POST $URL_Message -d chat_id=$Telegram_ChatID -d text="$Message" >/dev/null 57 | Count=0 58 | } 59 | 60 | Start 61 | -------------------------------------------------------------------------------- /switch_us.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /etc/profile 4 | 5 | # Variation 6 | Interface=wg 7 | Region=us 8 | Hostname= 9 | Telegram_Token= 10 | Telegram_ChatID= 11 | Count=0 12 | URL_Message="https://api.telegram.org/bot$Telegram_Token/sendMessage" 13 | UA_Browser="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36" 14 | 15 | function Start { 16 | echo -e " [Intro] One-Click Automatically Change IP Script for Cloudflare-WARP" 17 | echo -e " [Intro] Test System:Ubuntu 20" 18 | echo -e " [Intro] OpenSource-Project:https://github.com/acacia233/Project-WARP-Unlock" 19 | echo -e " [Intro] Telegram Channel:https://t.me/cutenicobest" 20 | echo -e " [Intro] Version:2021-10-7-1" 21 | Test_Netflix_Access 22 | } 23 | 24 | function Test_Netflix_Access { 25 | local result1="$(curl --interface $Interface --user-agent "${UA_Browser}" -fsL --write-out %{http_code} --output /dev/null --max-time 5 "https://www.netflix.com/title/81215567" 2>&1)" 26 | local result2="$(curl --interface $Interface --user-agent "${UA_Browser}" -fs --max-time 10 --write-out %{redirect_url} --output /dev/null "https://www.netflix.com/title/80018499" | cut -d '/' -f4 | cut -d '-' -f1 2>&1)" 27 | if [[ "$result1" == "200" ]] && [[ "$result2" == "$Region" ]]; then 28 | Judge 29 | else 30 | ChangeIP 31 | fi 32 | } 33 | 34 | function ChangeIP { 35 | wg-quick down $Interface >/dev/null 2>&1 36 | sleep 2 37 | wg-quick up $Interface >/dev/null 2>&1 38 | let Count++ 39 | Test_Netflix_Access 40 | } 41 | 42 | function Judge { 43 | if [[ $Count == 0 ]];then 44 | sleep 10 45 | echo -e " [Info] Still Working,Skipped..." 46 | Test_Netflix_Access 47 | else 48 | PushNotification 49 | Test_Netflix_Access 50 | fi 51 | } 52 | 53 | function PushNotification { 54 | local Message="New WARP IP for Netflix%0ANode:$Hostname%0AChange Times:$Count" 55 | echo -e " [Info] Change Times:$Count" 56 | curl -s -X POST $URL_Message -d chat_id=$Telegram_ChatID -d text="$Message" >/dev/null 57 | Count=0 58 | } 59 | 60 | Start 61 | -------------------------------------------------------------------------------- /run_192.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # > System:Ubuntu 20 4 | 5 | source /etc/profile 6 | 7 | function Start { 8 | echo -e " Cloudflare WARP 一键流媒体解锁脚本[汉化版]" 9 | echo -e " 测试系统:Ubuntu 20,Debian 11" 10 | echo -e " 开源项目:https://github.com/GeorgeXie2333/Project-WARP-Unlock" 11 | echo -e " Telegram频道:https://t.me/cutenicobest" 12 | echo -e " 版本:2021-11-03-1" 13 | echo -e " 若你的服务器系统内核版本小于5.6,请按 Ctrl + C 退出..." 14 | Check_System_Depandencies 15 | } 16 | 17 | function Check_System_Depandencies { 18 | echo -e " [信息] 正在安装依赖..." 19 | apt-get update >/dev/null 20 | apt-get install -yq ipset dnsmasq wireguard resolvconf mtr >/dev/null 2>&1 21 | Download_Profile 22 | Generate_WireGuard_WARP_Profile 23 | } 24 | 25 | function Download_Profile { 26 | wget -qO /etc/dnsmasq.d/warp.conf https://raw.githubusercontent.com/GeorgeXie2333/Project-WARP-Unlock/main/dnsmasq/warp.conf 27 | wget -qO /etc/wireguard/up https://raw.githubusercontent.com/GeorgeXie2333/Project-WARP-Unlock/main/scripts/up 28 | wget -qO /etc/wireguard/down https://raw.githubusercontent.com/GeorgeXie2333/Project-WARP-Unlock/main/scripts/down 29 | chmod +x /etc/wireguard/up 30 | chmod +x /etc/wireguard/down 31 | } 32 | 33 | function Generate_WireGuard_WARP_Profile { 34 | echo -e " [信息] 正在生成 WARP 配置文件,请稍后..." 35 | wget -qO /etc/wireguard/wgcf https://github.com/ViRb3/wgcf/releases/download/v2.2.8/wgcf_2.2.8_linux_amd64 36 | chmod +x /etc/wireguard/wgcf 37 | /etc/wireguard/wgcf register --accept-tos --config /etc/wireguard/wgcf-account.toml >/dev/null 2>&1 38 | sleep 10 39 | /etc/wireguard/wgcf generate --config /etc/wireguard/wgcf-account.toml --profile /etc/wireguard/wg.conf >/dev/null 2>&1 40 | sleep 10 41 | sed -i '7 i Table = off' /etc/wireguard/wg.conf 42 | sed -i '8 i PostUp = /etc/wireguard/up' /etc/wireguard/wg.conf 43 | sed -i '9 i Predown = /etc/wireguard/down' /etc/wireguard/wg.conf 44 | sed -i '15 i PersistentKeepalive = 5' /etc/wireguard/wg.conf 45 | sed -i "s/engage.cloudflareclient.com/162.159.192.1/g" /etc/wireguard/wg.conf 46 | Routing_WireGuard_WARP 47 | } 48 | 49 | function Routing_WireGuard_WARP { 50 | local rt_tables_status="$(cat /etc/iproute2/rt_tables | grep warp)" 51 | if [[ ! -n "$rt_tables_status" ]]; then 52 | echo '250 warp' >>/etc/iproute2/rt_tables 53 | echo -e " [信息] 路由创建中..." 54 | fi 55 | systemctl disable systemd-resolved --now >/dev/null 2>&1 56 | sleep 2 57 | systemctl enable dnsmasq --now >/dev/null 2>&1 58 | sleep 2 59 | systemctl enable wg-quick@wg --now >/dev/null 2>&1 60 | sleep 2 61 | systemctl restart dnsmasq >/dev/null 2>&1 62 | echo 'nameserver 127.0.0.1' > /etc/resolv.conf 63 | Check_finished 64 | } 65 | 66 | function Check_finished { 67 | local wireguard_status="$(ip link | grep wg)" 68 | if [[ "$wireguard_status" != *"wg"* ]]; then 69 | echo -e " [信息] WireGuard 未运行,尝试重启..." 70 | systemctl restart wg-quick@wg 71 | else 72 | echo -e " [信息] WireGuard 运行中,正在检查连接..." 73 | fi 74 | local connection_status="$(ping 1.1.1.1 -I wg -c 1 2>&1)" 75 | if [[ "$connection_status" != *"unreachable"* ]] && [[ "$connection_status" != *"Unreachable"* ]] && [[ "$connection_status" != *"SO_BINDTODEVICE"* ]] && [[ "$connection_status" != *"100% packet loss"* ]]; then 76 | echo -e " [信息] 连接已建立..." 77 | else 78 | echo -e " [错误] 连接被拒绝,请手动检查!" 79 | exit 80 | fi 81 | local routing_status="$(mtr -4wn -c 1 youtube.com)" 82 | if [[ "$routing_status" != *"172.16.0.1"* ]]; then 83 | echo -e " [错误] 路由配置有误,请重新检查!" 84 | else 85 | echo -e " [信息] 已成功接入Warp!" 86 | echo -e " [原项目作者赞助信息] USDT-TRC20:TCXfFzEQ7s968s4XiWzjNGdjuuew3CzLiF" 87 | fi 88 | } 89 | 90 | Start 91 | -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # > System:Ubuntu 20 4 | 5 | source /etc/profile 6 | 7 | function Start { 8 | echo -e " Cloudflare WARP 一键流媒体解锁脚本[汉化版]" 9 | echo -e " 测试系统:Ubuntu 20,Debian 11" 10 | echo -e " 开源项目:https://github.com/GeorgeXie2333/Project-WARP-Unlock" 11 | echo -e " Telegram频道:https://t.me/cutenicobest" 12 | echo -e " 版本:2021-11-03-1" 13 | echo -e " 若你的服务器系统内核版本小于5.6,请按 Ctrl + C 退出..." 14 | sleep 5 15 | Check_System_Depandencies 16 | } 17 | 18 | function Check_System_Depandencies { 19 | echo -e " [信息] 正在安装依赖..." 20 | apt-get update >/dev/null 21 | apt-get install -yq ipset dnsmasq wireguard resolvconf mtr >/dev/null 2>&1 22 | Download_Profile 23 | Generate_WireGuard_WARP_Profile 24 | } 25 | 26 | function Download_Profile { 27 | wget -qO /etc/dnsmasq.d/warp.conf https://raw.githubusercontent.com/GeorgeXie2333/Project-WARP-Unlock/main/dnsmasq/warp.conf 28 | wget -qO /etc/wireguard/up https://raw.githubusercontent.com/GeorgeXie2333/Project-WARP-Unlock/main/scripts/up 29 | wget -qO /etc/wireguard/down https://raw.githubusercontent.com/GeorgeXie2333/Project-WARP-Unlock/main/scripts/down 30 | chmod +x /etc/wireguard/up 31 | chmod +x /etc/wireguard/down 32 | } 33 | 34 | function Generate_WireGuard_WARP_Profile { 35 | echo -e " [信息] 正在生成 WARP 配置文件,请稍后..." 36 | wget -qO /etc/wireguard/wgcf https://github.com/ViRb3/wgcf/releases/download/v2.2.8/wgcf_2.2.8_linux_amd64 37 | chmod +x /etc/wireguard/wgcf 38 | /etc/wireguard/wgcf register --accept-tos --config /etc/wireguard/wgcf-account.toml >/dev/null 2>&1 39 | sleep 10 40 | /etc/wireguard/wgcf generate --config /etc/wireguard/wgcf-account.toml --profile /etc/wireguard/wg.conf >/dev/null 2>&1 41 | sleep 10 42 | sed -i '7 i Table = off' /etc/wireguard/wg.conf 43 | sed -i '8 i PostUp = /etc/wireguard/up' /etc/wireguard/wg.conf 44 | sed -i '9 i Predown = /etc/wireguard/down' /etc/wireguard/wg.conf 45 | sed -i '15 i PersistentKeepalive = 5' /etc/wireguard/wg.conf 46 | sed -i "s/engage.cloudflareclient.com/162.159.193.1/g" /etc/wireguard/wg.conf 47 | Routing_WireGuard_WARP 48 | } 49 | 50 | function Routing_WireGuard_WARP { 51 | local rt_tables_status="$(cat /etc/iproute2/rt_tables | grep warp)" 52 | if [[ ! -n "$rt_tables_status" ]]; then 53 | echo '250 warp' >>/etc/iproute2/rt_tables 54 | echo -e " [信息] 路由创建中..." 55 | fi 56 | systemctl disable systemd-resolved --now >/dev/null 2>&1 57 | sleep 2 58 | systemctl enable dnsmasq --now >/dev/null 2>&1 59 | sleep 2 60 | systemctl enable wg-quick@wg --now >/dev/null 2>&1 61 | sleep 2 62 | systemctl restart dnsmasq >/dev/null 2>&1 63 | echo 'nameserver 127.0.0.1' > /etc/resolv.conf 64 | Check_finished 65 | } 66 | 67 | function Check_finished { 68 | local wireguard_status="$(ip link | grep wg)" 69 | if [[ "$wireguard_status" != *"wg"* ]]; then 70 | echo -e " [信息] WireGuard 未运行,尝试重启..." 71 | systemctl restart wg-quick@wg 72 | else 73 | echo -e " [信息] WireGuard 运行中,正在检查连接..." 74 | fi 75 | local connection_status="$(ping 1.1.1.1 -I wg -c 1 2>&1)" 76 | if [[ "$connection_status" != *"unreachable"* ]] && [[ "$connection_status" != *"Unreachable"* ]] && [[ "$connection_status" != *"SO_BINDTODEVICE"* ]] && [[ "$connection_status" != *"100% packet loss"* ]]; then 77 | echo -e " [信息] 连接已建立..." 78 | else 79 | echo -e " [错误] 连接被拒绝,请手动检查!" 80 | exit 81 | fi 82 | local routing_status="$(mtr -4wn -c 1 youtube.com)" 83 | if [[ "$routing_status" != *"172.16.0.1"* ]]; then 84 | echo -e " [错误] 路由配置有误,请重新检查!" 85 | else 86 | echo -e " [信息] 已成功接入Warp!" 87 | echo -e " [原项目作者赞助信息] USDT-TRC20:TCXfFzEQ7s968s4XiWzjNGdjuuew3CzLiF" 88 | fi 89 | } 90 | 91 | Start 92 | -------------------------------------------------------------------------------- /run_arm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # > System:Ubuntu 20 4 | 5 | source /etc/profile 6 | 7 | function Start { 8 | echo -e " Cloudflare WARP 一键流媒体解锁脚本 For ARM64 [汉化版]" 9 | echo -e " 测试系统:Ubuntu 20,Debian 11" 10 | echo -e " 开源项目:https://github.com/GeorgeXie2333/Project-WARP-Unlock" 11 | echo -e " Telegram频道:https://t.me/cutenicobest" 12 | echo -e " 版本:2021-11-03-1" 13 | echo -e " 若你的服务器系统内核版本小于5.6,请按 Ctrl + C 退出..." 14 | sleep 5 15 | Check_System_Depandencies 16 | } 17 | 18 | function Check_System_Depandencies { 19 | echo -e " [信息] 正在安装依赖..." 20 | apt-get update >/dev/null 21 | apt-get install -yq ipset dnsmasq wireguard resolvconf mtr >/dev/null 2>&1 22 | Download_Profile 23 | Generate_WireGuard_WARP_Profile 24 | } 25 | 26 | function Download_Profile { 27 | wget -qO /etc/dnsmasq.d/warp.conf https://raw.githubusercontent.com/GeorgeXie2333/Project-WARP-Unlock/main/dnsmasq/warp.conf 28 | wget -qO /etc/wireguard/up https://raw.githubusercontent.com/GeorgeXie2333/Project-WARP-Unlock/main/scripts/up 29 | wget -qO /etc/wireguard/down https://raw.githubusercontent.com/GeorgeXie2333/Project-WARP-Unlock/main/scripts/down 30 | chmod +x /etc/wireguard/up 31 | chmod +x /etc/wireguard/down 32 | } 33 | 34 | function Generate_WireGuard_WARP_Profile { 35 | echo -e " [信息] 正在生成 WARP 配置文件,请稍后..." 36 | wget -qO /etc/wireguard/wgcf https://github.com/ViRb3/wgcf/releases/download/v2.2.8/wgcf_2.2.8_linux_arm64 37 | chmod +x /etc/wireguard/wgcf 38 | /etc/wireguard/wgcf register --accept-tos --config /etc/wireguard/wgcf-account.toml >/dev/null 2>&1 39 | sleep 10 40 | /etc/wireguard/wgcf generate --config /etc/wireguard/wgcf-account.toml --profile /etc/wireguard/wg.conf >/dev/null 2>&1 41 | sleep 10 42 | sed -i '7 i Table = off' /etc/wireguard/wg.conf 43 | sed -i '8 i PostUp = /etc/wireguard/up' /etc/wireguard/wg.conf 44 | sed -i '9 i Predown = /etc/wireguard/down' /etc/wireguard/wg.conf 45 | sed -i '15 i PersistentKeepalive = 5' /etc/wireguard/wg.conf 46 | sed -i "s/engage.cloudflareclient.com/162.159.193.1/g" /etc/wireguard/wg.conf 47 | Routing_WireGuard_WARP 48 | } 49 | 50 | function Routing_WireGuard_WARP { 51 | local rt_tables_status="$(cat /etc/iproute2/rt_tables | grep warp)" 52 | if [[ ! -n "$rt_tables_status" ]]; then 53 | echo '250 warp' >>/etc/iproute2/rt_tables 54 | echo -e " [信息] 路由创建中..." 55 | fi 56 | systemctl disable systemd-resolved --now >/dev/null 2>&1 57 | sleep 2 58 | systemctl enable dnsmasq --now >/dev/null 2>&1 59 | sleep 2 60 | systemctl enable wg-quick@wg --now >/dev/null 2>&1 61 | sleep 2 62 | systemctl restart dnsmasq >/dev/null 2>&1 63 | echo 'nameserver 127.0.0.1' > /etc/resolv.conf 64 | Check_finished 65 | } 66 | 67 | function Check_finished { 68 | local wireguard_status="$(ip link | grep wg)" 69 | if [[ "$wireguard_status" != *"wg"* ]]; then 70 | echo -e " [信息] WireGuard 未运行,尝试重启..." 71 | systemctl restart wg-quick@wg 72 | else 73 | echo -e " [信息] WireGuard 运行中,正在检查连接..." 74 | fi 75 | local connection_status="$(ping 1.1.1.1 -I wg -c 1 2>&1)" 76 | if [[ "$connection_status" != *"unreachable"* ]] && [[ "$connection_status" != *"Unreachable"* ]] && [[ "$connection_status" != *"SO_BINDTODEVICE"* ]] && [[ "$connection_status" != *"100% packet loss"* ]]; then 77 | echo -e " [信息] 连接已建立..." 78 | else 79 | echo -e " [错误] 连接被拒绝,请手动检查!" 80 | exit 81 | fi 82 | local routing_status="$(mtr -4wn -c 1 youtube.com)" 83 | if [[ "$routing_status" != *"172.16.0.1"* ]]; then 84 | echo -e " [错误] 路由配置有误,请重新检查!" 85 | else 86 | echo -e " [信息] 已成功接入Warp!" 87 | echo -e " [原项目作者赞助信息] USDT-TRC20:TCXfFzEQ7s968s4XiWzjNGdjuuew3CzLiF" 88 | fi 89 | } 90 | 91 | Start 92 | --------------------------------------------------------------------------------