Tuning, checklist and troubleshooting
Choosing timers
Faster isn't automatically better. Every BFD packet must be sent and received on time, by both routers, under load. Too aggressive, and a busy CPU, a short burst of congestion or (in this lab) software emulation makes the session flap, taking the routing protocol down with it, which is worse than a slow failover.
- 300 ms × 3 (FRR's default) is a sensible start for physical links between routers.
- 1 s × 3 or slower for multihop, paths across a provider, and anything virtual or busy.
- Faster timers are for hardware that runs BFD in its forwarding chips; most software routers, VyOS included, run it in a daemon.
Echo mode (echo-mode in a profile) has each router send packets addressed to itself via the neighbour, which forwards them straight back. It tests the neighbour's forwarding path without involving its BFD daemon, and lets slower control packets carry the session. Both sides must support it, and it only works single-hop.
Both sides must agree
A BFD session needs both routers. If only one side is configured, the session never comes up. By default, BGP and OSPF carry on without it, so nothing breaks, but you get no fast detection either. Check show bfd peers after every change. For BGP, bfd strict makes the session wait for BFD before coming up at all.
Checklist
- [ ] BFD on every routing adjacency over links that can fail quietly: switches in between, provider circuits, wireless, tunnels.
- [ ] Named profiles, with the same timers on both ends.
- [ ] Multihop sessions slower than your network's reconvergence.
- [ ]
log-adjacency-changeson OSPF andlog-neighbor-changeson BGP, so failures leave a trace. - [ ] A test like this lab's: cut the link quietly, and measure.
Troubleshooting
| Symptom | Likely cause | Check | |
|---|---|---|---|
| No BFD session at all | Only one side configured, or the protocol didn't ask for one | show bfd peers on both routers | |
| Session stays down | UDP 3784 (single-hop) or 4784 (multihop) blocked by a firewall | The input filter; monitor traffic interface eth0 filter "udp port 3784" | |
| Session flaps, taking routing with it | Timers too aggressive for the load or the path | Raise the interval or the multiplier; show bfd peer … counters | |
| Multihop session drops on every single-link failure | Detection faster than reconvergence | Slower multihop profile | |
| Failover still slow | BFD not attached to that protocol or neighbour | `show bgp neighbors … | match BFD`; the OSPF interface |
set interfaces ethernet eth0 address '10.0.12.1/30'
set interfaces ethernet eth0 description 'link A to R2'
set interfaces ethernet eth0 hw-id '52:54:00:21:00:01'
set interfaces ethernet eth1 address '10.0.12.5/30'
set interfaces ethernet eth1 description 'link B to R2 (backup)'
set interfaces ethernet eth1 hw-id '52:54:00:21:01:01'
set interfaces ethernet eth2 address '198.51.100.1/25'
set interfaces ethernet eth2 description 'LAN1'
set interfaces ethernet eth2 hw-id '52:54:00:21:02:01'
set interfaces loopback lo address '192.0.2.1/32'
set protocols bfd peer 192.0.2.2 multihop
set protocols bfd peer 192.0.2.2 profile 'MULTIHOP'
set protocols bfd peer 192.0.2.2 source address '192.0.2.1'
set protocols bfd profile FAST interval multiplier '3'
set protocols bfd profile FAST interval receive '300'
set protocols bfd profile FAST interval transmit '300'
set protocols bfd profile MULTIHOP interval multiplier '3'
set protocols bfd profile MULTIHOP interval receive '1000'
set protocols bfd profile MULTIHOP interval transmit '1000'
set protocols bgp address-family ipv4-unicast maximum-paths ebgp '1'
set protocols bgp address-family ipv4-unicast network 192.0.2.1/32
set protocols bgp address-family ipv4-unicast network 198.51.100.0/25
set protocols bgp neighbor 10.0.12.2 address-family ipv4-unicast weight '100'
set protocols bgp neighbor 10.0.12.2 bfd profile 'FAST'
set protocols bgp neighbor 10.0.12.2 description 'R2 over link A'
set protocols bgp neighbor 10.0.12.2 remote-as '64502'
set protocols bgp neighbor 10.0.12.6 address-family ipv4-unicast
set protocols bgp neighbor 10.0.12.6 bfd profile 'FAST'
set protocols bgp neighbor 10.0.12.6 description 'R2 over link B'
set protocols bgp neighbor 10.0.12.6 remote-as '64502'
set protocols bgp parameters log-neighbor-changes
set protocols bgp parameters router-id '192.0.2.1'
set protocols bgp system-as '64501'
set system host-name 'R1'- Line 3:
hw-idlines are added by VyOS itself, pinning each interface name to its MAC address. - Lines 11–19: BFD: the multihop peer and both profiles.
- Lines 20–33: BGP, with BFD on both neighbours.