Configuring BFD for Static Routes
Applicable Products and Versions
This example applies to the CE12800/CE6800/CE5800 V100R001C00 or later, the CE12800E V200R002C50 or later, the CloudEngine 16800 V200R005C20 or later, the CE9800 V200R020C00 or later, the CE8800 V100R006C00 or later, and the CE7800 V100R003C00 or later.
For details about the mapping between software versions and switch models, see the Hardware Query Tool.
Networking Requirements
SwitchA and SwitchD are connected through the transport network. A static route with the destination address as 10.1.2.0/24 is configured on SwitchA, and a static route with the destination address as 10.1.1.0/24 is configured on SwitchD. It is required that faults on the link between SwitchA and SwitchD be detected within milliseconds, so that static routes on SwitchA and SwitchD do not become blackhole routes when devices on the transport network are faulty.
Requirement Analysis
Bind static BFD sessions to static routes on SwitchA and SwitchD so that BFD can fast detect faults and static routes do not become blackhole routes.
Procedure
- Create VLANs and add interfaces to the VLANs.
<HUAWEI> system-view [~HUAWEI] sysname SwitchA [*HUAWEI] commit [~SwitchA] vlan 10 [*SwitchA-vlan10] quit [*SwitchA] interface 10ge 1/0/1 [*SwitchA-10GE1/0/1] port link-type trunk [*SwitchA-10GE1/0/1] port trunk allow-pass vlan 10 [*SwitchA-10GE1/0/1] quit [*SwitchA] commit
The configurations of SwitchB, SwitchC, and SwitchD are similar to the configuration of SwitchA.
- Configure VLANIF interfaces and assign IP addresses to the VLANIF interfaces.
[~SwitchA] interface vlanif 10 [*SwitchA-Vlanif10] ip address 10.1.1.1 24 [*SwitchA-Vlanif10] quit [*SwitchA] commit
The configurations of SwitchB, SwitchC, and SwitchD are similar to the configuration of SwitchA.
- Configure BFD sessions between SwitchA and SwitchD.
# On SwitchA, configure a BFD session with SwitchD.
[~SwitchA] bfd [*SwitchA-bfd] quit [*SwitchA] bfd atod bind peer-ip 10.1.2.2 [*SwitchA-bfd-session-atod] discriminator local 10 [*SwitchA-bfd-session-atod] discriminator remote 20 [*SwitchA-bfd-session-atod] commit [~SwitchA-bfd-session-atod] quit
# On SwitchD, configure a BFD session with SwitchA.
[~SwitchD] bfd [*SwitchD-bfd] quit [*SwitchD] bfd dtoa bind peer-ip 10.1.1.1 [*SwitchD-bfd-session-dtoa] discriminator local 20 [*SwitchD-bfd-session-dtoa] discriminator remote 10 [*SwitchD-bfd-session-dtoa] commit [~SwitchD-bfd-session-dtoa] quit
- Configure default static routes and bind BFD sessions to the default static routes.
# On SwitchA, configure a default static route to the external network and bind the default static route to a BFD session named atod.
[~SwitchA] ip route-static 10.1.2.2 24 10.1.1.2 track bfd-session atod [*SwitchA] commit
# On SwitchD, configure a default static route to the external network and bind the default static route to a BFD session named dtoa.
[~SwitchD] ip route-static 10.1.1.1 24 10.1.2.1 track bfd-session dtoa [*SwitchD] commit
Verifying the Configuration
# After the configuration is complete, run the display bfd session all verbose command on SwitchA and SwitchD. You can see that a BFD session is set up and its status is Up, and that the static route is bound to the BFD session.
The display on SwitchA is used as an example.
[~SwitchA] display bfd session all verbose
------------------------------------------------------------------------------ Name : atod (Multi Hop) State : Up -------------------------------------------------------------------------------- Local Discriminator : 10 Remote Discriminator : 20 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Peer IP Address Bind Session Type : Static Bind Peer IP Address : 10.1.2.2 Bind Interface : - FSM Board Id : 1 TOS-EXP : 7 Min Tx Interval (ms) : 1000 Min Rx Interval (ms) : 1000 Actual Tx Interval (ms): 3000 Actual Rx Interval (ms): 3000 WTR Interval (ms) : - Detect Interval (ms) : 3000 Local Detect Multi : 3 Active Multi : 3 Destination Port : 4784 TTL : 254 Last Local Diagnostic : No Diagnostic Bind Application : STATICRT Session Description : - -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 1/0
# Run the shutdown command on 10GE1/0/1 of SwitchB to simulate a link fault.
[~SwitchB] interface 10ge 1/0/1 [~SwitchB-10GE1/0/1] shutdown [*SwitchB-10GE1/0/1] commit
# Run the display bfd session all verbose command on SwitchA and SwitchD. The command output shows that the BFD session status is Down.
The display on SwitchA is used as an example.
[~SwitchA] display bfd session all verbose
------------------------------------------------------------------------------ Name : atod (Multi Hop) State : Down -------------------------------------------------------------------------------- Local Discriminator : 10 Remote Discriminator : 20 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Peer IP Address Bind Session Type : Static Bind Peer IP Address : 10.1.2.2 Bind Interface : - FSM Board Id : 1 TOS-EXP : 7 Min Tx Interval (ms) : 1000 Min Rx Interval (ms) : 1000 Actual Tx Interval (ms): 6761 Actual Rx Interval (ms): 6761 WTR Interval (ms) : - Detect Interval (ms) : - Local Detect Multi : 3 Active Multi : 3 Destination Port : 4784 TTL : 254 Last Local Diagnostic : Control Detection Time Expired Bind Application : STATICRT Session Not Up Reason : In negotiation Session Description : - -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 1/0
Configuration Files
Configuration file of SwitchA
# sysname SwitchA # vlan batch 10 # bfd # interface Vlanif10 ip address 10.1.1.1 255.255.255.0 # interface 10GE1/0/1 port link-type trunk port trunk allow-pass vlan 10 # bfd atod bind peer-ip 10.1.2.2 discriminator local 10 discriminator remote 20 # ip route-static 10.1.2.0 255.255.255.0 10.1.1.2 track bfd-session atod # return
Configuration file of SwitchB
# sysname SwitchB # vlan batch 10 # bfd # interface Vlanif10 ip address 10.1.1.2 255.255.255.0 # interface 10GE1/0/1 port link-type trunk port trunk allow-pass vlan 10 # return
Configuration file of SwitchC
# sysname SwitchC # vlan batch 20 # bfd # interface Vlanif20 ip address 10.1.2.1 255.255.255.0 # interface 10GE1/0/1 port link-type trunk port trunk allow-pass vlan 20 # return
Configuration file of SwitchD
# sysname SwitchD # vlan batch 20 # bfd # interface Vlanif20 ip address 10.1.2.2 255.255.255.0 # interface 10GE1/0/1 port link-type trunk port trunk allow-pass vlan 20 # bfd dtoa bind peer-ip 10.1.1.1 discriminator local 20 discriminator remote 10 # ip route-static 10.1.1.0 255.255.255.0 10.1.2.1 track bfd-session dtoa # return