What is BFD?
Bidirectional Forwarding Detection
BFD (Bidirectional Forwarding Detection) is a lightweight protocol that lets two routers detect a failed link in milliseconds and alert their routing protocols.
Routing protocols have their own failure detection, but it is slow: OSPF waits for its dead interval, 40 seconds by default on broadcast links, and BGP's hold time is often 90 or 180 seconds. BFD (RFC 5880) runs alongside them as a separate, very small hello protocol. The two ends agree on a transmit interval and a detect multiplier; with a common setting of 300 ms and a multiplier of 3, a path is declared down after about 900 ms of silence. Single-hop BFD control packets travel over UDP port 3784, and multihop BFD, used between loopbacks several hops apart, uses port 4784. A session moves through the states Down, Init and Up (plus AdminDown). BFD doesn't carry routes and doesn't decide anything on its own: OSPF, BGP or a static route registers as a client, and when BFD reports the session down, that client tears down the neighbour or withdraws the route at once.
BFD matters most where a router can't see the failure on its own interface. If a fibre breaks beyond a media converter, or a switch between two routers dies, both interfaces stay up and the routing protocol keeps sending traffic into a black hole until its timers expire. With BFD, rerouting starts in under a second. Very aggressive timers on a busy router can cause false failures and flapping, so the intervals are a trade-off rather than "as low as possible". Both ends need BFD configured, and when peering with a provider they have to support it too. The Edge and core lesson shows the slow failover BFD fixes, and BGP on loopbacks vs interface addresses uses it to protect loopback sessions.
Lessons that use BFD
- Edge and core: building out a VyOS networkTeaches this term · Intermediate · 60 min
Split one BGP router into edge routers that face the outside world and a core that carries traffic inside: loopbacks, OSPF for infrastructure, iBGP between loopbacks, next-hop-self, and what happens when a link fails. Built and broken on three real VyOS routers.
- BGP on loopbacks vs interface addressesIntermediate · 45 min
Why BGP sessions between loopbacks survive link failures and use parallel links, and what they need to work: an IGP or static routes, update-source, the eBGP connected check, and BFD. Every failure is reproduced on two real VyOS routers.
- OSPF on VyOS: costs and OSPFv3Intermediate · 30 min
OSPF the VyOS way: interface-based configuration, reading the interface and database output, steering traffic with costs (and the asymmetric routing that follows), and OSPFv3 for IPv6 over link-local addresses. Captured on the three-router edge/core lab.
- Debugging BGP: every session state, reproducedIntermediate · 60 min
Break a working BGP lab a dozen ways and learn to read each failure: Idle, Connect, Active and OpenSent, max-prefix, firewalls, wrong AS, TTL, hold timers, missing policy and unreachable next hops, all with real FRR output and packet captures.