Technical Tip: Bidirectional Forwarding Detection (BFD) with static routes
| Description | This article describes the use case of Bidirectional Forwarding Detection (BFD) with a static route. |
| Scope | FortiGate. |
| Solution | Bidirectional Forwarding Detection (BFD) is designed to detect failures in the bidirectional path between two forwarding engines quickly. In FortiGate devices running FortiOS, BFD can be integrated with static routes to provide faster failover compared to traditional methods.
When BFD is enabled on a static route, FortiGate monitors the reachability of the next-hop gateway using BFD control packets. If the BFD session goes down (indicating a path failure), the associated static route is withdrawn from the routing table. When the session recovers, the route is reinstated. This enables rapid convergence in redundant setups using multiple static routes with different priorities or administrative distances.
Topology: Consider two FortiGate devices, with redundant paths simulated through backup gateways:
Destination host/network: 1.1.1.1/32 (behind FortiGate B or reachable via gateways).
Configuration steps: Step 1: Enable BFD on the Interface (Both FortiGates).
config system interface
Step 2: Configure BFD Neighbor (Recommended on the peer or both sides).
config router bfd
Step 3: Configure Static Routes with BFD (On FortiGate A):
config router static
Verification commands:
get router info bfd neighbor get router info bfd neighbor get router info bfd neighbor detail get router info routing-table all
Troubleshooting: Capture BFD packets (UDP ports 3784 control, 3785 echo if used):
diagnose sniffer packet any "port 3784" 4
Enable BFD debug processes:
diagnose debug application bfdd -1 diagnose debug enable
Configuration of BFD on the default static route when the outgoing interface is part of the SD-WAN zone is not possible. BFD on static routes in FortiOS (including the latest v7.6.x) is designed for routes with a fixed next-hop. BFD probes the specific gateway IP over the specified device interface. If the session goes down, the route is withdrawn from the routing table, triggering failover to a backup route.
In contrast, a default route (0.0.0.0/0) whose outgoing interface is an SD-WAN zone, no device or single gateway is specified. The actual egress interface and next-hop are chosen dynamically by SD-WAN rules/members/priorities. Instead, use SD-WAN Performance SLAs (or link health monitors). They provide equivalent fast-failure detection on the individual SD-WAN members and automatically remove unhealthy members from selection.
Related article: |