BFD for static routes configuration example (direct next hop)
Network requirements
InFigure 3, configure a static route to subnet 120.1.1.0/24 on Switch A, and configure a static route to subnet 121.1.1.0/24 on Switch B. Enable BFD for both routes. Configure a static route to subnet 120.1.1.0/24 and a static route to subnet 121.1.1.0/24 on Switch C. When the link between Switch A and Switch B through the Layer 2 switch fails, BFD can detect the failure immediately and inform Switch A and Switch B to communicate through Switch C.
Figure 3: Network diagram
Device | Interface | IP address | Device | Interface | IP address |
Switch A | Vlan-int10 | 12.1.1.1/24 | Switch B | Vlan-int10 | 12.1.1.2/24 |
Vlan-int11 | 10.1.1.102/24 | Vlan-int13 | 13.1.1.1/24 | ||
Switch C | Vlan-int11 | 10.1.1.100/24 | |||
Vlan-int13 | 13.1.1.2/24 |
Configuration procedure
Configure IP addresses for the interfaces. (Details not shown.)
Configure static routes and BFD:
# Configure static routes on Switch A and enable BFD control mode for the static route that traverses the Layer 2 switch.
<SwitchA> system-view [SwitchA] interface vlan-interface 10 [SwitchA-vlan-interface10] bfd min-transmit-interval 500 [SwitchA-vlan-interface10] bfd min-receive-interval 500 [SwitchA-vlan-interface10] bfd detect-multiplier 9 [SwitchA-vlan-interface10] quit [SwitchA] ip route-static 120.1.1.0 24 vlan-interface 10 12.1.1.2 bfd control-packet [SwitchA] ip route-static 120.1.1.0 24 vlan-interface 11 10.1.1.100 preference 65 [SwitchA] quit
# Configure static routes on Switch B and enable BFD control mode for the static route that traverses the Layer 2 switch.
<SwitchB> system-view [SwitchB] interface vlan-interface 10 [SwitchB-vlan-interface10] bfd min-transmit-interval 500 [SwitchB-vlan-interface10] bfd min-receive-interval 500 [SwitchB-vlan-interface10] bfd detect-multiplier 9 [SwitchB-vlan-interface10] quit [SwitchB] ip route-static 121.1.1.0 24 vlan-interface 10 12.1.1.1 bfd control-packet [SwitchB] ip route-static 121.1.1.0 24 vlan-interface 13 13.1.1.2 preference 65 [SwitchB] quit
# Configure static routes on Switch C.
<SwitchC> system-view [SwitchC] ip route-static 120.1.1.0 24 13.1.1.1 [SwitchC] ip route-static 121.1.1.0 24 10.1.1.102
Verifying the configuration
# Display BFD sessions on Switch A.
<SwitchA> display bfd session Total Session Num: 1 Up Session Num: 1 Init Mode: Active IPv4 Session Working Under Ctrl Mode: LD/RD SourceAddr DestAddr State Holdtime Interface 4/7 12.1.1.1 12.1.1.2 Up 2000ms Vlan10
The output shows that the BFD session has been created.
# Display the static routes on Switch A.
<SwitchA> display ip routing-table protocol static Summary Count : 1 Static Routing table Status : <Active> Summary Count : 1 Destination/Mask Proto Pre Cost NextHop Interface 120.1.1.0/24 Static 60 0 12.1.1.2 Vlan10 Static Routing table Status : <Inactive> Summary Count : 0
The output shows that Switch A communicates with Switch B through VLAN-interface 10. Then the link over VLAN-interface 10 fails.
# Display static routes on Switch A.
<SwitchA> display ip routing-table protocol static Summary Count : 1 Static Routing table Status : <Active> Summary Count : 1 Destination/Mask Proto Pre Cost NextHop Interface 120.1.1.0/24 Static 65 0 10.1.1.100 Vlan11 Static Routing table Status : <Inactive> Summary Count : 0
The output shows that Switch A communicates with Switch B through VLAN-interface 11.