This script installs and configures the Cloudflare Tunnel client on an OpenWRT router over a network.
The script prompts the user for the device's IP address and Cloudflare Access token, then it uses SSH to connect and perform the installation.
- Open a terminal window on your local machine (laptop).
- Copy the following command and paste it into the terminal window:
curl -sO https://raw.githubusercontent.com/oldstreetloft/install-cloudflared/main/setup.sh;chmod +x setup.sh;./setup.sh
- Press Enter to run the command.
- Follow the prompts to complete the installation.
- Set split tunnel in Cloudflare Zero Trust portal under Settings -> Warp App.
Script executes with or without command line arguments:
./setup.sh <ip_address> <access_token>
Enter IP address: <ip_address>
Enter CFD Token: <access_token>
Enter password: <password>
...
SUCCESS: INSTALL COMPLETED.
Set split tunnel in Cloudflare Zero Trust portal under Settings -> Warp App.
Cloudflare Tunnel provides you with a secure way to connect your resources to Cloudflare without a publicly routable IP address. With Tunnel, you do not send traffic to an external IP — instead, a lightweight daemon in your infrastructure (cloudflared) creates outbound-only connections to Cloudflare’s global network. Cloudflare Tunnel can connect HTTP web servers, SSH servers, remote desktops, and other protocols safely to Cloudflare. This way, your origins can serve traffic through Cloudflare without being vulnerable to attacks that bypass Cloudflare.
This script is licensed under the GPLv3 License. See the LICENSE file for more information.
