Difference between revisions of "Mikrotik: BFD Deteksi Link Failure"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) |
Onnowpurbo (talk | contribs) |
||
| (14 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | Berikut | + | Berikut ''panduan lengkap & praktis setting BFD untuk BGP di MikroTik RouterOS'' (v6 & v7), fokus ke '''fast convergence saat link putus'''. |
| Line 5: | Line 5: | ||
==Konsep Singkat (Penting)== | ==Konsep Singkat (Penting)== | ||
| − | * '''BFD ≠ BGP''' BFD hanya | + | * '''BFD ≠ BGP''' BFD hanya ''deteksi link mati super cepat'' (ms) |
| − | * '''BGP pakai hasil BFD''' Saat BFD | + | * '''BGP pakai hasil BFD''' Saat BFD '''down''' → ''BGP langsung withdraw route'' |
Target: | Target: | ||
| − | * ⏱️ | + | * ⏱️ '''Default BGP:''' 1–3 menit ❌ |
| − | * ⚡ | + | * ⚡ '''BGP + BFD:''' < '''300 ms''' 🔥 |
| − | |||
| − | |||
==1️⃣ Cek Versi RouterOS== | ==1️⃣ Cek Versi RouterOS== | ||
| Line 18: | Line 16: | ||
/system resource print | /system resource print | ||
| + | {| class="wikitable" | ||
| + | |- | ||
| + | ! RouterOS !! Status | ||
| + | |- | ||
| + | | v6.43+ || BFD tersedia | ||
| + | |- | ||
| + | | v7.x || BFD '''lebih stabil & recommended'' | ||
| + | |} | ||
| − | + | ==2️⃣ Konfigurasi BFD (WAJIB)== | |
| − | |||
| − | |||
| − | |||
| − | + | ===Contoh Parameter Aman & Cepat=== | |
| − | |||
| − | + | /routing bfd configuration | |
| + | add interfaces=ether1 min-tx=100ms min-rx=100ms multiplier=3 | ||
| − | + | Artinya: | |
| − | |||
| − | |||
| − | |||
| − | + | * Kirim paket tiap '''100 ms''' | |
| + | * Deteksi mati: '''300 ms''' | ||
| + | * Cocok untuk '''fiber / radio bagus / LAN''' | ||
| − | + | ⚠️ Jangan pakai <50ms di wireless jelek | |
| − | |||
| − | |||
| − | + | ==3️⃣ Aktifkan BFD di Peer BGP (RouterOS v7)== | |
| − | |||
| − | + | /routing bgp connection | |
| + | set [find name=peer-ISP] bfd=yes | ||
| − | |||
| − | |||
| − | |||
| − | |||
Atau saat membuat peer: | Atau saat membuat peer: | ||
| − | + | /routing bgp connection | |
| − | /routing bgp connection | + | add name=peer-ISP \ |
| − | add name=peer-ISP \ | + | remote.address=192.168.10.1 \ |
| − | + | remote.as=65001 \ | |
| − | + | local.as=65000 \ | |
| − | + | bfd=yes | |
| − | |||
| − | |||
| − | |||
| − | + | ==4️⃣ (Opsional) Percepat Timer BGP== | |
| − | Jika **tanpa BFD**, timer ini penting | + | * Jika **tanpa BFD**, timer ini penting |
| − | Jika **pakai BFD**, timer ini | + | * Jika **pakai BFD**, timer ini ''backup only'' |
| − | + | /routing bgp connection | |
| − | /routing bgp connection | + | set peer-ISP keepalive-time=10s hold-time=30s |
| − | set peer-ISP keepalive-time=10s hold-time=30s | ||
| − | |||
| − | |||
| − | + | ==5️⃣ Verifikasi BFD (WAJIB)== | |
| − | + | ===Cek Status BFD=== | |
| − | + | /routing bfd session print | |
| − | /routing bfd session print | ||
| − | |||
Status normal: | Status normal: | ||
| − | + | state=up | |
| − | state=up | ||
| − | |||
Jika: | Jika: | ||
| − | + | state=down | |
| − | state=down | ||
| − | |||
| − | ➡️ BGP | + | ➡️ BGP '''langsung disconnect''' |
| − | + | ==6️⃣ Test Fast Failover== | |
| − | + | ===Cara Aman Test=== | |
| − | |||
| − | |||
* Cabut kabel fiber | * Cabut kabel fiber | ||
| Line 111: | Line 93: | ||
Pantau: | Pantau: | ||
| − | + | /routing bgp session print | |
| − | /routing bgp session print | + | /ip route print where bgp |
| − | /ip route print where bgp | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | ⏱️ Harus turun '''< 1 detik''' | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | ==7️⃣ Topologi Paling Umum (Dual Link)== | |
| − | + | * https://data-discourse.cdn.mikrotik.com/original/3X/8/8/88994367cafc6525e7606588f6faad1b9a15b694.png | |
| − | + | * https://i.imgur.com/huowhnq.png | |
| − | / | ||
| − | |||
| − | / | + | * https://www.researchgate.net/publication/335142069/figure/fig3/AS%3A1095918434684930%401638298724943/OpenFlow-fast-failover-group-BFD-bidirectional-forwarding-detection-LOS-loss-of-signal.png |
| − | |||
| − | |||
| − | + | ==8️⃣ Best Practice BFD di MikroTik== | |
| − | + | * Gunakan ''RouterOS v7'' | |
| + | * Aktifkan ''1 BFD per interface'', bukan per peer | ||
| + | * Jangan terlalu agresif di wireless | ||
| + | * Kombinasikan dengan '''ECMP''' bila multi-link | ||
| − | + | ==Rekomendasi Setting Cepat & Stabil== | |
| − | |||
| − | |||
| − | -- | + | /routing bfd configuration |
| + | add interfaces=ether1 min-tx=100ms min-rx=100ms multiplier=3 | ||
| − | + | /routing bgp connection | |
| + | set peer-ISP bfd=yes keepalive-time=10s hold-time=30s | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | ==Kesalahan Umum== | |
| − | + | * Lupa enable `bfd=yes` di BGP peer | |
| + | * Timer BFD terlalu kecil → flapping | ||
| + | * Peer ISP '''tidak support BFD''' (cek dulu!) | ||
| − | + | ==Ringkasan== | |
| − | |||
| − | |||
| − | |||
| − | + | {| class="wikitable" | |
| − | + | |- | |
| − | + | ! Item !! Nilai | |
| − | + | |- | |
| + | | BFD detect || 300 ms | ||
| + | |- | ||
| + | | BGP fallback || 30 detik | ||
| + | |- | ||
| + | | Failover real || < 1 detik | ||
| + | |- | ||
| + | | Cocok untuk || ISP, Kampus, DC, Tambang | ||
| + | |} | ||
Latest revision as of 18:52, 22 December 2025
Berikut panduan lengkap & praktis setting BFD untuk BGP di MikroTik RouterOS (v6 & v7), fokus ke fast convergence saat link putus.
Konsep Singkat (Penting)
- BFD ≠ BGP BFD hanya deteksi link mati super cepat (ms)
- BGP pakai hasil BFD Saat BFD down → BGP langsung withdraw route
Target:
- ⏱️ Default BGP: 1–3 menit ❌
- ⚡ BGP + BFD: < 300 ms 🔥
1️⃣ Cek Versi RouterOS
/system resource print
| RouterOS | Status |
|---|---|
| v6.43+ | BFD tersedia |
| v7.x | BFD 'lebih stabil & recommended |
2️⃣ Konfigurasi BFD (WAJIB)
Contoh Parameter Aman & Cepat
/routing bfd configuration add interfaces=ether1 min-tx=100ms min-rx=100ms multiplier=3
Artinya:
- Kirim paket tiap 100 ms
- Deteksi mati: 300 ms
- Cocok untuk fiber / radio bagus / LAN
⚠️ Jangan pakai <50ms di wireless jelek
3️⃣ Aktifkan BFD di Peer BGP (RouterOS v7)
/routing bgp connection set [find name=peer-ISP] bfd=yes
Atau saat membuat peer:
/routing bgp connection
add name=peer-ISP \
remote.address=192.168.10.1 \
remote.as=65001 \
local.as=65000 \
bfd=yes
4️⃣ (Opsional) Percepat Timer BGP
- Jika **tanpa BFD**, timer ini penting
- Jika **pakai BFD**, timer ini backup only
/routing bgp connection set peer-ISP keepalive-time=10s hold-time=30s
5️⃣ Verifikasi BFD (WAJIB)
Cek Status BFD
/routing bfd session print
Status normal:
state=up
Jika:
state=down
➡️ BGP langsung disconnect
6️⃣ Test Fast Failover
Cara Aman Test
- Cabut kabel fiber
- Shutdown interface upstream
- Disable VLAN
Pantau:
/routing bgp session print /ip route print where bgp
⏱️ Harus turun < 1 detik
7️⃣ Topologi Paling Umum (Dual Link)
- https://data-discourse.cdn.mikrotik.com/original/3X/8/8/88994367cafc6525e7606588f6faad1b9a15b694.png
8️⃣ Best Practice BFD di MikroTik
- Gunakan RouterOS v7
- Aktifkan 1 BFD per interface, bukan per peer
- Jangan terlalu agresif di wireless
- Kombinasikan dengan ECMP bila multi-link
Rekomendasi Setting Cepat & Stabil
/routing bfd configuration add interfaces=ether1 min-tx=100ms min-rx=100ms multiplier=3
/routing bgp connection set peer-ISP bfd=yes keepalive-time=10s hold-time=30s
Kesalahan Umum
- Lupa enable `bfd=yes` di BGP peer
- Timer BFD terlalu kecil → flapping
- Peer ISP tidak support BFD (cek dulu!)
Ringkasan
| Item | Nilai |
|---|---|
| BFD detect | 300 ms |
| BGP fallback | 30 detik |
| Failover real | < 1 detik |
| Cocok untuk | ISP, Kampus, DC, Tambang |