├── README.md └── ez-warp.sh /README.md: -------------------------------------------------------------------------------- 1 | # Easy WARP 2 | this script installs and configurates Cloudflare WARP with Wireguard core on linux based devices 3 | 4 | ## Features 5 | 6 | - Support for variety of cpu architectures 7 | - Can add custom license key (WARP+ support) 8 | - better and more efficent warp configuration compared to warp configuration via proxy (SOCKS5 port: 40000) 9 | - uses less resources and has more speed 10 | 11 | ## Install 12 | 13 | **run the script as root** 14 | 1. run this command: 15 | ```bash 16 | bash <(curl -Ls https://raw.githubusercontent.com/mikeesierrah/ez-warp/main/ez-warp.sh) 17 | ``` 18 | 2. check if WARP interface is running properly via running 'wg' command 19 | ```bash 20 | wg 21 | ``` 22 | 23 | ## Custom license 24 | script asks for your custom license key , you can use it to enable WARP+. 25 | **if you deny the script automatically installs WARP free** 26 | 27 | ## Tip 28 | if you are using xray you should add this configuration to your 'outband': 29 | ```json 30 | { 31 | "tag": "warp", 32 | "protocol": "freedom", 33 | "streamSettings": { 34 | "sockopt": { 35 | "tcpFastOpen": true, 36 | "interface": "warp" 37 | } 38 | } 39 | } 40 | ``` 41 | then set the routing properly as instructed by [XRAY documentation](https://xtls.github.io/en/config/routing.html) 42 | 43 | ## DONATION 44 | if you want to appreciate me donate 5$ to a person in need 45 | -------------------------------------------------------------------------------- /ez-warp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | #necessary functions 5 | architecture() { 6 | case "$(uname -m)" in 7 | 'i386' | 'i686') arch='386' ;; 8 | 'x86_64') arch='amd64' ;; 9 | 'armv5tel') arch='armv5' ;; 10 | 'armv6l') arch='armv6' ;; 11 | 'armv7' | 'armv7l') arch='armv7' ;; 12 | 'aarch64') arch='arm64' ;; 13 | 'mips64el') arch='mips64le_softfloat' ;; 14 | 'mips64') arch='mips64_softfloat' ;; 15 | 'mipsel') arch='mipsle_softfloat' ;; 16 | 'mips') arch='mips_softfloat' ;; 17 | 's390x') arch='s390x' ;; 18 | *) echo "error: The architecture is not supported."; return 1 ;; 19 | esac 20 | echo "$arch" 21 | } 22 | 23 | #check user status 24 | if [ "$(id -u)" -ne 0 ]; then 25 | echo "This script requires root privileges. Please run it as root." 26 | exit 1 27 | fi 28 | #installing necessary packages 29 | 30 | apt update 31 | ubuntu_major_version=$(grep DISTRIB_RELEASE /etc/lsb-release | cut -d'=' -f2 | cut -d'.' -f1) 32 | if [[ "$ubuntu_major_version" == "24" ]]; then 33 | sudo apt install -y wireguard 34 | else 35 | sudo apt install -y wireguard-dkms wireguard-tools resolvconf 36 | fi 37 | 38 | 39 | 40 | #checking packages 41 | if ! command -v wg-quick &> /dev/null 42 | then 43 | echo "something went wrong with wireguard package installation" 44 | exit 1 45 | fi 46 | if ! command -v resolvconf &> /dev/null 47 | then 48 | echo "something went wrong with resolvconf package installation" 49 | exit 1 50 | fi 51 | 52 | clear 53 | #downloading assets 54 | arch=$(architecture) 55 | wget -O "/usr/bin/wgcf" https://github.com/ViRb3/wgcf/releases/download/v2.2.29/wgcf_2.2.29_linux_$arch 56 | chmod +x /usr/bin/wgcf 57 | 58 | 59 | 60 | clear 61 | # removing files that might cause problems 62 | 63 | rm -rf wgcf-account.toml &> /dev/null || true 64 | rm -rf /etc/wireguard/warp.conf &> /dev/null || true 65 | # main dish 66 | 67 | wgcf register --accept-tos || true 68 | read -rp "Do you want to use your own key? (Y/n): " response 69 | if [[ $response =~ ^[Yy]$ ]]; then 70 | read -rp "ENTER YOUR LICENSE: " LICENSE_KEY 71 | sed -i "s/license_key = '.*'/license_key = '$LICENSE_KEY'/" wgcf-account.toml 72 | wgcf update 73 | fi 74 | 75 | wgcf generate 76 | 77 | 78 | 79 | #creating config in the wireguard directory 80 | 81 | # this algorithm is deprecated 82 | 83 | # PRIVATE_KEY=$(grep -oP 'PrivateKey\s*=\s*\K.*' wgcf-profile.conf) 84 | # cat << EOF > "/etc/wireguard/warp.conf" 85 | # [Interface] 86 | # PrivateKey = $PRIVATE_KEY 87 | # Address = 172.16.0.2/32 88 | # Address = 2606:4700:110:8a1a:85ef:da37:b891:8d01/128 89 | # DNS = 1.1.1.1 90 | # MTU = 1280 91 | # Table = off 92 | # [Peer] 93 | # PublicKey = bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo= 94 | # AllowedIPs = 0.0.0.0/0 95 | # AllowedIPs = ::/0 96 | # Endpoint = engage.cloudflareclient.com:2408 97 | # EOF 98 | 99 | # the better algorithm 100 | 101 | sed -i '/\[Peer\]/i Table = off' wgcf-profile.conf 102 | mv wgcf-profile.conf /etc/wireguard/warp.conf 103 | 104 | systemctl disable --now wg-quick@warp &> /dev/null || true 105 | systemctl enable --now wg-quick@warp 106 | 107 | echo "Wireguard warp is up and running" 108 | --------------------------------------------------------------------------------