Tutorial Lengkap Setup WireGuard + Cloudflare WARP untuk Optimasi Routing dengan VPS Singapura & Indonesia

 

      [ Client ]
          │
          ▼
    🌍 Internet
          │
    ┌───────────┐
    │  Starlink         │ (Only Transit)
    └───────────┘
          │
          ▼
  ┌─────────────────┐        ┌──────────────────┐
  │  VPS Singapura          │ -----> │  VPS Indonesia           
  │  10.100.100.1               │ <----- │  10.100.101.1                
  │  Public IP SG               │        │  Public IP ID                
  └─────────────────┘        └──────────────────┘
          │
          ▼
    [ WireGuard ]
          │
          ▼
   [ Cloudflare WARP ]
          │
          ▼
      🌍 Internet

      Penjelasan

✅ Client → Koneksi utama ke VPS Singapura melalui WireGuard
✅ VPS Singapura → Server utama untuk VPN
✅ VPS Indonesia → Server backup jika VPS Singapura mati
✅ Failover → Jika VPS SG mati, koneksi dialihkan ke VPS Indonesia
✅ Cloudflare WARP → Optimasi jalur & routing lebih cepat
✅ Starlink → Hanya sebagai transit, semua bandwidth tetap dari VPS


1. Pendahuluan

Topologi ini menggunakan dua VPS (Singapura & Indonesia) sebagai gateway utama untuk koneksi internet, dengan Starlink hanya sebagai transit. WireGuard digunakan sebagai VPN utama, dan Cloudflare WARP membantu optimasi routing. Sistem ini juga memiliki failover jika VPS utama (SG) mati, maka koneksi otomatis dialihkan ke VPS backup (ID).

2. Persiapan

Sebelum memulai, pastikan Anda memiliki:

  • 2 VPS (Singapura & Indonesia) dengan OS Ubuntu/Debian

  • WireGuard terinstal di kedua VPS

  • Cloudflare WARP terinstal di VPS utama (SG)

  • Akses root ke server dan client

3. Instalasi WireGuard di VPS Singapura & Indonesia

apt update && apt install wireguard -y

4. Konfigurasi WireGuard di VPS Singapura (/etc/wireguard/wg0.conf)

[Interface]
Address = 10.100.100.1/24
PrivateKey = <PRIVATE_KEY_SG>
ListenPort = 51820

[Peer]
PublicKey = <PUBLIC_KEY_ID>
AllowedIPs = 10.100.101.1/32
Endpoint = <PUBLIC_IP_ID>:51820
PersistentKeepalive = 25

5. Konfigurasi WireGuard di VPS Indonesia (/etc/wireguard/wg0.conf)

[Interface]
Address = 10.100.101.1/24
PrivateKey = <PRIVATE_KEY_ID>
ListenPort = 51820

[Peer]
PublicKey = <PUBLIC_KEY_SG>
AllowedIPs = 10.100.100.1/32
Endpoint = <PUBLIC_IP_SG>:51820
PersistentKeepalive = 25

6. Menjalankan WireGuard

systemctl enable wg-quick@wg0
systemctl start wg-quick@wg0

7. Instalasi Cloudflare WARP di VPS Singapura

curl -fsSL https://pkg.cloudflareclient.com/install.sh | bash
warp-cli register
warp-cli set-mode proxy
warp-cli connect

8. Menambahkan Routing di VPS Singapura

iptables -t nat -A POSTROUTING -o warp0 -j MASQUERADE
iptables -A FORWARD -i wg0 -o warp0 -j ACCEPT
iptables -A FORWARD -i warp0 -o wg0 -j ACCEPT

9. Setup Failover dari Singapura ke Indonesia

while true; do
  ping -c 3 10.100.100.1 > /dev/null
  if [ $? -ne 0 ]; then
    ip route replace default via 10.100.101.1 dev wg0
  else
    ip route replace default via 10.100.100.1 dev wg0
  fi
  sleep 10
done

Simpan script ini di /root/failover.sh dan jalankan:

chmod +x /root/failover.sh
nohup /root/failover.sh &

10. Uji Koneksi

Di client, coba hubungkan ke WireGuard VPS Singapura dan cek apakah routing berjalan dengan baik.

ping -c 3 8.8.8.8
curl ifconfig.me

Penutup Sistem ini memastikan koneksi tetap optimal dengan failover otomatis. Semua bandwidth tetap dari VPS, sementara Starlink hanya sebagai jalur transit. Jika ada pertanyaan, silakan tinggalkan komentar di blog!


0 Comments:

Posting Komentar

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | coupon codes