Remote OpenWrt - Cloudflare ZeroTrust



Index


Tutorial Bahasa Indonesia


Tentang

Mengatur OpenWrt dari jarak jauh melalui domain dengan menggunakan Cloudflare ZeroTrust Tunnel, aplikasi ini merupakan alternatif TERMURAH dari ZeroTier, pagekite.me, ngrok.io yang memiliki kesamaan fungsi, dan tunnel ini tidak mengharuskan pengguna untuk menggunakan VPN dari aplikasi seperti Zerotier.

Pengaturan Domain di Cloudflare Dashboard

  1. Buatlah domain apapun, di situs manapun.
  2. Pergi ke Cloudflare Dashboard dan login, jika belum memiliki akun, silahkan mendaftar terlebih dahulu.
  3. Lihat tab Website dibagian kiri layar, lalu klik Add Site

    Halaman awal Cloudflare Dashboard

  4. Cari domain yang sudah di daftarkan di langkah pertama, lalu tekan tombol Add Site.

    Jika muncul Invalid domain seperti gambar dibawah:

    Invalid domain Cloudflare Dashboard

    Maka pergilah ke situs atau tempat anda membeli domain, lalu matikan Registrar Lock seperti contoh dibawah:

    Invalid domain Cloudflare Dashboard

  5. Setelah selesai menambahkan situs, Pada Step (1) Select plan , pilih FREE Plan (ada di bawah sendiri).

    Step 1 Cloudflare Dashboard

  6. Pada Step (2) Review DNS Record bisa langsung scroll ke bawah untuk menekan tombol Continue.

    Step 2 Cloudflare Dashboard

  7. Pada Step (3) ganti nameserver ubah nameserver pada domain sesuai dengan nameserver yang sudah disediakan dari cloudflare (lihat screenshot), lalu klik tombol Check nameservers.

    Step 3 Cloudflare Dashboard

  8. Setelah itu, kamu akan diarahkan ke halaman Quick Start Guide, ikuti saja langkah pada beberapa gambar dibawah ini:

    QSG 1 Cloudflare Dashboard

    QSG 2 Cloudflare Dashboard

    QSG 3 Cloudflare Dashboard

    QSG 4 Cloudflare Dashboard

    QSG 5 Cloudflare Dashboard

    Pastikan kamu sudah melihat tampilan dibawah ini:

    Done Cloudflare Dashboard

  9. Setelah selesai, tekan tombol kembali disebelah nama domain kamu, nanti akan diarahkan ke halaman Website, pastikan domainmu sudah seperti dibawah ini

    Done Add Site Cloudflare Dashboard

Pengaturan Tunnels di Cloudflare ZeroTrust Dashboard

  1. Pergi ke Cloudflare ZeroTrust Dashboard, pastikan sudah login.
  2. Masuk ke tab Access > Tunnels, lalu tekan Create a tunnel

    Create Tunnels Cloudflare ZeroTrust

  3. Beri nama tunnelmu (1), lalu tekan Save tunnel

    Naming Tunnels Cloudflare ZeroTrust

  4. Buka Terminal/Putty/XTERM dan semisalnya, lalu jalankan perintah dibawah ini

     wget -qO /root/cfdmgr "https://raw.githubusercontent.com/GegeDesembri/openwrt-tools/master/cloudflared/cfdmgr" && \
     chmod +x /root/cfdmgr
    

    Maka akan seperti ini

    Wget Terminal CFDMGR

  5. Jalankan command /root/cfdmgr i untuk memasang Cloudflared pada OpenWrt. Nanti akan seperti gambar di bawah ini. Ketika ada tulisan 💬 Enter New Cloudflared Token: (leave empty if no change)` silahkan kembali ke browser yang berada pada web Dashboard Cloudflare ZeroTrust untuk menyalin token.

    Install CF dari CFDMGR

  6. Kembali ke halaman Install Connector, pilih tab Windows - 64-bit, lalu tekan Ikon Salin di sebelah kanan tulisan token random seperti dibawah ini.

    Create Tunnels Cloudflare ZeroTrust

    Setelah disalin, silahkan kembali ke Terminal/Putty/XTERM tadi untuk mem-paste token dan menyelesaikan instalasi seperti pada gambar no. 5. Lalu pastikan bagian bawah yang berjudul Connectors sudah muncul baris seperti dibawah ini, Lalu tekan tombol Next

    Install Connector done at Cloudflare ZeroTrust

  7. Pada halaman Route tunnel, isi kolom yang tersedia pada bagian Public Hostnames seperti tanda pada gambar di bawah ini, lalu tekan Save nama_tunnel tunnel di bagian bawah.

    Set routes at Cloudflare ZeroTrust

  8. Kembali ke tab Access > Tunnels, lalu tekan tunnel yang sudah dibuat tadi, pastikan statusnya HEALTHY seperti gambar dibawah

    HEALTHY at Cloudflare ZeroTrust

    Jika status tunnel DOWN seperti gambar dibawah, maka periksa kembali token yang kamu daftarkan di OpenWrt, kemungkinan ada kesalahan disana.

    DOWN at Cloudflare ZeroTrust

  9. Jika kamu ingin menambahkan panel OpenClash YACD, silahkan ikuti Service pada gambar dibawah ini:

    Service tambahan at Cloudflare ZeroTrust

Tentang Script cfdmgr

Script ini berguna untuk memudahkan pengguna OpenWrt dalam mengontrol Cloudflared ZeroTrust.

Berikut beberapa perintah yang tersedia dalam script:

English Tutorial


About

Remote OpenWrt using custom domain through Cloudflare ZeroTrust Tunnel, this is CHEAPER alternate from ZeroTier, pagekite.me, ngrok.io which help you to access OpenWrt from other network, also this tunnels work without VPN from App (like Zerotier).

Setup Domain at Cloudflare Dashboard

  1. Create any domain from any site you want.
  2. Go to Cloudflare Dashboard and login, create an account if you don’t have it.
  3. Look at Website tab on the left-side your screen, then click Add Site

    Halaman awal Cloudflare Dashboard

  4. Find registered domain from 1st step, then click Add Site button.

    If Invalid domain appeared like picture below

    Invalid domain Cloudflare Dashboard

    You should go to domain site which sell that domain, then turn Registrar Lock off like sample below:

    Invalid domain Cloudflare Dashboard

  5. After adding site, look Step (1) Select plan , the select FREE Plan. (see pic).

    Step 1 Cloudflare Dashboard

  6. At Step (2) Review DNS Record you can scoll it down to click Continue button.

    Step 2 Cloudflare Dashboard

  7. At Step (3) Change Nameserver you should change your domain nameserver according attached nameserver from cloudflare (see pic), then click Check nameservers button.

    Step 3 Cloudflare Dashboard

  8. After that, you will redirected to Quick Start Guide page, just follow some pics below at this step:

    QSG 1 Cloudflare Dashboard

    QSG 2 Cloudflare Dashboard

    QSG 3 Cloudflare Dashboard

    QSG 4 Cloudflare Dashboard

    QSG 5 Cloudflare Dashboard

    Make sure you have seen this pic below:

    Done Cloudflare Dashboard

  9. After it done, click back button beside your domain naime, then you will redirected to Website page, make sure your domain like pic below

    Done Add Site Cloudflare Dashboard

Setup Tunnels at Cloudflare ZeroTrust Dashboard

  1. Go to Cloudflare ZeroTrust Dashboard, then login.
  2. Open tab Access > Tunnels, the click Create a tunnel

    Create Tunnels Cloudflare ZeroTrust

  3. Give tunnel name (1), then click Save tunnel button

    Naming Tunnels Cloudflare ZeroTrust

  4. Open Terminal/Putty/XTERM or similar app like those, then run command below

     wget -qO /root/cfdmgr "https://raw.githubusercontent.com/GegeDesembri/openwrt-tools/master/cloudflared/cfdmgr" && \
     chmod +x /root/cfdmgr
    

    Result should like this pic

    Wget Terminal CFDMGR

  5. Run /root/cfdmgr i command to install Cloudflared (see pic below). You will see 💬 Enter New Cloudflared Token: (leave empty if no change)` question, then you have to back to browser containing Dashboard Cloudflare ZeroTrust token to copy it’s token.

    Install CF dari CFDMGR

  6. Back to Install Connector page, select tab Windows - 64-bit, then click Copy Icon right-side of random token (see pic).

    Create Tunnels Cloudflare ZeroTrust

    After copy, back to Terminal/Putty/XTERM to paste the token and finishing installation (like picture number 5). Then make sure the Connectors list has new list (like pic below), then click Next button.

    Install Connector done at Cloudflare ZeroTrust

  7. At Route tunnel page, fill given coloumns at Public Hostnames section like sign at pic below, then click Save tunnel_name tunnel at the end section.

    Set routes at Cloudflare ZeroTrust

  8. Back to tab Access > Tunnels, then click created tunnel before, make sure that state is HEALTHY like pic below

    HEALTHY at Cloudflare ZeroTrust

    If your tunnel state is DOWN like pic below, you have to Re-checking registered token in your OpenWrt setting, likely the errors come from that.

    DOWN at Cloudflare ZeroTrust

  9. If you want to add OpenClash YACD panel, follow Service at pic below

    Service tambahan at Cloudflare ZeroTrust

About cfdmgr script

This script will make user more easier to control Cloudflared ZeroTrust, and below is some available commands inside the script:

Referensi

Credits