Kalkulator Load Balance PCC Multi-WAN MikroTik
Generator script penyeimbang beban Multi-WAN (2–5 ISP) PCC proporsional dan failover bertingkat rekursif di RouterOS v7.
Parameter Input
Hasil Perhitungan
- ispCount
- 2
- mode
- pcc
- classifier
- both-addresses-and-ports
- lanIface
- bridge-lan
- lanCidr
- 192.168.88.0/24
- totalBandwidthMbps
- 150
- ratioString
- 2 : 1
- totalPccStreams
- 3
- isps
- [{"index":1,"name":"ISP1","iface":"ether1-ISP1","gw":"192.168.1.1","bw":100,"check":"1.1.1.1","weight":2,"connMark":"ISP1_conn","routeTable":"to-ISP1"},{"index":2,"name":"ISP2","iface":"ether2-ISP2","gw":"192.168.2.1","bw":50,"check":"8.8.8.8","weight":1,"connMark":"ISP2_conn","routeTable":"to-ISP2"}]
# ===================================================================== # InfraCalc.id - MikroTik RouterOS v7 Multi-WAN (2 ISP) PCC + Recursive Failover # Rasio Beban Otomatis: ISP1 (100M) : ISP2 (50M) = 2 : 1 (3 PCC Streams) # Classifier: both-addresses-and-ports | LAN Interface: bridge-lan (192.168.88.0/24) # ===================================================================== /routing table add disabled=no fib name=to-ISP1 add disabled=no fib name=to-ISP2 /ip firewall address-list add address=192.168.0.0/16 list=RFC1918-LOCAL comment="Bypass Private LAN Traffic" add address=10.0.0.0/8 list=RFC1918-LOCAL add address=172.16.0.0/12 list=RFC1918-LOCAL /ip firewall mangle add action=accept chain=prerouting dst-address-list=RFC1918-LOCAL in-interface=bridge-lan comment="Bypass Local-to-Local / Inter-VLAN dari PCC" add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=ether1-ISP1 new-connection-mark=ISP1_conn passthrough=yes comment="Mark Inbound ISP1" add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=ether2-ISP2 new-connection-mark=ISP2_conn passthrough=yes comment="Mark Inbound ISP2" add action=mark-connection chain=prerouting connection-mark=no-mark dst-address-type=!local in-interface=bridge-lan new-connection-mark=ISP1_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:3/0 comment="PCC Stream 1/3 -> ISP1 (100M)" add action=mark-connection chain=prerouting connection-mark=no-mark dst-address-type=!local in-interface=bridge-lan new-connection-mark=ISP1_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:3/1 comment="PCC Stream 2/3 -> ISP1 (100M)" add action=mark-connection chain=prerouting connection-mark=no-mark dst-address-type=!local in-interface=bridge-lan new-connection-mark=ISP2_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:3/2 comment="PCC Stream 3/3 -> ISP2 (50M)" add action=mark-routing chain=prerouting connection-mark=ISP1_conn in-interface=bridge-lan new-routing-mark=to-ISP1 passthrough=no comment="Route LAN ke ISP1" add action=mark-routing chain=prerouting connection-mark=ISP2_conn in-interface=bridge-lan new-routing-mark=to-ISP2 passthrough=no comment="Route LAN ke ISP2" add action=mark-routing chain=output connection-mark=ISP1_conn new-routing-mark=to-ISP1 passthrough=no comment="Route Output Router ke ISP1" add action=mark-routing chain=output connection-mark=ISP2_conn new-routing-mark=to-ISP2 passthrough=no comment="Route Output Router ke ISP2" /ip firewall nat add action=masquerade chain=srcnat out-interface=ether1-ISP1 comment="NAT Masquerade ISP1 (100 Mbps)" add action=masquerade chain=srcnat out-interface=ether2-ISP2 comment="NAT Masquerade ISP2 (50 Mbps)" # Recursive Routing Failover (Mendeteksi Putus di Tengah Jaringan ISP / FO Cut) /ip route add dst-address=1.1.1.1/32 gateway=192.168.1.1 scope=10 target-scope=10 comment="Monitor Host ISP1 via ether1-ISP1" add dst-address=8.8.8.8/32 gateway=192.168.2.1 scope=10 target-scope=10 comment="Monitor Host ISP2 via ether2-ISP2" # Routing Table per ISP + Cascading Backup Otomatis add check-gateway=ping distance=1 dst-address=0.0.0.0/0 gateway=1.1.1.1 routing-table=to-ISP1 scope=30 target-scope=11 comment="Primary Route Table ISP1" add check-gateway=ping distance=2 dst-address=0.0.0.0/0 gateway=8.8.8.8 routing-table=to-ISP1 scope=30 target-scope=11 comment="Failover Table ISP1 -> Backup ISP2" add check-gateway=ping distance=1 dst-address=0.0.0.0/0 gateway=8.8.8.8 routing-table=to-ISP2 scope=30 target-scope=11 comment="Primary Route Table ISP2" add check-gateway=ping distance=2 dst-address=0.0.0.0/0 gateway=1.1.1.1 routing-table=to-ISP2 scope=30 target-scope=11 comment="Failover Table ISP2 -> Backup ISP1" # Default Route pada Main Routing Table add check-gateway=ping distance=1 dst-address=0.0.0.0/0 gateway=1.1.1.1 routing-table=main scope=30 target-scope=11 comment="Default Route Main ISP1 (Distance 1)" add check-gateway=ping distance=2 dst-address=0.0.0.0/0 gateway=8.8.8.8 routing-table=main scope=30 target-scope=11 comment="Default Route Main ISP2 (Distance 2)"
Cara Menggunakan Alat Ini
- Pilih jumlah ISP provider (2 sampai 5) dan tentukan mode operasi: PCC Load Balancing + Failover atau Active-Backup Failover murni.
- Tentukan antarmuka LAN bridge, nama interface tiap ISP, IP gateway lokal modem, bandwidth download/upload aktual, serta host target pemeriksaan ping (misalnya 1.1.1.1 atau 8.8.8.8).
- Periksa rasio pembagian beban otomatis dan jumlah stream PCC yang dihasilkan, lalu salin script RouterOS v7 yang telah dilengkapi bypass RFC1918 ke terminal router.
Contoh Perhitungan Nyata: Dual-WAN 100M + 50M (Rasio 2:1)
Contoh terhitung: Kombinasi 2 ISP (ISP1 100M dan ISP2 50M) menghasilkan rasio proporsional 2 : 1 dengan total 3 stream PCC pada antarmuka bridge-lan (150 Mbps agregat).
{
"ispCount": 2,
"mode": "pcc",
"classifier": "both-addresses-and-ports",
"lanIface": "bridge-lan",
"lanCidr": "192.168.88.0/24",
"isp1Bw": 100,
"isp1Gw": "192.168.1.1",
"isp1Iface": "ether1-ISP1",
"isp2Bw": 50,
"isp2Gw": "192.168.2.1",
"isp2Iface": "ether2-ISP2"
}- ispCount:
- 2
- mode:
- pcc
- classifier:
- both-addresses-and-ports
- lanIface:
- bridge-lan
- lanCidr:
- 192.168.88.0/24
- totalBandwidthMbps:
- 150
- ratioString:
- 2 : 1
- totalPccStreams:
- 3
- isps:
- [{"index":1,"name":"ISP1","iface":"ether1-ISP1","gw":"192.168.1.1","bw":100,"check":"1.1.1.1","weight":2,"connMark":"ISP1_conn","routeTable":"to-ISP1"},{"index":2,"name":"ISP2","iface":"ether2-ISP2","gw":"192.168.2.1","bw":50,"check":"8.8.8.8","weight":1,"connMark":"ISP2_conn","routeTable":"to-ISP2"}]
Konsep Dasar & Catatan Teknis
Cara Perhitungan (Rumus & Langkah)
Rumus Matematika
- Bobot Awal ISP = max(1, round(Bandwidth ÷ 10))
- FPB (GCD) = gcd(Bobot ISP1, Bobot ISP2, ..., Bobot ISPN)
- Rasio Sederhana = Bobot Awal ÷ FPB
- Total Stream PCC = Σ(Rasio Sederhana) (diskala jika > 15 untuk efisiensi CPU)
- Recursive Route: Gateway host check via modem gateway dengan scope=10 dan target-scope=11
Langkah Substitusi
- Configured 2 WAN links with total aggregated capacity of 150 Mbps
- Calculated bandwidth weights via GCD reduction: ISP1 (100 Mbps) : ISP2 (50 Mbps) → Ratio 2 : 1 (3 PCC streams total)
- Generated RouterOS v7 routing tables, RFC 1918 bypass mangle rules, and recursive host monitoring for ISP1 via 1.1.1.1, ISP2 via 8.8.8.8
Pertanyaan yang Sering Diajukan (FAQ)
Mengapa classifier 'both-addresses-and-ports' menjadi rekomendasi utama?
Classifier ini mengacak koneksi berdasarkan IP pengirim, IP tujuan, serta port. Ini menghasilkan persebaran trafik paling merata untuk banyak pengguna browsing dan download tanpa merusak koneksi HTTPS karena sesi port tunggal tetap berada di satu ISP.
Apa fungsi bypass RFC 1918 pada script mangle PCC?
Rule accept untuk alamat lokal (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) diletakkan di urutan paling atas agar trafik antar-VLAN dan akses ke modem ONT tidak terkena mark routing PCC ke arah internet publik.
Bagaimana cara kerja Recursive Routing Failover pada RouterOS v7?
Router menetapkan rute statis ke IP publik tertentu (misalnya 1.1.1.1) dengan scope=10 melalui gateway modem. Rute default (0.0.0.0/0) kemudian diarahkan ke 1.1.1.1 dengan check-gateway=ping dan target-scope=11. Jika ping ke 1.1.1.1 gagal, rute default otomatis nonaktif.
Apakah PCC bisa menggabungkan kecepatan download dari satu koneksi tunggal (single-stream)?
Tidak. Satu sesi koneksi tunggal (seperti download file di browser biasa) hanya melewati satu ISP. Kecepatan gabungan 100+50 = 150 Mbps baru dirasakan saat terdapat multi-koneksi (seperti torrent, download manager multi-thread, atau banyak pengguna bersamaan).
Alat Kalkulator Terkait
Hitung Limit-At (CIR), Max-Limit (MIR), Burst, PCQ, dan FQ-CoDel RouterOS v7 lengkap dengan generator script konfigurasi otomatis.
Buka port server/NVR ke internet publik (DST-NAT) dan cegah koneksi loopback timeout dari dalam jaringan kantor menggunakan Hairpin NAT.
Hitung alamat network, broadcast, rentang host usable, netmask, wildcard, biner mask, dan tipe alamat IPv4 (RFC 1918, RFC 3021 /31, CGNAT).
Referensi Standar & Catatan
- MikroTik Documentation — PCC (Per Connection Classifier)
- MikroTik Documentation — Advanced Routing & Recursive Failover
Catatan: Hasil di atas merupakan estimasi berdasarkan rumus standar. Selalu verifikasi dengan dokumentasi resmi vendor dan kondisi lapangan sebelum implementasi pada lingkungan produksi.