As shown in Figure 1, SwitchA and SwitchB are connected through a Layer 2 interface. Faults on the link between SwitchA and SwitchB need to be fast detected.
The configuration roadmap is as follows:
Configure BFD sessions on SwitchA and SwitchB to detect faults on the link between SwitchA and SwitchB.
# Enable BFD on SwitchA.
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] bfd [SwitchA-bfd] quit
# Create a BFD session on SwitchA.
[SwitchA] bfd atob bind peer-ip default-ip interface gigabitethernet 0/0/1 [SwitchA-bfd-session-atob] discriminator local 1 [SwitchA-bfd-session-atob] discriminator remote 2 [SwitchA-bfd-session-atob] commit [SwitchA-bfd-session-atob] quit
# Enable BFD on SwitchB.
<HUAWEI> system-view [HUAWEI] sysname SwitchB [SwitchB] bfd [SwitchB-bfd] quit
# Create a BFD session on SwitchB.
[SwitchB] bfd btoa bind peer-ip default-ip interface gigabitethernet 0/0/1 [SwitchB-bfd-session-btoa] discriminator local 2 [SwitchB-bfd-session-btoa] discriminator remote 1 [SwitchB-bfd-session-btoa] commit [SwitchB-bfd-session-btoa] quit
After the configuration is completed, run the display bfd session all verbose command on SwitchA and SwitchB. You can see that a single-hop BFD session is set up and its status is Up.
The command output on SwitchA is used as an example.
[SwitchA] display bfd session all verbose -------------------------------------------------------------------------------- Session MIndex : 4097 (One Hop) State : Up Name : atob -------------------------------------------------------------------------------- Local Discriminator : 1 Remote Discriminator : 2 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(GigabitEthernet0/0/1) Bind Session Type : Static Bind Peer IP Address : 224.0.0.184 NextHop Ip Address : 224.0.0.184 Bind Interface : GigabitEthernet0/0/1 FSM Board Id : 0 TOS-EXP : 7 Min Tx Interval (ms) : 1000 Min Rx Interval (ms) : 1000 Actual Tx Interval (ms): 1000 Actual Rx Interval (ms): 1000 Local Detect Multi : 3 Detect Interval (ms) : 3000 Echo Passive : Disable Acl Number : - Destination Port : 3784 TTL : 255 Proc Interface Status : Disable Process PST : Disable WTR Interval (ms) : - Active Multi : 3 DSCP : - Last Local Diagnostic : No Diagnostic Bind Application : No Application Bind Session TX TmrID : - Session Detect TmrID : - Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - PDT Index : FSM-0 | RCV-0 | IF-0 | TOKEN-0 Session Description : - -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 1/0
# Run the shutdown command on GE0/0/1 of SwitchA to simulate a link fault.
[SwitchA] interface gigabitethernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] shutdown [SwitchA-GigabitEthernet0/0/1] quit
After the configuration is completed, run the display bfd session all verbose command on SwitchA and SwitchB. You can see that a single-hop BFD session is set up and its status is Down. The command output on SwitchA is used as an example.
[SwitchA] display bfd session all verbose -------------------------------------------------------------------------------- Session MIndex : 4097 (One Hop) State : Down Name : atob -------------------------------------------------------------------------------- Local Discriminator : 1 Remote Discriminator : 2 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(GigabitEthernet0/0/1) Bind Session Type : Static Bind Peer IP Address : 224.0.0.184 NextHop Ip Address : 224.0.0.184 Bind Interface : GigabitEthernet0/0/1 FSM Board Id : 0 TOS-EXP : 7 Min Tx Interval (ms) : 1000 Min Rx Interval (ms) : 1000 Actual Tx Interval (ms): 13000 Actual Rx Interval (ms): 13000 Local Detect Multi : 3 Detect Interval (ms) : - Echo Passive : Disable Acl Number : - Destination Port : 3784 TTL : 255 Proc Interface Status : Disable Process PST : Disable WTR Interval (ms) : - Active Multi : 3 DSCP : - Last Local Diagnostic : Control Detection Time Expired Bind Application : No Application Bind Session TX TmrID : 16402 Session Detect TmrID : - Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - PDT Index : FSM-0 | RCV-0 | IF-0 | TOKEN-0 Session Description : - -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 0/1
SwitchA configuration file
# sysname SwitchA # bfd # bfd atob bind peer-ip default-ip interface GigabitEthernet0/0/1 discriminator local 1 discriminator remote 2 commit # return
SwitchB configuration file
# sysname SwitchB # bfd # bfd btoa bind peer-ip default-ip interface GigabitEthernet0/0/1 discriminator local 2 discriminator remote 1 commit # return