Configuring an intra-domain multi-segment PW
Network requirements
As shown in Figure 77, there is no public tunnel between PE 1 and PE 2, and there is an MPLS TE tunnel between PE 1 and P, and an MPLS TE tunnel between P and PE 2. Configure a multi-segment PW between PE 1 and PE 2, so CE 1 and CE 2 can communicate over the backbone. The multi-segment PW includes an LDP PW between PE 1 and P, and a static PW between P and PE 2. The two PWs are connected on P.
Figure 77: Network diagram
Table 26: Interface and IP address assignment
Device | Interface | IP address | Device | Interface | IP address |
---|---|---|---|---|---|
CE 1 | Vlan-int10 | 100.1.1.1/24 | P | Loop0 | 192.4.4.4/32 |
PE 1 | Loop0 | 192.2.2.2/32 | Vlan-int23 | 23.1.1.2/24 | |
Vlan-int23 | 23.1.1.1/24 | Vlan-int26 | 26.2.2.2/24 | ||
CE 2 | Vlan-int10 | 100.1.1.2/24 | PE 2 | Loop0 | 192.3.3.3/32 |
Vlan-int26 | 26.2.2.1/24 |
Configuration procedure
Before you perform the following configurations, configure VLANs and add ports to VLANs on CEs.
Configure CE 1.
<CE1> system-view [CE1] vlan 10 [CE1-vlan10] quit [CE1] interface vlan-interface 10 [CE1-Vlan-interface10] ip address 100.1.1.1 24 [CE1-Vlan-interface10] quit [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 192.2.2.2 32 [PE1-LoopBack0] quit [PE1] mpls lsr-id 192.2.2.2
# Enable L2VPN.
[PE1] l2vpn enable
# Configure MPLS TE to establish an MPLS TE tunnel between PE 1 and P. For more information, see "Configuring MPLS TE."
# Create service instance 1000 on Ten-GigabitEthernet 1/0/1 to match packets that have an outer VLAN ID of 10.
[PE1] interface ten-gigabitethernet 1/0/1 [PE1-Ten-GigabitEthernet1/0/1] service-instance 1000 [PE1-Ten-GigabitEthernet1/0/1-srv1000] encapsulation s-vid 10 [PE1-Ten-GigabitEthernet1/0/1-srv1000] quit [PE1-Ten-GigabitEthernet1/0/1] quit
# Create a cross-connect group named vpn1, create a cross-connect named ldp in the group, and bind service instance 1000 on Ten-GigabitEthernet 1/0/1 to the cross-connect.
[PE1] xconnect-group vpn1 [PE1-xcg-vpn1] connection ldp [PE1-xcg-vpn1-ldp] ac interface ten-gigabitethernet1/0/1 service-instance 1000
# Create an LDP PW for the cross-connect to bind the AC to the PW.
[PE1-xcg-vpn1-ldp] peer 192.4.4.4 pw-id 1000 [PE1-xcg-vpn1-ldp-192.4.4.4-1000] quit [PE1-xcg-vpn1-ldp] quit [PE1-xcg-vpn1] quit
Configure the P device:
# Configure an LSR ID.
<P> system-view [P] interface loopback 0 [P-LoopBack0] ip address 192.4.4.4 32 [P-LoopBack0] quit [P] mpls lsr-id 192.4.4.4
# Enable L2VPN.
[P] l2vpn enable
# Configure MPLS TE to establish an MPLS TE tunnel between PE 1 and P, and between P and PE 2. For more information, see "Configuring MPLS TE."
# Create a cross-connect group named vpn1, create a cross-connect named ldpsvc in the group, and create an LDP PW and a static PW for the cross-connect to form a multi-segment PW that includes the two PWs.
[P] xconnect-group vpn1 [P-xcg-vpn1] connection ldpsvc [P-xcg-vpn1-ldpsvc] peer 192.2.2.2 pw-id 1000 [P-xcg-vpn1-ldpsvc-192.2.2.2-1000] quit [P-xcg-vpn1-ldpsvc] peer 192.3.3.3 pw-id 1000 in-label 100 out-label 200 [P-xcg-vpn1-ldpsvc-192.3.3.3-1000] quit [P-xcg-vpn1-ldpsvc] quit [P-xcg-vpn1] quit
Configure PE 2:
# Configure an LSR ID.
<PE2> system-view [PE2] interface loopback 0 [PE2-LoopBack0] ip address 192.3.3.3 32 [PE2-LoopBack0] quit [PE2] mpls lsr-id 192.3.3.3
# Enable L2VPN.
[PE2] l2vpn enable
# Configure MPLS TE to establish an MPLS TE tunnel between P and PE 2. For more information, see "Configuring MPLS TE."
# Create service instance 1000 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 1000 [PE2-Ten-GigabitEthernet1/0/1-srv1000] encapsulation s-vid 10 [PE2-Ten-GigabitEthernet1/0/1-srv1000] quit [PE2-Ten-GigabitEthernet1/0/1] quit
# Create a cross-connect group named vpn1, create a cross-connect named svc in the group, and bind service instance 1000 on Ten-GigabitEthernet 1/0/1 to the cross-connect.
[PE2] xconnect-group vpn1 [PE2-xcg-vpn1] connection svc [PE2-xcg-vpn1-svc] ac interface ten-gigabitethernet 1/0/1 service-instance 1000
# Create a static PW for the cross-connect to bind the AC to the PW.
[PE2-xcg-vpn1-svc] peer 192.4.4.4 pw-id 1000 in-label 200 out-label 100 [PE2-xcg-vpn1-svc-192.4.4.4-1000] quit [PE2-xcg-vpn1-svc] quit [PE2-xcg-vpn1] quit
Configure CE 2.
<CE2> system-view [CE2] vlan 10 [CE2-vlan10] quit [CE2] interface vlan-interface 10 [CE2-Vlan-interface10] ip address 100.1.1.2 24 [CE2-Vlan-interface10] quit [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
Verifying the configuration
# Display L2VPN PW information on P. The output shows that two PWs have been created to form a multi-segment PW.
[P] display l2vpn pw Flags: M - main, B - backup, H - hub link, S - spoke link, N - no split horizon Total number of PWs: 2, 2 up, 0 blocked, 0 down, 0 defect Xconnect-group Name: vpn1 Peer PW ID In/Out Label Proto Flag Link ID State 192.2.2.2 1000 65779/65650 LDP M 0 Up 192.3.3.3 1000 100/200 Static M 1 Up
# Display L2VPN PW information on PE 1. The output shows that a PW has been created.
[PE1] 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: vpn1 Peer PW ID In/Out Label Proto Flag Link ID State 192.4.4.4 1000 65650/65779 LDP M 1 Up
# Display L2VPN PW information on PE 2. The output shows that a PW has been created.
[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: vpn1 Peer PW ID In/Out Label Proto Flag Link ID State 192.4.4.4 1000 200/100 Static M 1 Up
# Verify that CE 1 and CE 2 can ping each other. (Details not shown.)