Configuring LDP PW redundancy

Network requirements

Create two LDP PWs to implement PW redundancy between CE 1 and CE 2. The primary PW goes through PE 1—PE 2. The backup PW goes through PE 1—PE 3. When the primary PW fails, CE 1 and CE 2 communicate through the backup PW.

Figure 76: Network diagram

Table 25: Interface and IP address assignment

Device

Interface

IP address

Device

Interface

IP address

PE 1

Loop0

1.1.1.1/32

PE 2

Loop0

2.2.2.2/32

Vlan-int12

12.1.1.1/24

Vlan-int12

12.1.1.2/24

Vlan-int13

13.1.1.1/24

PE 3

Loop0

3.3.3.3/32

Vlan-int13

13.1.1.3/24

Configuration procedure

Before you perform the following configurations, configure VLANs and add ports to VLANs on switches.

  1. Configure CE 1.

    <CE1> system-view
    [CE1] interface ten-gigabitethernet 1/0/1
    [CE1-Ten-GigabitEthernet1/0/1] port link-type trunk
    [CE1-Ten-GigabitEthernet1/0/1] port trunk permit vlan 10
    [CE1-Ten-GigabitEthernet1/0/1] quit
    
  2. Configure PE 1:

    # Configure an LSR ID.

    <PE1> system-view
    [PE1] interface loopback 0
    [PE1-LoopBack0] ip address 1.1.1.1 32
    [PE1-LoopBack0] quit
    [PE1] mpls lsr-id 1.1.1.1
    

    # Enable global MPLS LDP.

    [PE1] mpls ldp
    [PE1-ldp] quit
    

    # Configure VLAN interface 12 (the interface connected to PE 2) and VLAN interface 13 (the interface connected to PE 3), and enable LDP for the interfaces.

    [PE1] interface vlan-interface 12
    [PE1-Vlan-interface12] ip address 12.1.1.1 24
    [PE1-Vlan-interface12] mpls enable
    [PE1-Vlan-interface12] mpls ldp enable
    [PE1-Vlan-interface12] quit
    [PE1] interface vlan-interface 13
    [PE1-Vlan-interface13] ip address 13.1.1.1 24
    [PE1-Vlan-interface13] mpls enable
    [PE1-Vlan-interface13] mpls ldp enable
    [PE1-Vlan-interface13] quit
    

    # Configure OSPF on PE 1 for LDP to create LSPs.

    [PE1] ospf
    [PE1-ospf-1] area 0
    [PE1-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0
    [PE1-ospf-1-area-0.0.0.0] network 12.1.1.0 0.0.0.255
    [PE1-ospf-1-area-0.0.0.0] network 13.1.1.0 0.0.0.255
    [PE1-ospf-1-area-0.0.0.0] quit
    [PE1-ospf-1] quit
    

    # Enable L2VPN.

    [PE1] l2vpn enable
    

    # Create service instance 10 on Ten-GigabitEthernet 1/0/1 to match packets that have an outer VLAN ID of 10.

    [PE1] interface ten-gigabitethernet1/0/1
    [PE1-Ten-GigabitEthernet1/0/1] service-instance 10
    [PE1-Ten-GigabitEthernet1/0/1-srv10] encapsulation s-vid 10
    [PE1-Ten-GigabitEthernet1/0/1-srv10] quit
    [PE1-Ten-GigabitEthernet1/0/1] quit
    

    # Create a cross-connect group named vpna, create a cross-connect named ldp in the group, and bind service instance 10 on Ten-GigabitEthernet 1/0/1 to the cross-connect.

    [PE1] xconnect-group vpna
    [PE1-xcg-vpna] connection ldp
    [PE1-xcg-vpna-ldp] ac interface ten-gigabitethernet 1/0/1 service-instance 10
    

    # Create primary and backup LDP PWs for the cross-connect to bind the AC to the PWs and implement PW redundancy.

    [PE1-xcg-vpna-ldp] peer 2.2.2.2 pw-id 20
    [PE1-xcg-vpna-ldp-2.2.2.2-20] backup-peer 3.3.3.3 pw-id 30
    [PE1-xcg-vpna-ldp-3.3.3.3-30-backup] quit 
    [PE1-xcg-vpna-ldp-2.2.2.2-20] quit
    [PE1-xcg-vpna-ldp] quit
    [PE1-xcg-vpna] quit
    [PE1] quit
    
  3. Configure PE 2:

    # Configure LSR ID.

    <PE2> system-view
    [PE2] interface loopback 0
    [PE2-LoopBack0] ip address 2.2.2.2 32
    [PE2-LoopBack0] quit
    [PE2] mpls lsr-id 2.2.2.2
    

    # Enable global MPLS LDP.

    [PE2] mpls ldp
    [PE2-ldp] quit
    

    # Configure VLAN interface 12 (the interface connected to PE 1), and enable LDP on it.

    [PE2] interface vlan-interface 12
    [PE2-Vlan-interface12] ip address 12.1.1.2 24
    [PE2-Vlan-interface12] mpls enable
    [PE2-Vlan-interface12] mpls ldp enable
    [PE2-Vlan-interface12] quit
    

    # Configure OSPF on PE 2 for LDP to create LSPs.

    [PE2] ospf
    [PE2-ospf-1] area 0
    [PE2-ospf-1-area-0.0.0.0] network 12.1.1.0 0.0.0.255
    [PE2-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0
    [PE2-ospf-1-area-0.0.0.0] quit
    [PE2-ospf-1] quit
    

    # Enable L2VPN.

    [PE2] l2vpn enable
    

    # Create service instance 10 on Ten-GigabitEthernet 1/0/1 to match packets that have an outer VLAN ID of 10.

    [PE2] interface ten-gigabitethernet1/0/1
    [PE2-Ten-GigabitEthernet1/0/1] service-instance 10
    [PE2-Ten-GigabitEthernet1/0/1-srv10] encapsulation s-vid 10
    [PE2-Ten-GigabitEthernet1/0/1-srv10] quit
    [PE2-Ten-GigabitEthernet1/0/1] quit
    

    # Create a cross-connect group named vpna, create a cross-connect named ldp in the group, and bind service instance 10 on Ten-GigabitEthernet 1/0/1 to the cross-connect.

    [PE2] xconnect-group vpna
    [PE2-xcg-vpna] connection ldp
    [PE2-xcg-vpna-ldp] ac interface ten-gigabitethernet 1/0/1 service-instance 10
    

    # Create an LDP PW for the cross-connect to bind the AC to the PW.

    [PE2-xcg-vpna-ldp] peer 1.1.1.1 pw-id 20
    [PE2-xcg-vpna-ldp-1.1.1.1-20] quit
    [PE2-xcg-vpna-ldp] quit
    [PE2-xcg-vpna] quit
    
  4. Configure PE 3:

    # Configure an LSR ID.

    <PE3> system-view
    [PE3] interface loopback 0
    [PE3-LoopBack0] ip address 3.3.3.3 32
    [PE3-LoopBack0] quit
    [PE3] mpls lsr-id 3.3.3.3
    

    # Enable global MPLS LDP.

    [PE3] mpls ldp
    [PE3-ldp] quit
    

    # Configure VLAN interface 13 (the interface connected to PE 1), and enable LDP on it.

    [PE3] interface vlan-interface 13
    [PE3-Vlan-interface13] ip address 13.1.1.3 24
    [PE3-Vlan-interface13] mpls enable
    [PE3-Vlan-interface13] mpls ldp enable
    [PE3-Vlan-interface13] quit
    

    # Configure OSPF on PE 3 for LDP to create LSPs.

    [PE3] ospf
    [PE3-ospf-1] area 0
    [PE3-ospf-1-area-0.0.0.0] network 13.1.1.0 0.0.0.255
    [PE3-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0
    [PE3-ospf-1-area-0.0.0.0] quit
    [PE3-ospf-1] quit
    

    # Enable L2VPN.

    [PE3] l2vpn enable
    

    # Create service instance 10 on Ten-GigabitEthernet 1/0/1 to match packets that have an outer VLAN ID of 10.

    [PE3] interface ten-gigabitethernet1/0/1
    [PE3-Ten-GigabitEthernet1/0/1] service-instance 10
    [PE3-Ten-GigabitEthernet1/0/1-srv10] encapsulation s-vid 10
    [PE3-Ten-GigabitEthernet1/0/1-srv10] quit
    [PE3-Ten-GigabitEthernet1/0/1] quit
    

    # Create a cross-connect group named vpna, create a cross-connect named ldp in the group, and bind service instance 10 on Ten-GigabitEthernet 1/0/1 to the cross-connect.

    [PE3] xconnect-group vpna
    [PE3-xcg-vpna] connection ldp
    [PE3-xcg-vpna-ldp] ac interface ten-gigabitethernet 1/0/1 service-instance 10
    

    # Create an LDP PW for the cross-connect to bind the AC to the PW.

    [PE3-xcg-vpna-ldp] peer 1.1.1.1 pw-id 30
    [PE3-xcg-vpna-ldp-1.1.1.1-30] quit
    [PE3-xcg-vpna-ldp] quit
    [PE3-xcg-vpna] quit
    
  5. Configure CE 2.

    <CE2> system-view
    [CE2] interface ten-gigabitethernet 1/0/1
    [CE2-Ten-GigabitEthernet1/0/1] port link-type trunk
    [CE2-Ten-GigabitEthernet1/0/1] port trunk permit vlan 10
    [CE2-Ten-GigabitEthernet1/0/1] quit
    [CE2] interface ten-gigabitethernet 1/0/2
    [CE2-Ten-GigabitEthernet1/0/2] port link-type trunk
    [CE2-Ten-GigabitEthernet1/0/2] port trunk permit vlan 10
    [CE2-Ten-GigabitEthernet1/0/2] quit
    

Verifying the configuration

# Display L2VPN PW information on PE 1. The output shows that two LDP PWs have been established.

<PE1> display l2vpn pw
Flags: M - main, B - backup, H - hub link, S - spoke link, N - no split horizon
Total number of PWs: 2, 1 up, 1 blocked, 0 down, 0 defect

Xconnect-group Name: vpna
Peer            PW ID      In/Out Label    Proto  Flag  Link ID    State
2.2.2.2         20         65651/65779     LDP    M     1          Up
3.3.3.3         30         65650/65779     LDP    B     1          Blocked

# Display detailed information about the primary and backup PWs on PE 1.

<PE1> display l2vpn pw verbose
Xconnect-group Name: vpna
 Connection: ldp
  Peer: 2.2.2.2          PW ID: 20
    Signaling Protocol  : LDP
    Link ID             : 1          PW State : Up
    In Label            : 65651      Out Label: 65779
    Wait to Restore Time: 0 sec
    MTU                 : 1500
    PW Attributes       : Main
    VCCV CC             : -
    VCCV BFD            : -
    Tunnel Group ID     : 0x1800000260000002
    Tunnel NHLFE IDs    : 135
  Peer: 3.3.3.3          PW ID: 30
    Signaling Protocol  : LDP
    Link ID             : 1          PW State : Blocked
    In Label            : 65650      Out Label: 65779
    MTU                 : 1500
    PW Attributes       : Backup
    VCCV CC             : -
    VCCV BFD            : -
    Tunnel Group ID     : 0x1800000360000003 
    Tunnel NHLFE IDs    : 137

# Display L2VPN PW information on PE 2. The output shows that an LDP PW has been established.

[PE2] display l2vpn pw
Flags: M - main, B - backup, H - hub link, S - spoke link, N - no split horizon
Total number of PWs: 1, 1 up, 0 blocked, 0 down, 0 defect

Xconnect-group Name: vpna
Peer            PW ID      In/Out Label    Proto  Flag  Link ID    State
1.1.1.1         20         65779/65651     LDP    M     1          Up

# Display L2VPN PW information on PE 3. The output shows that an LDP PW has been established.

[PE3] display l2vpn pw
Flags: M - main, B - backup, H - hub link, S - spoke link, N - no split horizon
Total number of PWs: 1, 1 up, 0 blocked, 0 down, 0 defect

Xconnect-group Name: vpna
Peer            PW ID      In/Out Label    Proto  Flag  Link ID    State
1.1.1.1         30         65779/65650     LDP    M     1          Up

# Verify that CE 1 and CE 2 can ping each other. (Details not shown.)

# Manually switch to the backup PW on PE 1.

<PE1> l2vpn switchover peer 2.2.2.2 pw-id 20

# Display L2VPN PW information on PE 1. The output shows that the PW switchover is successful.

<PE1> display l2vpn pw
Flags: M - main, B - backup, H - hub link, S - spoke link, N - no split horizon
Total number of PWs: 2, 1 up, 1 blocked, 0 down, 0 defect

Xconnect-group Name: vpna
Peer            PW ID      In/Out Label    Proto  Flag  Link ID    State
2.2.2.2         20         65651/65779     LDP    M     1          Blocked
3.3.3.3         30         65650/65779     LDP    B     1          Up

# Verify that CE 1 and CE 2 can ping each other. (Details not shown.)