为OSPFv2配置BFD

Prerequisites
  • OSPFv2 must be enabled.

  • ICMP must be disabled.

Procedure
  1. Enable BFD support with the commandbfd.
  2. Enable BFD on all OSPF interfaces with the commandbfd all-interfaces, or enable BFD on a specific interface with the commandip 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, setting a detection multiplier of 1) can sometimes lead to BFD session flaps depending upon traffic conditions.

  4. Review BFD configuration settings with the commandsshow bfd.

Examples

这个例子显示了如何to enable BFD on all OSPFv2 interfaces.

switch#configswitch(config)#bfdswitch(config)#router ospf 1switch(config-ospf-1)#area 1switch(config-ospf-1)#bfd all-interfacesswitch(config-ospf-1)#exitswitch(config)router ospf 2switch(config-ospf-2)#area 2switch(config-ospf-2)#bfd all-interfacesswitch(config-ospf-2)#exitswitch(config)#interface 1/1/1switch(config-if)#no shutdownswitch(config-if)#ip address 192.168.1.1/24switch(config-if)#ip ospf 1 area 1switch(config-if)#exitswitch(config)#interface 1/1/2switch(config-if)#no shutdownswitch(config-if)#ip address 192.168.1.2/24switch(config-if)#ip ospf 2 area 2switch(config-if)#exitswitch(config)#exitswitch#show bfdAdmin 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

这个例子显示了如何to enable BFD on a specific OSPFv2 interface.

switch#configswitch(config)#bfdswitch(config)#router ospf 1switch(config-ospf-1)#area 1switch(config-ospf-1)#exitswitch(config)#interface 1/1/1switch(config-if)#no shutdownswitch(config-if)#ip address 192.168.1.1/24switch(config-if)#ip ospf 1 area 1switch(config-if)#ip ospf bfdswitch(config-if)#exitswitch(config)#exitswitch#show bfd session 1BFD 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