Why your BGP failover takes three minutes (and how to get it under one second)
When the circuit stays up but the path dies, BGP's default timers leave you black-holing traffic for up to three minutes. BFD fixes that.
You've got two internet circuits, two eBGP sessions, and a design doc that says "automatic failover." Then the primary provider has a bad night, and your traffic disappears for nearly three minutes before the backup takes over. Everything "worked." It just worked slowly.
Here's why that happens and the fix I reach for first.
The link was up, so nothing noticed
On a directly connected eBGP session, most platforms tear the session down the instant the interface goes down. Cisco calls this fast external fallover, and it's on by default. If someone unplugs the cable, you fail over in about a second.
The trouble is that most real outages don't take your interface down. Your handoff often lands on a provider switch, a Metro Ethernet NID or a media converter. When the provider's router behind that box dies, your port stays green. The only thing left to notice is BGP itself, and BGP is patient:
| Timer | Cisco IOS default | What it means |
|---|---|---|
| Keepalive | 60 seconds | How often each side says "still here" |
| Hold time | 180 seconds | How long to wait without hearing anything before giving up |
So the worst case is three minutes of traffic going into a router that isn't there.
Option 1: Shorter BGP timers
You can lower the timers per neighbor:
router bgp 65010
neighbor 203.0.113.1 remote-as 64500
neighbor 203.0.113.1 timers 10 30
That gets you down to 30 seconds. It's better, but it's still slow, and pushing BGP timers much lower puts load on the control plane of both routers. Some providers also won't accept a hold time below their own minimum, and the session negotiates to the lower of the two values anyway.
Option 2: BFD (the one I recommend)
Bidirectional Forwarding Detection is a tiny, purpose-built hello protocol. It runs alongside BGP, often in hardware, and its only job is answering "can I still forward packets to that neighbor?" When BFD declares the neighbor down, it tells BGP, and BGP drops the session immediately.
interface GigabitEthernet0/0/0
description ISP-A handoff
ip address 203.0.113.2 255.255.255.252
bfd interval 300 min_rx 300 multiplier 3
!
router bgp 65010
neighbor 203.0.113.1 remote-as 64500
neighbor 203.0.113.1 fall-over bfd
With a 300 ms interval and a multiplier of 3, a dead path is detected in about 900 ms. Verify it with:
show bfd neighbors details
show ip bgp neighbors 203.0.113.1 | include BFD
Ask your provider first. BFD has to run on both ends. Many carriers support it on business internet and MPLS handoffs, but it's often off by default and has to be requested on the order or through a ticket. Ask which intervals they support before you configure yours.
Don't stop at detection
Fast detection only helps if the backup path is ready to take traffic. While you're in there, check that:
- Outbound preference is explicit. Set
local-preferenceon routes learned from the primary so you aren't relying on tie-breakers. - Inbound preference is explicit. AS-path prepending (or provider communities) on the backup keeps return traffic on the primary while it's healthy.
- You've tested it. Shut down the provider-facing side of a link in a maintenance window, or ask the carrier to drop the session, and time it. A failover you haven't tested is a hope, not a design.
The short version
If your eBGP handoffs don't go through a direct cable to the provider router, assume an outage will leave the interface up. Add BFD where the provider supports it, shorten BGP timers where they don't, and test the failover so you know the number instead of guessing it.