Configuring BFD For OSPFv2

Prerequisites
  • OSPFv2 must be enabled.

  • ICMP must be disabled.

Procedure
  1. Enable BFD support with the command bfd.
  2. Enable BFD on all OSPF interfaces with the command bfd all-interfaces, or enable BFD on a specific interface with the command ip ospf bfd.
  3. For most deployments, the default values for the following features do not need to be changed. If your deployment requires different settings, change the default values with the indicated command:
    BFD setting Default value Command to change it
    Sets the BFD detection multiplier on an interface. 5 bfd detect-multiplier
    Sets the minimum time interval between received BFD echo packets. 500 milliseconds bfd min-echo-receive-interval
    Sets the minimum time interval between transmitted BFD control packets on an interface. 3000 milliseconds bfd min-transmit-interval

    Configuring the timers to be too aggressive (for example, detect-multiplier of 1) can sometimes lead to BFD session flaps depending upon traffic conditions.

  4. Review BFD configuration settings with the commands show bfd.

Examples

This example shows how to enable BFD on all OSPF interfaces.

switch# config
switch(config)# bfd
switch(config) router ospf 1
switch(config-ospf-1)# area 1
switch(config) router ospf 2
switch(config-ospf-1)# area 2
switch(config-ospf-1)# bfd all-interfaces
switch(config-ospf-1)# exit
switch(config)# interface 1/1/1
switch(config-if)# no shutdown
switch(config-if)# ip address 192.168.1.1/24
switch(config-if)# ip ospf 1 area 1
switch(config)# interface 1/1/2
switch(config-if)# no shutdown
switch(config-if)# ip address 192.168.1.2/24
switch(config-if)# ip ospf 2 area 2
switch(config-if)# quit
switch(config)# show ip ospf
switch# show ip ospf
Routing Process 1 with ID : 192.168.1.1 VRF default
-------------------------------------------------

OSPFv2 Protocol is enabled
Graceful-restart is configured
Restart Interval: 120, State: inactive
Last Graceful Restart Exit Status: none
Maximum Paths to Destination: 4
Number of external LSAs 0, checksum sum 0
Number of areas is 1, 1 normal, 0 stub, 0 NSSA
Number of active areas is 1, 1 normal, 0 stub, 0 NSSA
BFD is enabled
Reference Bandwidth: 100000 Mbps
Area (0.0.0.1) (Active)
  Interfaces in this Area: 1 Active Interfaces: 1
  Passive Interfaces: 0 Loopback Interfaces: 0
  SPF calculation has run 2 times
  Area ranges:
  Number of LSAs: 1, checksum sum 7850

Routing Process 1 with ID : 192.168.1.2 VRF default
-------------------------------------------------

OSPFv2 Protocol is enabled
Graceful-restart is configured
Restart Interval: 120, State: inactive
Last Graceful Restart Exit Status: none
Maximum Paths to Destination: 4
Number of external LSAs 0, checksum sum 0
Number of areas is 1, 1 normal, 0 stub, 0 NSSA
Number of active areas is 1, 1 normal, 0 stub, 0 NSSA
BFD is enabled
Reference Bandwidth: 100000 Mbps
Area (0.0.0.2) (Active)
  Interfaces in this Area: 1 Active Interfaces: 1
  Passive Interfaces: 0 Loopback Interfaces: 0
  SPF calculation has run 2 times
  Area ranges:
  Number of LSAs: 1, checksum sum 7850

This example shows how to enable BFD on specific OSPF interface.

switch# config
switch(config)# bfd
switch(config) router ospf 1
switch(config-ospf-1)# area 1
switch(config) router ospf 2
switch(config-ospf-1)# area 2
switch(config-ospf-1)# exit
switch# interface 1/1/1
switch(config-if)# no shutdown
switch(config-if)# ip address 192.168.1.1/24
switch(config-if)# ip ospf 1 area 1
switch(config-if)# ip ospf bfd
switch(config-if)# quit
switch(config)# show ip ospf interface

Interface 1/1/1 is up, line protocol is up
-------------------------------------------

IP address 192.168.1.1/24, Process ID 1 VRF default, area 0.0.0.1
    State Waiting, Status up, Network type Broadcast, Configured cost 1
    Reference Bandwidth: 100000 Mbps
    Link Speed: 1000 Mbps, Calculated cost: 100
    Transit delay 1 sec, Router priority 1
    No designated router on this network
    No backup designated router on this network
    Timer Intervals: Hello 10, Dead 40, Retransmit 5
    No authentication
    Number of Link LSAs: 0, checksum sum 0
    BFD is enabled