This section provides an example for configuring the delay of a BFD session to go Up. This configuration prevents traffic loss because a routing protocol goes Up later than an interface.
Some devices switch traffic according to whether a BFD session is Up. When a routing protocol goes Up later than an interface, no route can be found during traffic switchbacks. As a result, traffic is discarded. To resolve this issue, configure a delay to compensate for the time difference caused when the routing protocol goes Up later than the interface.
As shown in Figure 1, BFD in asynchronous mode is used to monitor the direct link between Device A and Device B.
The configuration roadmap is as follows:
Configure a BFD session on Device A to monitor the direct link from Device A to Device B.
Configure a BFD session on Device B to monitor the direct link from Device B to Device A.
To complete the configuration, you need the following data:
Peer IP address monitored by BFD
IP address of a local interface that sends and receives BFD control packets
BFD session names
Local and remote discriminators of BFD sessions
Delay of the BFD session to go Up
# Assign an IP address to the interface on Device A.
<HUAWEI> system-view [~HUAWEI] sysname DeviceA [*HUAWEI] commit [~DeviceA] interface gigabitethernet 0/1/0 [~DeviceA-GigabitEthernet0/1/0] undo shutdown [*DeviceA-GigabitEthernet0/1/0] ip address 10.1.1.1 24 [*DeviceA-GigabitEthernet0/1/0] commit [~DeviceA-GigabitEthernet0/1/0] quit
# Assign an IP address to the interface on Device B.
<HUAWEI> system-view [~HUAWEI] sysname DeviceB [*HUAWEI] commit [~DeviceB] interface gigabitethernet 0/1/0 [~DeviceB-GigabitEthernet0/1/0] undo shutdown [*DeviceB-GigabitEthernet0/1/0] ip address 10.1.1.2 24 [*DeviceB-GigabitEthernet0/1/0] commit [~DeviceB-GigabitEthernet0/1/0] quit
# Enable BFD on Device A and set the delay of the BFD session to go Up to 120s in the BFD view.
To configure the delay of a BFD session to go Up, run the delay-up command only in the BFD view. This command takes effect only for BFD sessions to be established.
[~DeviceA] bfd [*DeviceA-bfd] delay-up 120 [*DeviceA-bfd] commit [~DeviceA-bfd] quit
# Configure BFD on Device A. The following example uses the configuration of single-hop BFD.
[~DeviceA] bfd atob bind peer-ip 10.1.1.2 interface gigabitethernet 0/1/0 [*DeviceA-bfd-session-atob] discriminator local 10 [*DeviceA-bfd-session-atob] discriminator remote 20 [*DeviceA-bfd-session-atob] commit [~DeviceA-bfd-session-atob] quit
# Enable BFD on Device B and set the delay of the BFD session to go Up to 120s in the BFD view.
[~DeviceB]bfd [*DeviceB-bfd] delay-up 120 [*DeviceB-bfd] commit [~DeviceB-bfd] quit
# Configure BFD on Device B. The following example uses the configuration of single-hop BFD.
[~DeviceB] bfd btoa bind peer-ip 10.1.1.1 interface gigabitethernet 0/1/0 [*DeviceB-bfd-session-btoa] discriminator local 10 [*DeviceB-bfd-session-btoa] discriminator remote 20 [*DeviceB-bfd-session-btoa] commit [~DeviceB-bfd-session-btoa] quit
After completing the configurations, run the display bfd statistics command on Device A and Device B. The command output shows that System Session Delay Up Timer is 120, indicating that the BFD session goes Up after a delay of 120s.
The following example uses the command output on Device A.
[~DeviceA] display bfd statistics Current Display Board Number : Main ; Current Product Register Type: Total Up/Down Session Number : 1/0 Current Session Number : Static session : 1 Dynamic session : 0 E_Dynamic session : 0 STATIC_AUTO session : 0 LDP_LSP session : 0 STATIC_LSP session : 0 TE_TUNNEL session : 0 TE_LSP session : 0 PW session : 0 IP session : 1 VSI PW session : 0 ------------------------------------------------------------------------------ PAF/LCS Name Maxnum Minnum Create ------------------------------------------------------------------------------ BFD_CFG_NUM 16384 1 1 BFD_IO_SESSION_NUM 2048 1 0 BFD_PER_TUNNEL_CFG_NUM 16 1 0 ------------------------------------------------------------------------------ Current Total Used Discriminator Num : 1 ------------------------------------------------------------------------------ BFD HAF Information : ------------------------------------------------------------------------------ Current HAF Status : Work ------------------------------------------------------------------------------ BFD for LSP Information : ------------------------------------------------------------------------------ Ability of auto creating BFD session on egress : Disable Period of LSP Ping : 60 ------------------------------------------------------------------------------ BFD other Information : ------------------------------------------------------------------------------ System Session Delay Up Timer : 120 ------------------------------------------------------------------------------
Device A configuration file
# sysname DeviceA # bfd delay-up 120 # interface gigabitethernet0/1/0 undo shutdown ip address 10.1.1.1 255.255.255.0 # bfd atob bind peer-ip 10.1.1.2 interface gigabitethernet 0/1/0 discriminator local 10 discriminator remote 20 # return
Device B configuration file
# sysname DeviceB # bfd delay-up 120 # interface gigabitethernet0/1/0 undo shutdown ip address 10.1.1.2 255.255.255.0 # bfd btoa bind peer-ip 10.1.1.1 interface gigabitethernet 0/1/0 discriminator local 20 discriminator remote 10 # return