Mikrotik: BFD Deteksi Link Failure
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
```bash /system resource print ```
| RouterOS | Status | | -------- | ---------------------------------- | | v6.43+ | BFD tersedia | | v7.x | BFD **lebih stabil & recommended** |
---
- 2️⃣ Konfigurasi BFD (WAJIB)
- Contoh Parameter Aman & Cepat
```bash /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)
```bash /routing bgp connection set [find name=peer-ISP] bfd=yes ```
Atau saat membuat peer:
```bash /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*
```bash /routing bgp connection set peer-ISP keepalive-time=10s hold-time=30s ```
---
- 5️⃣ Verifikasi BFD (WAJIB)
- Cek Status BFD
```bash /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:
```bash /routing bgp session print /ip route print where bgp ```
⏱️ Harus turun **< 1 detik**
---
- 7️⃣ Topologi Paling Umum (Dual Link)

---
- 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
```bash /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 |
---
Kalau mau, saya bisa:
- Buat **template MikroTik v6 vs v7**
- Sesuaikan **latency radio / fiber**
- Simulasi **dual ISP + ECMP**
- Bandingkan **BFD vs Netwatch vs Script**
Tinggal sebutkan: 👉 RouterOS versi 👉 Jenis link (fiber / radio / LTE) 👉 Single atau dual ISP