Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Detect a failed routing peer with BFD

BFD can tell a routing protocol that its neighbor has failed before the protocol’s own hold timer expires. Check BFD and protocol state separately.

Configure the first router

Router A enables BFD on a particular BGP neighbor. The lab uses permissive eBGP policy only inside its disposable namespaces. The BFD intervals are milliseconds; the BGP hold time is seconds.

router-id = "10.0.0.1"
[bfd]
min-tx      = 200
min-rx      = 200
detect-mult = 3
[bgp]
enabled             = true
local-as            = 65001
hold-time           = 180
ebgp-require-policy = false
[[bgp.neighbor]]
address   = "10.0.0.2"
remote-as = 65002
bfd       = true

Observe the result

bash scripts/bgp-bfd-smoke.sh

On a separate running instance, inspect the same state:

wren show bfd
wren show bgp neighbors
sequenceDiagram
  participant A as Router A
  participant B as Router B
  A->>B: BGP Established
  A->>B: BFD Up
  Note over B: B stops answering
  A->>A: no BFD packet for detect-mult × interval
  A->>A: BFD Down, BGP session torn down
  Note over A: hold timer (180 s) not needed

The fixture waits for BFD Up and BGP Established, then checks that loss of BFD tears down BGP before its 180-second hold timer. Detection depends on the negotiated intervals and multiplier.

Lab source.

Authentication and echo

The per-session authentication test configures peers independently. To check packet return on the data path, start with the IPv4 echo or IPv6 echo example.