BFD for LSP configuration example

Network requirements

Use LDP to establish an LSP from 1.1.1.9/32 to 3.3.3.9/32 and an LSP from 3.3.3.9/32 to 1.1.1.9/32. Use BFD to verify LSP connectivity.

Figure 90: Network diagram

Configuration procedure

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

  2. Configure OSPF to ensure IP connectivity between the switches:

    # Configure Switch A.

    <SwitchA> system-view
    [SwitchA] ospf
    [SwitchA-ospf-1] area 0
    [SwitchA-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0
    [SwitchA-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
    [SwitchA-ospf-1-area-0.0.0.0] quit
    [SwitchA-ospf-1] quit
    

    # Configure Switch B.

    <SwitchB> system-view
    [SwitchB] ospf
    [SwitchB-ospf-1] area 0
    [SwitchB-ospf-1-area-0.0.0.0] network 2.2.2.9 0.0.0.0
    [SwitchB-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
    [SwitchB-ospf-1-area-0.0.0.0] network 20.1.1.0 0.0.0.255
    [SwitchB-ospf-1-area-0.0.0.0] quit
    [SwitchB-ospf-1] quit
    

    # Configure Switch C.

    <SwitchC> system-view
    [SwitchC] ospf
    [SwitchC-ospf-1] area 0
    [SwitchC-ospf-1-area-0.0.0.0] network 3.3.3.9 0.0.0.0
    [SwitchC-ospf-1-area-0.0.0.0] network 20.1.1.0 0.0.0.255
    [SwitchC-ospf-1-area-0.0.0.0] quit
    [SwitchC-ospf-1] quit
    
  3. Enable MPLS and LDP:

    # Configure Switch A.

    [SwitchA] mpls lsr-id 1.1.1.9
    [SwitchA] mpls ldp
    [SwitchA-ldp] quit
    [SwitchA] interface vlan-interface 2
    [SwitchA-Vlan-interface2] mpls enable
    [SwitchA-Vlan-interface2] mpls ldp enable
    [SwitchA-Vlan-interface2] quit
    

    # Configure Switch B.

    [SwitchB] mpls lsr-id 2.2.2.9
    [SwitchB] mpls ldp
    [SwitchB-ldp] quit
    [SwitchB] interface vlan-interface 2
    [SwitchB-Vlan-interface2] mpls enable
    [SwitchB-Vlan-interface2] mpls ldp enable
    [SwitchB-Vlan-interface2] quit
    [SwitchB] interface vlan-interface 3
    [SwitchB-Vlan-interface3] mpls enable
    [SwitchB-Vlan-interface3] mpls ldp enable
    [SwitchB-Vlan-interface3] quit
    

    # Configure Switch C.

    [SwitchC] mpls lsr-id 3.3.3.9
    [SwitchC] mpls ldp
    [SwitchC-ldp] quit
    [SwitchC] interface vlan-interface 3
    [SwitchC-Vlan-interface3] mpls enable
    [SwitchC-Vlan-interface3] mpls ldp enable
    [SwitchC-Vlan-interface3] quit
    
  4. Enable MPLS BFD, and configure BFD to verify LSP connectivity.

    # Configure Switch A.

    [SwitchA] mpls bfd enable
    [SwitchA] mpls bfd 3.3.3.9 32
    

    # Configure Switch C.

    [SwitchC] mpls bfd enable
    [SwitchC] mpls bfd 1.1.1.9 32
    

Verifying the configuration

# Display BFD information for LSPs on Switch A and Switch C. This example uses Switch A.

[SwitchA] display mpls bfd
 Total number of sessions: 2, 2 up, 0 down, 0 init

 FEC Type: LSP
 FEC Info:
   Destination: 1.1.1.9
   Mask Length: 32
 NHLFE ID: -
 Local Discr: 514                    Remote Discr: 514
 Source IP: 1.1.1.9                  Destination IP: 3.3.3.9
 Session State: Up                   Session Role: Active
 Template Name: -

 FEC Type: LSP
 FEC Info:
   Destination: 3.3.3.9
   Mask Length: 32
 NHLFE ID: 1025
 Local Discr: 513                    Remote Discr: 513
 Source IP: 1.1.1.9                  Destination IP: 127.0.0.1
 Session State: Up                   Session Role: Passive
 Template Name: -

The output shows that two BFD sessions have been established between Switch A and Switch C. One session verifies the connectivity of the LSP from 3.3.3.9/32 to 1.1.1.9/32 and the other session verifies the connectivity of the LSP from 1.1.1.9/32 to 3.3.3.9/32.