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

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

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

Examples

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

switch# config switch(config)# bfd switch(config)# router ospf 1 switch(config-ospf-1)# area 1 switch(config-ospf-1)# bfd all-interfaces switch(config-ospf-1)# exit switch(config) router ospf 2 switch(config-ospf-2)# area 2 switch(config-ospf-2)# bfd all-interfaces switch(config-ospf-2)# 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-if)# exit 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)# exit switch(config)# exit switch# show bfd Admin status : Enabled Echo source IP : 2.2.2.2 Statistics: Total Number of Control Packets Transmitted : 42 Total Number of Control Packets Received : 42 Total Number of Control Packets Dropped : 0 Session Interface Source IP Destination IP Echo State Application ------- --------- --------------- --------------- -------- ---------- ----------- 1 1/1/1 192.168.1.1 100.100.100.101 Enabled Up OSPF 2 1/2/2 192.168.1.2 10.1.5.6 Enabled Up OSPF

This example shows how to enable BFD on a specific OSPFv2 interface.

switch# config switch(config)# bfd switch(config)# router ospf 1 switch(config-ospf-1)# area 1 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-if)# ip ospf bfd switch(config-if)# exit switch(config)# exit switch# show bfd session 1 BFD Session Information – Session 1 Min Tx Interval (sec) : 10 Min Rx Interval (sec) : 10 Min Echo Rx Interval (msec) : 700 Detect Multiplier : 3 Application : OSPF Local Discriminator : 1 Remote Discriminator : 1 Echo : Enabled Local Diagnostic : N/A Remote Diagnostic: N/A Flap count: 0 Internal state: Up Interface Source IP Destination IP State Pkt In Pkt Out Pkt Drop --------- --------------- --------------- ---------- -------- -------- -------- 1/1/1 192.168.1.1 100.100.100.101 Up 100 101 0