BFD for PW configuration example
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. Configure BFD to inspect the connectivity of the primary PW. When the primary PW fails, CE 1 and CE 2 communicate through the backup PW.
Figure 91: Network diagram
Table 30: 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, create VLANs on each switch and add ports to the VLANs.
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
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
# Establish LDP sessions with PE 2 and PE 3.
[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 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
# Enable MPLS BFD.
[PE1] mpls bfd 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 PW class pwa. In the PW class, configure BFD to verify PW connectivity and configure the VCCV CC type as router-alert.
[PE1] pw-class pwa [PE1-pw-pwa] vccv bfd [PE1-pw-pwa] vccv cc router-alert [PE1-pw-pwa] quit
# Create cross-connect group vpna and create a cross-connect named ldp in the cross-connect group. Bind service instance 10 on Ten-GigabitEthernet 1/0/1 to the cross-connect and create the primary and backup LDP PWs in the cross-connect. The primary PW references the PW class pwa.
[PE1] xconnect-group vpna [PE1-xcg-vpna] connection ldp [PE1-xcg-vpna-ldp] ac interface ten-gigabitethernet 1/0/1 service-instance 10 [PE1-xcg-vpna-ldp] peer 2.2.2.2 pw-id 20 pw-class pwa [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
Configure PE 2:
# Configure an 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
# Establish an LDP session with PE 1.
[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 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
# Enable MPLS BFD.
[PE2] mpls bfd 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 PW class pwa. In the PW class, configure BFD to verify PW connectivity and configure the VCCV CC type as router-alert.
[PE2] pw-class pwa [PE2-pw-pwa] vccv bfd [PE2-pw-pwa] vccv cc router-alert [PE2-pw-pwa] quit
# Create cross-connect group vpna and create a cross-connect named ldp in the cross-connect group. Bind service instance 10 on Ten-GigabitEthernet 1/0/1 to the cross-connect and create an LDP PW that references the PW class pwa in 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 [PE2-xcg-vpna-ldp] peer 1.1.1.1 pw-id 20 pw-class pwa [PE2-xcg-vpna-ldp-1.1.1.1-20] quit [PE2-xcg-vpna-ldp] quit [PE2-xcg-vpna] quit
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
# Establish an LDP session with PE 1.
[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 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 cross-connect group vpna and create a cross-connect named ldp in the cross-connect group. Bind service instance 10 on Ten-GigabitEthernet 1/0/1 to the cross-connect and create an LDP PW in 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 [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
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 PWs (one primary and one backup) 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 L2VPN PW information on PE 2. The output shows that a 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 a 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
# Execute the display l2vpn pw bfd command on PE 1 and PE 2. The output shows that a BFD session in up state has been established between PE 1 and PE 2 to verify the PW connectivity between 1.1.1.1/32 and 3.3.3.3/32. This example uses PE 1.
[PE1] display l2vpn pw bfd Total number of sessions: 1, 1 up, 0 down, 0 init FEC Type: PW FEC-128 FEC Info: Peer IP: 3.3.3.3 PW ID: 3 Connection ID: 2147483648 Link ID: 1 Local Discr: 514 Remote Discr: 514 Source IP: 1.1.1.1 Destination IP: 127.0.0.2 Session State: Up Session Role: Active Template Name: -
# Verify that CE 1 and CE 2 can ping each other. (Details not shown.)
# Shut down the PW between PE 1 and PE 2. Execute the display l2vpn pw bfd command. The output shows that the BFD session becomes down.
[PE1] display l2vpn pw bfd Total number of sessions: 1, 0 up, 1 down, 0 init FEC Type: PW FEC-128 FEC Info: Peer IP: 3.3.3.3 PW ID: 3 Connection ID: 2147483648 Link ID: 1 Local Discr: 514 Remote Discr: 514 Source IP: 1.1.1.1 Destination IP: 127.0.0.2 Session State: Down Session Role: Active Template Name: -
# Display L2VPN PW information on PE 1. The output shows that backup PW is in use.
<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, 0 blocked, 0 down, 1 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 BFD Defect 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.)