Overview
OSPF dead interval is 40 seconds by default. BGP hold timer is 90 seconds. Without BFD, a router takes that long to detect a dead neighbor โ during which traffic blackholes. BFD runs independently of the routing protocol, sending lightweight hellos every 300msโ1000ms. When it detects a failure, it immediately notifies OSPF, BGP, or EIGRP, triggering convergence in under a second instead of minutes.
BFD Detection Time Formula
Detection time = Detect Multiplier ร negotiated Rx intervalExample: tx-interval 300ms, rx-interval 300ms, multiplier 3โ Detection time = 3 ร 300ms = 900msWarning: Setting BFD intervals below 300ms on software-based platforms (non-ASICs) causes CPU spikes and false positives. Use aggressive timers only on platforms with hardware BFD support (ASR 1000, Nexus 9000, Catalyst 9000).
Topology
Part 1 โ BFD with OSPF (Single-Hop)
! Enable BFD on the interface โ applies to all protocols using that interfaceinterface GigabitEthernet0/0 bfd interval 300 min_rx 300 multiplier 3! Tell OSPF to use BFD on this interfaceinterface GigabitEthernet0/0 ip ospf bfd! Or enable globally for all OSPF interfacesrouter ospf 1 bfd all-interfaces! Verify BFD sessionRTR-A# show bfd neighbors detail! Look for: State: Up, Registered protocols: OSPF! "LD/RD" = Local Discriminator / Remote Discriminator (session identifiers)Part 2 โ BFD with BGP (Single-Hop iBGP / eBGP)
! Interface BFD config (same as above)interface GigabitEthernet0/0 bfd interval 300 min_rx 300 multiplier 3! Enable BFD for a specific BGP neighborrouter bgp 65001 neighbor 10.0.0.2 fall-over bfd! Or enable for all neighbors in a peer grouprouter bgp 65001 neighbor CORE-PEERS fall-over bfd! Verify BGP is using BFDRTR-A# show bgp neighbors 10.0.0.2 | include BFD! "BFD is enabled, state: Up"Part 3 โ Multi-Hop BFD for eBGP
Single-hop BFD requires direct connectivity. For eBGP sessions over multiple hops, use multi-hop BFD.
! Multi-hop BFD โ use longer timers (more hops = more jitter)ip route 198.51.100.1 255.255.255.255 GigabitEthernet0/0! Static route to reach eBGP peer loopbackbfd-template multi-hop MH-BGP-PROFILE interval min-tx 1000 min-rx 1000 multiplier 3router bgp 65001 neighbor 198.51.100.1 remote-as 65002 neighbor 198.51.100.1 ebgp-multihop 3 neighbor 198.51.100.1 update-source Loopback0 neighbor 198.51.100.1 fall-over bfd multi-hop! Multi-hop BFD requires explicit template associationbfd map ipv4 198.51.100.1/32 MH-BGP-PROFILEPart 4 โ BFD with Static Routes
Static routes don't have a routing protocol to trigger BFD natively. Use ip route ... track with BFD-backed tracking:
! Step 1: BFD config on interfaceinterface GigabitEthernet0/1 bfd interval 300 min_rx 300 multiplier 3! Step 2: Create IP SLA using BFD (IOS-XE 16.9+)ip sla 10 icmp-echo 10.0.0.2 source-interface GigabitEthernet0/1ip sla schedule 10 life forever start-time nowtrack 10 ip sla 10 reachability! Step 3: Static route dependent on BFD-monitored trackip route 10.100.0.0 255.255.0.0 10.0.0.2 track 10! Route is installed only when BFD session is UpPart 5 โ BFD on Cisco NX-OS
! NX-OS โ global BFD configfeature bfd! Interface-level BFDinterface Ethernet1/1 bfd interval 300 min_rx 300 multiplier 3 no bfd echo! OSPF BFD on NX-OSrouter ospf 1 bfd! BGP BFD on NX-OSrouter bgp 65001 neighbor 10.0.0.2 bfd! VerifyNX# show bfd neighborsNX# show bfd neighbors detailNX# show bfd neighbors interface ethernet1/1Note: NX-OS supports hardware BFD on Nexus 9000 and Nexus 7000 with M3 line cards.
no bfd echodisables echo mode โ echo mode reduces CPU load but requires the far end to loop back packets, which some platforms don't support.
Real-World Scenario
The situation: Two routers connected via a Metro-E service provider circuit. The circuit has a "silent failure" mode โ the physical port stays up on both routers but the provider equipment in the middle drops all traffic. OSPF dead interval is 40 seconds, so traffic blackholes for 40 seconds before OSPF reconverges.
Symptoms observed:
- Interface state:
GigabitEthernet0/0 is up, line protocol is upon both routers โ no carrier loss show ip ospf neighborshows neighbor stuck in FULL state for 35 seconds after the circuit fails- Users experience a 40-second outage before the backup path activates
Fix โ BFD catches the silent failure in 900ms:
interface GigabitEthernet0/0 bfd interval 300 min_rx 300 multiplier 3 ip ospf bfd! After silent failure:! BFD sends probe at t=0ms, t=300ms, t=600ms โ no reply! At t=900ms (3 missed intervals): BFD declares neighbor DOWN! BFD notifies OSPF immediately! OSPF removes neighbor, reconverges via backup path! Total outage: ~1 second instead of 40 secondsTroubleshooting
BFD session flapping โ show bfd neighbors shows Up then Down repeatedly
Symptom: BFD neighbor bounces every few seconds. OSPF/BGP adjacency unstable.
Cause: Timer mismatch between peers, or link jitter causing missed hellos. Also common on high-CPU routers where BFD is software-processed.
Fix:
! Increase timers to reduce sensitivity to jitterinterface GigabitEthernet0/0 bfd interval 500 min_rx 500 multiplier 5! Detection time: 500ms ร 5 = 2500ms โ more tolerant of jitter! Check for timer negotiation:R1# show bfd neighbors detail! "Registered protocols" and "Local Diag" fields! "TX Interval: 500ms, RX Interval: 500ms" โ verify both sides negotiated sameBFD not starting โ show bfd neighbors empty
Symptom: Configured BFD on interface and enabled under OSPF, but no BFD sessions appear.
Cause: BFD requires both the bfd interval on the interface AND the protocol command (ip ospf bfd). Missing either one = no session.
Fix:
! Verify both are present:R1# show running-config interface GigabitEthernet0/0 | include bfd! Must show: bfd interval 300 min_rx 300 multiplier 3R1# show running-config | section router ospf! Must show: bfd all-interfaces (or interface-level ip ospf bfd)BFD session Up but BGP still takes 90 seconds to converge
Symptom: BFD shows State: Up, Registered protocols: BGP, but after link failure BGP doesn't converge faster.
Cause: fall-over bfd was configured but the BGP neighbor was already in Established state before BFD came up. BGP didn't register with BFD.
Fix:
! Clear the BGP session to force re-registration with BFDR1# clear ip bgp 10.0.0.2 soft! Or hard reset:R1# clear ip bgp 10.0.0.2! Verify BGP is registered:R1# show bfd neighbors 10.0.0.2 detail | include Registered! "Registered protocols: BGP" โ BFD will notify BGP on failureBFD Deployment Checklist
- Timer negotiation: both peers use the same
bfd intervalvalues โ negotiated value is the higher of the two - Hardware BFD verified on platform before using sub-300ms timers โ
show platform resourceson NX-OS no bfd echoconfigured on interfaces facing devices that don't support BFD echo (common on L3 switches)- Multi-hop BFD template created for any eBGP sessions using loopback addresses
- BFD enabled on both sides of every link โ one-sided BFD won't form a session
fall-over bfdconfigured on all critical BGP neighbors where fast convergence is needed- OSPF
bfd all-interfacesor per-interfaceip ospf bfdโ verify withshow ip ospf neighbor - After BFD deployment: test by shutting one side of the interface and verifying detection time with timestamps in logs
show bfd neighbors detailmonitored for "Diag: No Diagnostic" โ any other value means the session had issues