As shown in Figure 1, SwitchA is directly connected to SwitchB and Layer 2 transmission devices, SwitchC and SwitchD, are deployed between them. It is required that SwitchA and SwitchB fast detect link faults of the Layer 2 transmission devices to trigger fast route convergence.
The configuration roadmap is as follows:
Configure BFD sessions on SwitchA and SwitchB to detect faults on the link between SwitchA and SwitchB.
Configure association between the BFD session status and interface status on SwitchA and SwitchB after the BFD session becomes Up.
# Assign an IP address to the interface of SwitchA.
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan 10 [SwitchA-vlan10] quit [SwitchA] interface gigabitethernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] port link-type hybrid [SwitchA-GigabitEthernet0/0/1] port hybrid pvid vlan 10 [SwitchA-GigabitEthernet0/0/1] port hybrid untagged vlan 10 [SwitchA-GigabitEthernet0/0/1] quit [SwitchA] interface vlanif 10 [SwitchA-Vlanif10] ip address 10.1.1.1 24 [SwitchA-Vlanif10] quit
# Assign an IP address to the interface of SwitchB.
<HUAWEI> system-view [HUAWEI] sysname SwitchB [SwitchB] vlan 10 [SwitchB-vlan10] quit [SwitchB] interface gigabitethernet 0/0/1 [SwitchB-GigabitEthernet0/0/1] port link-type hybrid [SwitchB-GigabitEthernet0/0/1] port hybrid pvid vlan 10 [SwitchB-GigabitEthernet0/0/1] port hybrid untagged vlan 10 [SwitchB-GigabitEthernet0/0/1] quit [SwitchB] interface vlanif 10 [SwitchB-Vlanif10] ip address 10.1.1.2 24 [SwitchB-Vlanif10] quit
# Enable BFD on SwitchA and set up the BFD session between SwitchA and SwitchB.
[SwitchA] bfd [SwitchA-bfd] quit [SwitchA] bfd atob bind peer-ip default-ip interface gigabitethernet 0/0/1 [SwitchA-bfd-session-atob] discriminator local 10 [SwitchA-bfd-session-atob] discriminator remote 20 [SwitchA-bfd-session-atob] commit [SwitchA-bfd-session-atob] quit
# Enable BFD on SwitchB and set up the BFD session between SwitchA and SwitchB.
[SwitchB] bfd [SwitchB-bfd] quit [SwitchB] bfd btoa bind peer-ip default-ip interface gigabitethernet 0/0/1 [SwitchB-bfd-session-btoa] discriminator local 20 [SwitchB-bfd-session-btoa] discriminator remote 10 [SwitchB-bfd-session-btoa] commit [SwitchB-bfd-session-btoa] quit
# After the configuration is complete, 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 : 16384 (One Hop) State : Up Name : atob -------------------------------------------------------------------------------- Local Discriminator : 10 Remote Discriminator : 20 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
# Configure association between the BFD session status and the interface status on SwitchA.
[SwitchA] bfd atob [SwitchA-bfd-session-atob] process-interface-status [SwitchA-bfd-session-atob] quit
# Configure association between the BFD session status and the interface status on SwitchB.
[SwitchB] bfd btoa [SwitchB-bfd-session-btoa] process-interface-status [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 the Proc interface status field is displayed as Enable.
The command output on SwitchA is used as an example.
[SwitchA] display bfd session all verbose -------------------------------------------------------------------------------- Session MIndex : 16384 (One Hop) State : Up Name : atob -------------------------------------------------------------------------------- Local Discriminator : 10 Remote Discriminator : 20 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 : Enable Process PST : Disable WTR Interval (ms) : - Active Multi : 3 DSCP : - Last Local Diagnostic : No Diagnostic Bind Application : IFNET 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 SwitchC to make the BFD session go Down.
<HUAWEI> system-view [HUAWEI] sysname SwitchC [SwitchC] interface gigabitethernet 0/0/1 [SwitchC-GigabitEthernet0/0/1] shutdown [SwitchC-GigabitEthernet0/0/1] quit
Run the display bfd session all verbose and display interface gigabitethernet 0/0/1 commands on SwitchA. You can see that the BFD session status is Down, and the status of GE0/0/1 is UP (BFD status down).
[SwitchA] display bfd session all verbose -------------------------------------------------------------------------------- Session MIndex : 16384 (One Hop) State : Down Name : atob -------------------------------------------------------------------------------- Local Discriminator : 10 Remote Discriminator : 20 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): 2900 Actual Rx Interval (ms): 2900 Local Detect Multi : 3 Detect Interval (ms) : - Echo Passive : Disable Acl Number : - Destination Port : 3784 TTL : 255 Proc Interface Status : Enable Process PST : Disable WTR Interval (ms) : - Active Multi : 3 DSCP : - Last Local Diagnostic : Control Detection Time Expired Bind Application : IFNET Session TX TmrID : 1038 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] display interface gigabitethernet 0/0/1 GigabitEthernet0/0/1 current state : UP Line protocol current state : UP(BFD status down) ...
The output of the display interface gigabitethernet 0/0/1 command displays information that you need to concern and "..." indicates that information is omitted.
SwitchA configuration file
# sysname SwitchA # vlan batch 10 # bfd # interface Vlanif10 ip address 10.1.1.1 255.255.255.0 # interface GigabitEthernet0/0/1 port link-type hybrid port hybrid pvid vlan 10 port hybrid untagged vlan 10 # bfd atob bind peer-ip default-ip interface GigabitEthernet0/0/1 discriminator local 10 discriminator remote 20 process-interface-status commit # return
SwitchB configuration file
# sysname SwitchB # vlan batch 10 # bfd # interface Vlanif10 ip address 10.1.1.2 255.255.255.0 # interface GigabitEthernet0/0/1 port link-type hybrid port hybrid pvid vlan 10 port hybrid untagged vlan 10 # bfd btoa bind peer-ip default-ip interface GigabitEthernet0/0/1 discriminator local 20 discriminator remote 10 process-interface-status commit # return