Panduan Hybrid Cloud Interconnect: Hubungkan Network LAN Kantor ke Net2Byte Cloud VPS via WireGuard & BGP Over IPsec
Implementasi Bertahap
Langkah konfigurasi dan tindakan lapangan yang dilakukan dari awal sampai siap diuji.
Tested & Verified On
Net2Byte Cloud VPS (Ubuntu 24.04 / WireGuard) & MikroTik RouterOS v7 / FortiGate
Prerequisites
Pemahaman Routing, IPsec / WireGuard VPN, NAT, dan dasar Cloud VPS
Skenario Hybrid Cloud Interconnect
Perusahaan ingin menghubungkan server lokal kantor (*On-Premise LAN Subnet 192.168.10.0/24*) ke **Net2Byte Cloud VPS (Subnet 10.100.0.0/24)** secara transparan sehingga server di lokal dan di cloud dapat saling berkomunikasi langsung tanpa melalui NAT.
Langkah 1: Setup WireGuard Server di Net2Byte Cloud VPS (Ubuntu 24.04)
Instal WireGuard pada Cloud VPS Net2Byte dan buat file konfigurasi server `/etc/wireguard/wg0.conf`.
# Install WireGuard di VPS Ubuntu sudo apt update && sudo apt install -y wireguard # Generate Private & Public Key Server wg genkey | tee /etc/wireguard/server_private.key | wg pubkey > /etc/wireguard/server_public.key # Buat Konfigurasi /etc/wireguard/wg0.conf cat </etc/wireguard/wg0.conf [Interface] PrivateKey = Address = 10.200.0.1/30 ListenPort = 51820 PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE [Peer] # MikroTik Router Office PublicKey = AllowedIPs = 10.200.0.2/32, 192.168.10.0/24 PersistentKeepalive = 25 EOF # Aktifkan IP Forwarding & Jalankan WireGuard sudo sysctl -w net.ipv4.ip_forward=1 sudo systemctl enable --now wg-quick@wg0
Langkah 2: Setting WireGuard Client pada Router MikroTik Lokal (RouterOS v7)
Konfigurasi antarmuka WireGuard pada router MikroTik kantor untuk terhubung ke Net2Byte Cloud VPS.
/interface wireguard add name=wg-net2byte listen-port=51820 /interface wireguard peers add interface=wg-net2byte public-key="" endpoint-address=103.x.x.x endpoint-port=51820 allowed-address=10.200.0.1/32,10.100.0.0/24 persistent-keepalive=25s /ip address add address=10.200.0.2/30 interface=wg-net2byte comment="IP Point-to-Point WireGuard Tunnel" /ip route add dst-address=10.100.0.0/24 gateway=10.200.0.1 comment="Routing ke Subnet Net2Byte Cloud VPS"
Langkah 3: Setting Routing di Cloud VPS & Testing Inter-Subnet Communication
Tambahkan static route di Cloud VPS menuju subnet LAN kantor melalui IP tunnel MikroTik (10.200.0.2).
sudo ip route add 192.168.10.0/24 via 10.200.0.2 dev wg0
Contoh Konfigurasi / Command Penting
# Test Tunnel Status:
ping 10.200.0.1
ping 10.100.0.10 (IP Server Cloud Net2Byte)
wg show
CLI Command & Configuration Script
# Test Tunnel Status: ping 10.200.0.1 ping 10.100.0.10 (IP Server Cloud Net2Byte) wg show