Building Cloudflared agent from source on mips64 architecture
Are you trying to set up Cloudflared on your mips64 OS router, such as the UniFi Edge Router?
Unfortunately, Currently Cloudflare does not provide a binary for mips64 architecture. However, you can still build and install the Cloudflared agent from source. This guide will walk you through the steps to build and install Cloudflared on your mips64 router. Let's get started!
Prerequisites
- Go 1.20 or later
- Git (optional, if you want to clone the repository)
- SSH access to your router
- Cloudflare account with a zone configured
- Token from Cloudflare Tunnel page
Steps
Replace [router_username]
, [router_ip]
, and [token-from-cloudflare]
with your actual values.
-
Clone the Cloudflared repository:
git clone https://github.com/cloudflare/cloudflared.git
-
Change to the cloned directory:
cd cloudflared
-
Build the binary for mips64 architecture:
GOOS=linux GOARCH=mips64 go build github.com/cloudflare/cloudflared/cmd/cloudflared
This will create a binary named
cloudflared
in the current directory. -
Copy the binary to your router:
scp cloudflared [router_username]@[router_ip]:/tmp/
-
SSH into your router:
ssh [router_username]@[router_ip]
-
Change to the
/tmp
directory:cd /tmp
-
Change the owner of the binary to root:
sudo chown root:root cloudflared
-
Make the binary executable:
sudo chmod +x cloudflared
-
Move the binary to a directory in your PATH:
sudo mv cloudflared /usr/bin/
-
Create the cloudflared config directory:
sudo mkdir /etc/cloudflared
-
Create the cloudflared config file:
sudo vi /etc/cloudflared/config.yml
-
Add the following content to
config.yml
file:config.ymlproxy-dns: true
proxy-dns-upstream:
- https://1.1.1.1/dns-query
- https://1.0.0.1/dns-query
proxy-dns-port: 8853 -
Start the cloudflared service:
sudo /usr/bin/cloudflared service install [token-from-cloudflare]
That's it! You have successfully installed Cloudflared on your mips64 router. You can now configure your router to use Cloudflare DNS.
Please note that after every firmware upgrade on your router, you will need to re-install Cloudflared on your router as the firmware upgrade will remove the binary from your router.