Failover di mikrotik dan Recursive Gateway Routing untuk dua ISP
Ketika ada dua ISP di mikrotik, route di mikrotik akan check gateway / ping ne next hop dan tetap replay ketika di ping /check gateway karena ada modem (ont gpon) atau router dari ISP, padahal internet nya mati, berikut salah satu cara untuk membuat Failover di mikrotik Recursive Gateway Routing dengan virtual IP. Mikrotik akan cek koneksi ke dns google dan dns cloudflare biar tidak false positive jika salah satu bermasalah dns google atau dns cloudflare failover tetap bekerja dengan semestinya
ISP A dengan ip gateway=103.128.180.1
ISP B dengan ip gateway=192.168.200.1
pastikan ip 172.16.10.1 dan 172.16.20.1 tidak ada / tidak aktif di mikrotik / jaringan
Untuk konfig nya sebagai berikut untuk RouterOS v6
# 1. Host Monitor / Ping ke Internet via Gateway Asli ISP
/ip route
add dst-address=8.8.8.8/32 gateway=103.128.180.1 scope=10 comment="Host Check Google via ISP-A"
add dst-address=1.1.1.1/32 gateway=103.128.180.1 scope=10 comment="Host Check Cloudflare via ISP-A"
add dst-address=8.8.4.4/32 gateway=192.168.200.1 scope=10 comment="Host Check Google via ISP-B"
add dst-address=1.0.0.1/32 gateway=192.168.200.1 scope=10 comment="Host Check Cloudflare via ISP-B"
# 2. Virtual Gateway dengan Check Gateway Ping
# Virtual GW ISP-A (172.16.10.1)
add dst-address=172.16.10.1/32 gateway=8.8.8.8 distance=1 scope=10 target-scope=10 check-gateway=ping comment="Virtual GW ISP-A - Target Primary"
add dst-address=172.16.10.1/32 gateway=1.1.1.1 distance=2 scope=10 target-scope=10 check-gateway=ping comment="Virtual GW ISP-A - Target Secondary"
# Virtual GW ISP-B (172.16.20.1)
add dst-address=172.16.20.1/32 gateway=8.8.4.4 distance=1 scope=10 target-scope=10 check-gateway=ping comment="Virtual GW ISP-B - Target Primary"
add dst-address=172.16.20.1/32 gateway=1.0.0.1 distance=2 scope=10 target-scope=10 check-gateway=ping comment="Virtual GW ISP-B - Target Secondary"
# 3. Default Route untuk Trafik Utama (Main Table)
/ip route
add dst-address=0.0.0.0/0 gateway=172.16.10.1 distance=1 target-scope=11 comment="Main Traffic -> ISP-A Primary"
add dst-address=0.0.0.0/0 gateway=172.16.20.1 distance=2 target-scope=11 comment="Main Traffic -> ISP-B Backup"
# 4. Routing Table dengan Mark Routing (PBR)
# --- MARK: to_isp_a
/ip route
add dst-address=0.0.0.0/0 gateway=172.16.10.1 distance=1 target-scope=11 routing-table=to_isp_a comment="Mark to_isp_a -> ISP-A Primary"
add dst-address=0.0.0.0/0 gateway=172.16.20.1 distance=2 target-scope=11 routing-table=to_isp_a comment="Mark to_isp_a -> ISP-B Backup"
# --- MARK: to_isp_b
/ip route
add dst-address=0.0.0.0/0 gateway=172.16.20.1 distance=1 target-scope=11 routing-table=to_isp_b comment="Mark to_isp_b -> ISP-B Primary"
add dst-address=0.0.0.0/0 gateway=172.16.10.1 distance=2 target-scope=11 routing-table=to_isp_b comment="Mark to_isp_b -> ISP-A Backup"
note
"IP 172.16.10.1/32 dan 172.16.20.1/32 adalah IP dummy/virtual yang hanya hidup di dalam tabel routing MikroTik sebagai perantara rekursif, sehingga tidak perlu dipasang pada interface fisik mana pun.

Komentar
Posting Komentar