TTR Networks

Intermediate · BFD on VyOS: fast failover for quiet failures · section 2 of 7

OSPF without BFD

✓ Lab-tested 21 October 2026 on VyOS 2026.10.16-0024-rolling, FRR 10.2.1

R1 and R2 run OSPF over both links, with link A cheaper (cost 10) than link B (cost 100), so all traffic uses link A. log-adjacency-changes makes OSPF log every neighbour change, which turns out to be the most useful line in the whole lesson.

The quiet failure

Link A was cut at 08:36:01. R1's log shows OSPF deciding R2 was gone at 08:36:33: 32 seconds later, with the reason InactivityTimer, meaning the 40-second dead timer ran out (R2's last hello had arrived about 8 seconds before the cut).

h1 lost 332 of its 570 pings, which at about 0.105 s each is roughly 35 seconds without connectivity, even though a perfectly good backup link was up the whole time.

Could you just lower OSPF's timers? You can (hello-interval 1, dead-interval 3), but hellos are processed by the routing daemon along with everything else it does, so sub-second hellos are fragile, and every protocol needs tuning separately. BFD solves it once, for all of them.

R1: two links, OSPF with different costs
set system host-name 'R1'
set interfaces ethernet eth0 address '10.0.12.1/30'
set interfaces ethernet eth0 description 'link A to R2'
set interfaces ethernet eth1 address '10.0.12.5/30'
set interfaces ethernet eth1 description 'link B to R2 (backup)'
set interfaces ethernet eth2 address '198.51.100.1/25'
set interfaces ethernet eth2 description 'LAN1'
set interfaces loopback lo address '192.0.2.1/32'
set protocols ospf parameters router-id '192.0.2.1'
set protocols ospf area 0 network '10.0.12.0/30'
set protocols ospf area 0 network '10.0.12.4/30'
set protocols ospf area 0 network '198.51.100.0/25'
set protocols ospf area 0 network '192.0.2.1/32'
set protocols ospf interface eth0 network 'point-to-point'
set protocols ospf interface eth0 cost '10'
set protocols ospf interface eth1 network 'point-to-point'
set protocols ospf interface eth1 cost '100'
set protocols ospf interface eth2 passive
set protocols ospf log-adjacency-changes
  • Lines 2–8: Link A, link B and the LAN.
  • Lines 14–17: Point-to-point OSPF on both links; link A costs 10, link B 100.
  • Line 19: Log every neighbour change.
Cutting link A (real output)
root@r1-container:~# date +%T; ip link set eth0 nomaster   # cut link A in the middle; carrier stays up
08:36:01

root@h1:~# ping -i 0.1 -w 60 -q 198.51.100.130   # started 5 s before the cut
PING 198.51.100.130 (198.51.100.130) 56(84) bytes of data.
--- 198.51.100.130 ping statistics ---
570 packets transmitted, 238 received, 58.2456% packet loss, time 59970ms
rtt min/avg/max/mdev = 0.419/1.591/14.188/1.221 ms
  • Lines 1–2: The cut: link A is detached in the middle, so both routers keep carrier on their interfaces.
  • Line 4: Ten pings a second from h1 to h2, started 5 seconds earlier.
  • Line 7: 332 of 570 pings lost: about 35 seconds of outage.
When OSPF noticed (real output)
vyos@R1:~$ show log | match "AdjChg" | tail -2
Oct 21 08:35:53 ospfd[1284]: AdjChg: Nbr 192.0.2.2, NbrIP 10.0.12.2 (default) on eth0:10.0.12.1: Exchange -> Full (ExchangeDone)
Oct 21 08:36:33 ospfd[1284]: AdjChg: Nbr 192.0.2.2, NbrIP 10.0.12.2 (default) on eth0:10.0.12.1: Full -> Deleted (InactivityTimer)
  • Line 2: The adjacency over link A had formed a little earlier.
  • Line 3: 32 seconds after the cut at 08:36:01: the dead timer ran out (InactivityTimer).