LDP FRR configuration example

Network requirements

Switch S, Switch A, and Switch D reside in the same OSPF domain. Configure OSPF FRR so LDP can establish a primary LSP and a backup LSP on the Switch S—Switch D and the Switch S—Switch A—Switch D links, respectively.

When the primary LSP operates correctly, traffic between subnets 11.1.1.0/24 and 21.1.1.0/24 is forwarded through the LSP.

When the primary LSP fails, traffic between the two subnets is immediately switched to the backup LSP.

Figure 21: Network diagram

Requirements analysis

Configuration procedure

Before configuration, disable the spanning tree feature globally or map each VLAN to an MSTI. For more information, see Layer 2LAN Switching Configuration Guide.

  1. Configure IP addresses and masks for interfaces, including the loopback interfaces, as shown in Figure 21. (Details not shown.)

  2. Configure OSPF on each switch to ensure IP connectivity between them. (Details not shown.)

  3. Configure OSPF FRR by using one of the following methods:

    • (Method 1.) Enable OSPF FRR to calculate a backup next hop by using the LFA algorithm:

      # Configure Switch S.

      <SwitchS> system-view
      [SwitchS] bfd echo-source-ip 10.10.10.10
      [SwitchS] ospf 1
      [SwitchS-ospf-1] fast-reroute lfa
      [SwitchS-ospf-1] quit
      

      # Configure Switch D.

      <SwitchD> system-view
      [SwitchD] bfd echo-source-ip 11.11.11.11
      [SwitchD] ospf 1
      [SwitchD-ospf-1] fast-reroute lfa
      [SwitchD-ospf-1] quit
      
    • (Method 2.) Enable OSPF FRR to specify a backup next hop by using a routing policy:

      # Configure Switch S.

      <SwitchS> system-view
      [SwitchS] bfd echo-source-ip 10.10.10.10
      [SwitchS] ip prefix-list abc index 10 permit 21.1.1.0 24
      [SwitchS] route-policy frr permit node 10
      [SwitchS-route-policy] if-match ip address prefix-list abc
      [SwitchS-route-policy] apply fast-reroute backup-interface vlan-interface 12 backup-nexthop 12.12.12.2
      [SwitchS-route-policy] quit
      [SwitchS] ospf 1
      [SwitchS-ospf-1] fast-reroute route-policy frr
      [SwitchS-ospf-1] quit
      

      # Configure Switch D.

      <SwitchD> system-view
      [SwitchD] bfd echo-source-ip 10.10.10.10
      [SwitchD] ip prefix-list abc index 10 permit 11.1.1.0 24
      [SwitchD] route-policy frr permit node 10
      [SwitchD-route-policy] if-match ip address prefix-list abc
      [SwitchD-route-policy] apply fast-reroute backup-interface vlan-interface 24 backup-nexthop 24.24.24.2
      [SwitchD-route-policy] quit
      [SwitchD] ospf 1
      [SwitchD-ospf-1] fast-reroute route-policy frr
      [SwitchD-ospf-1] quit
      
  4. Enable MPLS and IPv4 LDP:

    # Configure Switch S.

    [SwitchS] mpls lsr-id 1.1.1.1
    [SwitchS] mpls ldp
    [SwitchS-mpls-ldp] quit
    [SwitchS] interface vlan-interface 12
    [SwitchS-Vlan-interface12] mpls enable
    [SwitchS-Vlan-interface12] mpls ldp enable
    [SwitchS-Vlan-interface12] quit
    [SwitchS] interface vlan-interface 13
    [SwitchS-Vlan-interface13] mpls enable
    [SwitchS-Vlan-interface13] mpls ldp enable
    [SwitchS-Vlan-interface13] quit
    

    # Configure Switch D.

    [SwitchD] mpls lsr-id 3.3.3.3
    [SwitchD] mpls ldp
    [SwitchD-mpls-ldp] quit
    [SwitchD] interface vlan-interface 13
    [SwitchD-Vlan-interface13] mpls enable
    [SwitchD-Vlan-interface13] mpls ldp enable
    [SwitchD-Vlan-interface13] quit
    [SwitchD] interface vlan-interface 24
    [SwitchD-Vlan-interface24] mpls enable
    [SwitchD-Vlan-interface24] mpls ldp enable
    [SwitchD-Vlan-interface24] quit
    

    # Configure Switch A.

    [SwitchA] mpls lsr-id 2.2.2.2
    [SwitchA] mpls ldp
    [SwitchA-mpls-ldp] quit
    [SwitchA] interface vlan-interface 12
    [SwitchA-Vlan-interface12] mpls enable
    [SwitchA-Vlan-interface12] mpls ldp enable
    [SwitchA-Vlan-interface12] quit
    [SwitchA] interface vlan-interface 24
    [SwitchA-Vlan-interface24] mpls enable
    [SwitchA-Vlan-interface24] mpls ldp enable
    [SwitchA-Vlan-interface24] quit
    
  5. Configure IPv4 LSP generation policies so LDP uses all static routes and IGP routes to establish LSPs:

    # Configure Switch S.

    [SwitchS] mpls ldp
    [SwitchS-ldp] lsp-trigger all
    [SwitchS-ldp] quit
    

    # Configure Switch D.

    [SwitchD] mpls ldp
    [SwitchD-ldp] lsp-trigger all
    [SwitchD-ldp] quit
    

    # Configure Switch A.

    [SwitchA] mpls ldp
    [SwitchA-ldp] lsp-trigger all
    [SwitchA-ldp] quit
    

Verifying the configuration

# Verify that primary and backup LSPs have been established.

[SwitchS] display mpls ldp lsp 21.1.1.0 24
Status Flags: * - stale, L - liberal, B - backup
FECs: 1            Ingress: 2          Transit: 2      Egress: 0

FEC                In/Out Label        Nexthop         OutInterface
21.1.1.0/24        -/3                 13.13.13.2      Vlan-int13
                   2174/3              13.13.13.2      Vlan-int13
                   -/3(B)              12.12.12.2      Vlan-int12
                   2174/3(B)           12.12.12.2      Vlan-int12