BFD for static routes configuration example (indirect next hop)

Network requirements

As shown in Figure 5, Switch A has a route to interface Loopback 1 (2.2.2.9/32) on Switch B, with output interface VLAN-interface 10. Switch B has a route to interface Loopback 1 (1.1.1.9/32) on Switch A, with output interface VLAN-interface 12. Switch D has a route to 1.1.1.9/32, with output interface VLAN-interface 10, and a route to 2.2.2.9/32, with output interface VLAN-interface 12.

Configure static routes to subnet 120.1.1.0/24 on Switch A, static routes to subnet 121.1.1.0/24 on Switch B, and static routes to subnets 120.1.1.0/24 and 121.1.1.0/24 on both Switch C and Switch D. Enable BFD so that when the link between Switch A and Switch B through Switch D fails, BFD can detect the failure immediately and Switch A and Switch B can communicate through Switch C.

Figure 5: Network diagram

Device

Interface

IP address

Device

Interface

IP address

Switch A

Vlan-int10

12.1.1.1/24

Switch B

Vlan-int12

11.1.1.1/24

Vlan-int11

10.1.1.102/24

Vlan-int13

13.1.1.1/24

Loop1

1.1.1.9/32

Loop1

2.2.2.9/32

Switch C

Vlan-int11

10.1.1.100/24

Switch D

Vlan-int10

12.1.1.2/24

Vlan-int13

13.1.1.2/24

Vlan-int12

11.1.1.2/24

Configuration procedure

  1. Configure IP addresses for the interfaces. (Details not shown.)

  2. Configure static routes and BFD:

    # Configure static routes on Switch A and enable BFD control mode for the static route that traverses Switch D.

    <SwitchA> system-view
    [SwitchA] interface loopback 1
    [SwitchA-LoopBack1] bfd min-transmit-interval 500
    [SwitchA-LoopBack1] bfd min-receive-interval 500
    [SwitchA-LoopBack1] bfd detect-multiplier 9
    [SwitchA-LoopBack1] quit
    [SwitchA] ip route-static 120.1.1.0 24 2.2.2.9 bfd control-packet bfd-source 1.1.1.9
    [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 Switch D.

    <SwitchB> system-view
    [SwitchB] interface loopback 1
    [SwitchB-LoopBack1] bfd min-transmit-interval 500
    [SwitchB-LoopBack1] bfd min-receive-interval 500
    [SwitchB-LoopBack1] bfd detect-multiplier 9
    [SwitchB-LoopBack1] quit
    [SwitchB] ip route-static 121.1.1.0 24 1.1.1.9 bfd control-packet bfd-source 2.2.2.9
    [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 vlan-interface 13 13.1.1.1
    [SwitchC] ip route-static 121.1.1.0 24 vlan-interface 11 10.1.1.102
    

    # Configure static routes on Switch D.

    <SwitchD> system-view
    [SwitchD] ip route-static 120.1.1.0 24 vlan-interface 12 11.1.1.1
    [SwitchD] ip route-static 121.1.1.0 24 vlan-interface 10 12.1.1.1
    
  3. Verify the configuration:

    # Display the BFD session information on Switch A.

    <SwitchA> display bfd session
    
     Total Session Num: 1            Init Mode: Active
    
     Session Working Under Ctrl Mode:
    
     LD/RD         SourceAddr      DestAddr        State Holdtime Interface
     4/7           1.1.1.9         2.2.2.9         Up    2000ms   Loop1
    

    The output shows that the BFD session has been created.

    # Display static routes on Switch A.

    <SwitchA> display ip routing-table protocol static
    Public Routing Table : Static
    Summary Count : 2
    
    Static Routing table Status : <Active>
    Summary Count : 1
    Destination/Mask    Proto  Pre  Cost         NextHop         Interface
    120.1.1.0/24        Static 60   0            2.2.2.9         Vlan10
    
    Static Routing table Status : <Inactive>
    Summary Count : 1
    Destination/Mask    Proto  Pre  Cost         NextHop         Interface
    120.1.1.0/24        Static 65   0            10.1.1.100      Vlan11
    

    The output shows that Switch A communicates with Switch B through VLAN-interface 10.

    When the link over VLAN-interface 10 fails, Switch A can quickly detect the failure.

    # Display static routes on Switch A again.

    <SwitchA> display ip routing-table protocol static
    Public Routing Table : 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 now.