Example for Configuring Dynamic BFD for IPv4 Static Routes
Networking Requirements
As shown in Figure 2-9, a static route with destination address 8.1.1.0/24 is configured on SwitchA, and a static route with destination address 7.1.1.0/24 is configured on SwitchB. To improve convergence speed, users require link faults between SwitchA and SwitchB to be detected at the millisecond level.
Configuration Roadmap
The configuration roadmap is as follows:
Configure dynamic BFD for IPv4 static routes to implement millisecond-level link fault detection between SwitchA and SwitchB. This configuration can improve convergence speed of static routes.
Procedure
- Add interfaces to 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] vlan 20 [*SwitchA-vlan20] quit [*SwitchA] interface 10ge 1/0/2 [*SwitchA-10GE1/0/2] port link-type trunk [*SwitchA-10GE1/0/2] port trunk allow-pass vlan 20 [*SwitchA-10GE1/0/2] quit [*SwitchA] commit
The configuration of SwitchB is similar to that of SwitchA, and is not provided here.
- Assign IP addresses to the VLANIF interfaces.
[~SwitchA] interface vlanif 10 [*SwitchA-Vlanif10] ip address 192.168.1.1 24 [*SwitchA-Vlanif10] quit [*SwitchA] interface vlanif 20 [*SwitchA-Vlanif20] ip address 10.7.1.1 24 [*SwitchA-Vlanif20] quit [*SwitchA] commit
The configuration of SwitchB is similar to that of SwitchA, and is not provided here.
- Configure static routes.
# Configure a static route to 10.8.1.1/24 on SwitchA.
[~SwitchA] ip route-static 10.8.1.1 24 192.168.1.2
[*SwitchA] commit
# Configure a static route to 10.7.1.1/24 on SwitchB.
[~SwitchB] ip route-static 10.7.1.1 24 192.168.1.1
[*SwitchB] commit
- Configure dynamic BFD for static routes.
# Bind a static route to a BFD session on SwitchA.
[~SwitchA] bfd
[*SwitchA-bfd] quit
[*SwitchA] ip route-static bfd 192.168.1.2 local-address 192.168.1.1
[*SwitchA] ip route-static 10.8.1.1 24 192.168.1.2 bfd enable
[*SwitchA] commit
# Bind a static route to a BFD session on SwitchB.
[~SwitchB] bfd
[*SwitchB-bfd] quit
[*SwitchB] ip route-static bfd 192.168.1.1 local-address 192.168.1.2
[*SwitchB] ip route-static 10.7.1.1 24 192.168.1.1 bfd enable
[*SwitchB] commit
- Verify the configuration.
# When the configuration is complete, run the display bfd session all verbose command on SwitchA and SwitchB. The command output shows that the BFD session is established, the BFD session status is Up, and static routes are bound to BFD sessions.
Take the display on SwitchA as an example.
[~SwitchA] display bfd session all verbose
(w): State in WTR (*): State is invalid Total UP/DOWN Session Number : 1/0 -------------------------------------------------------------------------------- Name : dyn_16390 (Multiple Hops) State : Up -------------------------------------------------------------------------------- Local Discriminator : 16390 Remote Discriminator : 16388 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Peer IP Address Bind Session Type : Dynamic Bind Peer IP Address : 192.168.1.2 Bind Interface : - Bind Source IP Address : 192.168.1.1 FSM Board ID : 1 ToS-EXP : 7 Min Tx Interval (ms) : 1000 Min Rx Interval (ms) : 1000 Actual Tx Interval (ms): 1000 Actual Rx Interval (ms): 1000 WTR Interval (ms) : - Detect Interval (ms) : 3000 Local Detect Multi : 3 Active Multi : 3 Destination Port : 4784 TTL : 253 Process PST : Disable Config PST : Disable Last Local Diagnostic : No Diagnostic Bind Application : STATICRT Session Description : - --------------------------------------------------------------------------------
Configuration Files
Configuration file of SwitchA
#
sysname SwitchA
#
vlan batch 10 20
#
bfd
#
interface Vlanif10
ip address 192.168.1.1 255.255.255.0
#
interface Vlanif20
ip address 10.7.1.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 20
#
ip route-static bfd 192.168.1.2 local-address 192.168.1.1
ip route-static 10.8.1.1 255.255.255.0 192.168.1.2 bfd enable
#
return
Configuration file of SwitchB
#
sysname SwitchB
#
vlan batch 10 30
#
bfd
#
interface Vlanif10
ip address 192.168.1.2 255.255.255.0
#
interface Vlanif30
ip address 10.8.1.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 30
#
ip route-static bfd 192.168.1.1 local-address 192.168.1.2
ip route-static 10.7.1.1 255.255.255.0 192.168.1.1 bfd enable
#
return