- Table of Contents
-
- 09-MPLS Configuration Guide
- 00-Preface
- 01-Basic MPLS configuration
- 02-IPv6 MPLS L3VPN configuration examples
- 03-IPv6 MPLS L3VPN configuration
- 04-L2VPN access to L3VPN or IP backbone configuration
- 05-LDP configuration
- 06-MCE configuration
- 07-MPLS L2VPN configuration examples
- 08-MPLS L2VPN configuration
- 09-MPLS L3VPN configuration examples
- 10-MPLS L3VPN configuration
- 11-MPLS OAM configuration
- 12-MPLS TE configuration
- 13-RSVP configuration
- 14-Static CRLSP configuration
- 15-Static LSP configuration
- 16-Tunnel policy configuration
- 17-VPLS configuration examples
- 18-VPLS configuration
- Related Documents
-
| Title | Size | Download |
|---|---|---|
| 07-MPLS L2VPN configuration examples | 415.88 KB |
MPLS L2VPN
MPLS L2VPN configuration examples
Example: Configuring local MPLS L2VPN connections
Network configuration
Configure local MPLS L2VPN connections between the PE and CEs to allow Layer 2 communication between CE 1 and CE 2.
Figure 1 Network diagram
Table 1 Interface label and interface name mappings
|
Interface label |
Interface name |
|
Interface1 |
Ten-GigabitEthernet3/0/1 |
|
Interface2 |
Ten-GigabitEthernet3/0/2 |
Procedure
1. Configure CE 1.
<Sysname> system-view
[Sysname] sysname CE1
[CE1] interface ten-gigabitethernet 3/0/1
[CE1-Ten-GigabitEthernet3/0/1] ip address 100.1.1.1 24
[CE1-Ten-GigabitEthernet3/0/1] quit
2. Configure CE 2.
<Sysname> system-view
[Sysname] sysname CE2
[CE2] interface ten-gigabitethernet 3/0/1
[CE2-Ten-GigabitEthernet3/0/1] ip address 100.1.1.2 24
[CE2-Ten-GigabitEthernet3/0/1] quit
3. Configure PE:
# Enable L2VPN.
<Sysname> system-view
[Sysname] sysname PE
[PE] l2vpn enable
# Create a cross-connect group named vpn1, create a cross-connect named vpn1 in the group, and bind Ten-GigabitEthernet 3/0/1 and Ten-GigabitEthernet 3/0/2 to the cross-connect.
[PE] xconnect-group vpn1
[PE-xcg-vpn1] connection vpn1
[PE-xcg-vpn1-vpn1] ac interface ten-gigabitethernet 3/0/1
[PE-xcg-vpn1-vpn1-Ten-GigabitEthernet3/0/1] quit
[PE-xcg-vpn1-vpn1] ac interface ten-gigabitethernet 3/0/2
[PE-xcg-vpn1-vpn1-Ten-GigabitEthernet3/0/2] quit
[PE-xcg-vpn1-vpn1] quit
[PE-xcg-vpn1] quit
Verifying the configuration
# Verify that two AC forwarding entries exist on the PE.
[PE] display l2vpn forwarding ac
Total number of cross-connections: 1
Total number of ACs: 2
AC Xconnect-group Name Link ID
XGE3/0/1 vpn1 0
XGE3/0/2 vpn1 1
# Verify that CE 1 and CE 2 can ping each other. (Details not shown.)
Configuration files
· CE 1
#
sysname CE1
#
interface Ten-GigabitEthernet3/0/1
ip address 100.1.1.1 255.255.255.0
#
return
· CE 2
#
sysname CE2
#
interface Ten-GigabitEthernet3/0/1
ip address 100.1.1.2 255.255.255.0
#
return
· PE
#
sysname PE
#
l2vpn enable
#
xconnect-group vpn1
connection vpn1
ac interface Ten-GigabitEthernet3/0/1
ac interface Ten-GigabitEthernet3/0/2
#
return
Example: Configuring a static PW
Network configuration
Create a static PW between PE 1 and PE 2 over the backbone to allow communication between CE 1 and CE 2.
Figure 2 Network diagram
Table 2 Interface label and interface name mappings
|
Interface label |
Interface name |
|
Interface1 |
Ten-GigabitEthernet3/0/1 |
|
Interface2 |
Ten-GigabitEthernet3/0/2 |
Table 3 Interface and IP address assignment
|
Device |
Interface |
IP address |
Device |
Interface |
IP address |
|
CE 1 |
XGE3/0/1 |
100.1.1.1/24 |
P |
Loop0 |
192.4.4.4/32 |
|
PE 1 |
Loop0 |
192.2.2.2/32 |
|
XGE3/0/1 |
10.1.1.2/24 |
|
|
XGE3/0/1 |
- |
|
XGE3/0/2 |
10.2.2.2/24 |
|
|
XGE3/0/2 |
10.1.1.1/24 |
PE 2 |
Loop0 |
192.3.3.3/32 |
|
CE 2 |
XGE3/0/1 |
100.1.1.2/24 |
|
XGE3/0/1 |
- |
|
|
|
|
|
XGE3/0/2 |
10.2.2.1/24 |
Procedure
1. Configure CE 1.
<Sysname> system-view
[Sysname] sysname CE1
[CE1] interface ten-gigabitethernet 3/0/1
[CE1-Ten-GigabitEthernet3/0/1] ip address 100.1.1.1 24
[CE1-Ten-GigabitEthernet3/0/1] quit
2. Configure PE 1:
# Configure an LSR ID.
<Sysname> system-view
[Sysname] sysname PE1
[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
# Enable global LDP.
[PE1] mpls ldp
[PE1-ldp] quit
# Configure Ten-GigabitEthernet 3/0/2 (the interface connected to the P device), and enable LDP on the interface.
[PE1] interface ten-gigabitethernet 3/0/2
[PE1-Ten-GigabitEthernet3/0/2] ip address 10.1.1.1 24
[PE1-Ten-GigabitEthernet3/0/2] mpls enable
[PE1-Ten-GigabitEthernet3/0/2] mpls ldp enable
[PE1-Ten-GigabitEthernet3/0/2] quit
# Configure OSPF for LDP to create LSPs.
[PE1] ospf
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 10.1.1.1 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 192.2.2.2 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# Create a cross-connect group named vpna, create a cross-connect named svc in the group, and bind Ten-GigabitEthernet 3/0/1 to the cross-connect.
[PE1] xconnect-group vpna
[PE1-xcg-vpna] connection svc
[PE1-xcg-vpna-svc] ac interface ten-gigabitethernet 3/0/1
[PE1-xcg-vpna-svc-Ten-GigabitEthernet3/0/1] quit
# Create a static PW for the cross-connect to bind the AC to the PW.
[PE1-xcg-vpna-svc] peer 192.3.3.3 pw-id 3 in-label 100 out-label 200
[PE1-xcg-vpna-svc-192.3.3.3-3] quit
[PE1-xcg-vpna-svc] quit
[PE1-xcg-vpna] quit
3. Configure the P device:
# Configure an LSR ID.
<Sysname> system-view
[Sysname] sysname P
[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 global LDP.
[P] mpls ldp
[P-ldp] quit
# Configure Ten-GigabitEthernet 3/0/1 (the interface connected to PE 1), and enable LDP on the interface.
[P] interface ten-gigabitethernet 3/0/1
[P-Ten-GigabitEthernet3/0/1] ip address 10.1.1.2 24
[P-Ten-GigabitEthernet3/0/1] mpls enable
[P-Ten-GigabitEthernet3/0/1] mpls ldp enable
[P-Ten-GigabitEthernet3/0/1] quit
# Configure Ten-GigabitEthernet 3/0/2 (the interface connected to PE 2), and enable LDP on the interface.
[P] interface ten-gigabitethernet 3/0/2
[P-Ten-GigabitEthernet3/0/2] ip address 10.2.2.2 24
[P-Ten-GigabitEthernet3/0/2] mpls enable
[P-Ten-GigabitEthernet3/0/2] mpls ldp enable
[P-Ten-GigabitEthernet3/0/2] quit
# Configure OSPF for LDP to create LSPs.
[P] ospf
[P-ospf-1] area 0
[P-ospf-1-area-0.0.0.0] network 10.1.1.2 0.0.0.255
[P-ospf-1-area-0.0.0.0] network 10.2.2.2 0.0.0.255
[P-ospf-1-area-0.0.0.0] network 192.4.4.4 0.0.0.0
[P-ospf-1-area-0.0.0.0] quit
[P-ospf-1] quit
4. Configure PE 2:
# Configure an LSR ID.
<Sysname> system-view
[Sysname] sysname PE2
[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
# Enable globally LDP.
[PE2] mpls ldp
[PE2-ldp] quit
# Configure Ten-GigabitEthernet 3/0/2 (the interface connected to the P device), and enable LDP on the interface.
[PE2] interface ten-gigabitethernet 3/0/2
[PE2-Ten-GigabitEthernet3/0/2] ip address 10.2.2.1 24
[PE2-Ten-GigabitEthernet3/0/2] mpls enable
[PE2-Ten-GigabitEthernet3/0/2] mpls ldp enable
[PE2-Ten-GigabitEthernet3/0/2] quit
# Configure OSPF for LDP to create LSPs.
[PE2] ospf
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 10.2.2.1 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] network 192.3.3.3 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
# Create a cross-connect group named vpna, create a cross-connect named svc in the group, and bind Ten-GigabitEthernet 3/0/1 to the cross-connect.
[PE2] xconnect-group vpna
[PE2-xcg-vpna] connection svc
[PE2-xcg-vpna-svc] ac interface ten-gigabitethernet 3/0/1
[PE2-xcg-vpna-svc-Ten-GigabitEthernet3/0/1] quit
# Create a static PW for the cross-connect to bind the AC to the PW.
[PE2-xcg-vpna-svc] peer 192.2.2.2 pw-id 3 in-label 200 out-label 100
[PE2-xcg-vpna-svc-192.2.2.2-3] quit
[PE2-xcg-vpna-svc] quit
[PE2-xcg-vpna] quit
5. Configure CE 2.
<Sysname> system-view
[Sysname] sysname CE2
[CE2] interface ten-gigabitethernet 3/0/1
[CE2-Ten-GigabitEthernet3/0/1] ip address 100.1.1.2 24
[CE2-Ten-GigabitEthernet3/0/1] quit
Verifying the configuration
# Verify that a static PW has been established on PE 1.
[PE1] display l2vpn pw
Flags: M - main, B - backup, E - ecmp, BY - bypass, H - hub link, S - spoke link
N - no split horizon, A - administration, ABY – ac-bypass
PBY – pw-bypass
Total number of PWs: 1
1 up, 0 blocked, 0 down, 0 defect, 0 idle, 0 duplicate
Xconnect-group Name: vpna
Peer PWID/RmtSite/SrvID In/Out Label Proto Flag Link ID State
192.3.3.3 3 100/200 Static M 0 Up
# Verify that a static PW has been established on PE 2.
[PE2] display l2vpn pw
Flags: M - main, B - backup, E - ecmp, BY - bypass, H - hub link, S - spoke link
N - no split horizon, A - administration, ABY – ac-bypass
PBY – pw-bypass
Total number of PWs: 1
1 up, 0 blocked, 0 down, 0 defect, 0 idle, 0 duplicate
Xconnect-group Name: vpna
Peer PWID/RmtSite/SrvID In/Out Label Proto Flag Link ID State
192.2.2.2 3 200/100 Static M Up
# Verify that CE 1 and CE 2 can ping each other. (Details not shown.)
Configuration files
· CE 1
#
sysname CE1
#
interface Ten-GigabitEthernet3/0/1
ip address 100.1.1.1 255.255.255.0
#
return
· CE 2
#
sysname CE2
#
interface Ten-GigabitEthernet3/0/1
ip address 100.1.1.2 255.255.255.0
#
return
· PE 1
#
sysname PE1
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 192.2.2.2 0.0.0.0
#
mpls lsr-id 192.2.2.2
#
mpls ldp
#
l2vpn enable
#
interface LoopBack0
ip address 192.2.2.2 255.255.255.255
#
interface Ten-GigabitEthernet3/0/2
ip address 10.1.1.1 255.255.255.0
mpls enable
mpls ldp enable
#
xconnect-group vpna
connection svc
ac interface Ten-GigabitEthernet3/0/1
peer 192.3.3.3 pw-id 3 in-label 100 out-label 200
#
return
· P
#
sysname P
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 10.2.2.0 0.0.0.255
network 192.4.4.4 0.0.0.0
#
mpls lsr-id 192.4.4.4
#
mpls ldp
#
interface LoopBack0
ip address 192.4.4.4 255.255.255.255
#
interface Ten-GigabitEthernet3/0/1
ip address 10.1.1.2 255.255.255.0
mpls enable
mpls ldp enable
#
interface Ten-GigabitEthernet3/0/2
ip address 10.2.2.2 255.255.255.0
mpls enable
mpls ldp enable
#
return
· PE 2
#
sysname PE2
#
ospf 1
area 0.0.0.0
network 10.2.2.0 0.0.0.255
network 192.3.3.3 0.0.0.0
#
mpls lsr-id 192.3.3.3
#
mpls ldp
#
l2vpn enable
#
interface LoopBack0
ip address 192.3.3.3 255.255.255.255
#
interface Ten-GigabitEthernet3/0/2
ip address 10.2.2.1 255.255.255.0
mpls enable
mpls ldp enable
#
xconnect-group vpna
connection svc
ac interface Ten-GigabitEthernet3/0/1
peer 192.2.2.2 pw-id 3 in-label 200 out-label 100
#
return
Example: Configuring an LDP PW
Network configuration
Create an LDP PW between PE 1 and PE 2 over the backbone to allow communication between CE 1 and CE 2.
Figure 3 Network diagram
Table 4 Interface label and interface name mappings
|
Interface label |
Interface name |
|
Interface1 |
Ten-GigabitEthernet3/0/1 |
|
Interface2 |
Ten-GigabitEthernet3/0/2 |
Table 5 Interface and IP address assignment
|
Device |
Interface |
IP address |
Device |
Interface |
IP address |
|
CE 1 |
XGE3/0/1 |
100.1.1.1/24 |
P |
Loop0 |
192.4.4.4/32 |
|
PE 1 |
Loop0 |
192.2.2.2/32 |
|
XGE3/0/1 |
10.1.1.2/24 |
|
|
XGE3/0/1 |
- |
|
XGE3/0/2 |
10.2.2.2/24 |
|
|
XGE3/0/2 |
10.1.1.1/24 |
PE 2 |
Loop0 |
192.3.3.3/32 |
|
CE 2 |
XGE3/0/1 |
100.1.1.2/24 |
|
XGE3/0/1 |
- |
|
|
|
|
|
XGE3/0/2 |
10.2.2.1/24 |
Procedure
1. Configure CE 1.
<Sysname> system-view
[Sysname] sysname CE1
[CE1] interface ten-gigabitethernet 3/0/1
[CE1-Ten-GigabitEthernet3/0/1] ip address 100.1.1.1 24
[CE1-Ten-GigabitEthernet3/0/1] quit
2. Configure PE 1:
# Configure an LSR ID.
<Sysname> system-view
[Sysname] sysname PE1
[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
# Enable global LDP.
[PE1] mpls ldp
[PE1-ldp] quit
# Configure Ten-GigabitEthernet 3/0/2 (the interface connected to the P device), and enable LDP on the interface.
[PE1] interface ten-gigabitethernet 3/0/2
[PE1-Ten-GigabitEthernet3/0/2] ip address 10.1.1.1 24
[PE1-Ten-GigabitEthernet3/0/2] mpls enable
[PE1-Ten-GigabitEthernet3/0/2] mpls ldp enable
[PE1-Ten-GigabitEthernet3/0/2] quit
# Configure OSPF for LDP to create LSPs.
[PE1] ospf
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 10.1.1.1 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 192.2.2.2 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# Create a cross-connect group named vpna, create a cross-connect named ldp in the group, and bind Ten-GigabitEthernet 3/0/1 to the cross-connect.
[PE1] xconnect-group vpna
[PE1-xcg-vpna] connection ldp
[PE1-xcg-vpna-ldp] ac interface ten-gigabitethernet 3/0/1
[PE1-xcg-vpna-ldp-Ten-GigabitEthernet3/0/1] quit
# Create an LDP PW for the cross-connect to bind the AC to the PW.
[PE1-xcg-vpna-ldp] peer 192.3.3.3 pw-id 3
[PE1-xcg-vpna-ldp-192.3.3.3-3] quit
[PE1-xcg-vpna-ldp] quit
[PE1-xcg-vpna] quit
3. Configure the P device:
# Configure an LSR ID.
<Sysname> system-view
[Sysname] sysname P
[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 global LDP.
[P] mpls ldp
[P-ldp] quit
# Configure Ten-GigabitEthernet 3/0/1 (the interface connected to PE 1), and enable LDP on the interface.
[P] interface ten-gigabitethernet 3/0/1
[P-Ten-GigabitEthernet3/0/1] ip address 10.1.1.2 24
[P-Ten-GigabitEthernet3/0/1] mpls enable
[P-Ten-GigabitEthernet3/0/1] mpls ldp enable
[P-Ten-GigabitEthernet3/0/1] quit
# Configure Ten-GigabitEthernet 3/0/2 (the interface connected to PE 2), and enable LDP on the interface.
[P] interface ten-gigabitethernet 3/0/2
[P-Ten-GigabitEthernet3/0/2] ip address 10.2.2.2 24
[P-Ten-GigabitEthernet3/0/2] mpls enable
[P-Ten-GigabitEthernet3/0/2] mpls ldp enable
[P-Ten-GigabitEthernet3/0/2] quit
# Configure OSPF for LDP to create LSPs.
[P] ospf
[P-ospf-1] area 0
[P-ospf-1-area-0.0.0.0] network 10.1.1.2 0.0.0.255
[P-ospf-1-area-0.0.0.0] network 10.2.2.2 0.0.0.255
[P-ospf-1-area-0.0.0.0] network 192.4.4.4 0.0.0.0
[P-ospf-1-area-0.0.0.0] quit
[P-ospf-1] quit
4. Configure PE 2:
# Configure an LSR ID.
<Sysname> system-view
[Sysname] sysname PE2
[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
# Enable global LDP.
[PE2] mpls ldp
[PE2-ldp] quit
# Configure Ten-GigabitEthernet 3/0/2 (the interface connected to the P device), and enable LDP on the interface.
[PE2] interface ten-gigabitethernet 3/0/2
[PE2-Ten-GigabitEthernet3/0/2] ip address 10.2.2.1 24
[PE2-Ten-GigabitEthernet3/0/2] mpls enable
[PE2-Ten-GigabitEthernet3/0/2] mpls ldp enable
[PE2-Ten-GigabitEthernet3/0/2] quit
# Configure OSPF for LDP to create LSPs.
[PE2] ospf
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 192.3.3.3 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] network 10.2.2.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
# Create a cross-connect group named vpna, create a cross-connect named ldp in the group, and bind Ten-GigabitEthernet 3/0/1 to the cross-connect.
[PE2] xconnect-group vpna
[PE2-xcg-vpna] connection ldp
[PE2-xcg-vpna-ldp] ac interface ten-gigabitethernet 3/0/1
[PE2-xcg-vpna-ldp-Ten-GigabitEthernet3/0/1] quit
# Create an LDP PW for the cross-connect to bind the AC to the PW.
[PE2-xcg-vpna-ldp] peer 192.2.2.2 pw-id 3
[PE2-xcg-vpna-ldp-192.2.2.2-3] quit
[PE2-xcg-vpna-ldp] quit
[PE2-xcg-vpna] quit
5. Configure CE 2.
<Sysname> system-view
[Sysname] sysname CE2
[CE2] interface ten-gigabitethernet 3/0/1
[CE2-Ten-GigabitEthernet3/0/1] ip address 100.1.1.2 24
[CE2-Ten-GigabitEthernet3/0/1] quit
Verifying the configuration
# Verify that an LDP PW has been established on PE 1.
[PE1] display l2vpn pw
Flags: M - main, B - backup, E - ecmp, BY - bypass, H - hub link, S - spoke link
N - no split horizon, A - administration, ABY – ac-bypass
PBY – pw-bypass
Total number of PWs: 1
1 up, 0 blocked, 0 down, 0 defect, 0 idle, 0 duplicate
Xconnect-group Name: vpna
Peer PWID/RmtSite/SrvID In/Out Label Proto Flag Link ID State
192.3.3.3 3 1279/1279 LDP M 1 Up
# Verify that an LDP PW has been established on PE 2.
[PE2] display l2vpn pw
Flags: M - main, B - backup, E - ecmp, BY - bypass, H - hub link, S - spoke link
N - no split horizon, A - administration, ABY – ac-bypass
PBY – pw-bypass
Total number of PWs: 1
1 up, 0 blocked, 0 down, 0 defect, 0 idle, 0 duplicate
Xconnect-group Name: vpna
Peer PWID/RmtSite/SrvID In/Out Label Proto Flag Link ID State
192.2.2.2 3 1279/1279 LDP M 1 Up
# Verify that CE 1 and CE 2 can ping each other. (Details not shown.)
Configuration files
· CE 1
#
sysname CE1
#
interface Ten-GigabitEthernet3/0/1
ip address 100.1.1.1 255.255.255.0
#
return
· CE 2
#
sysname CE2
#
interface Ten-GigabitEthernet3/0/1
ip address 100.1.1.2 255.255.255.0
#
return
· PE 1
#
sysname PE1
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 192.2.2.2 0.0.0.0
#
mpls lsr-id 192.2.2.2
#
mpls ldp
#
l2vpn enable
#
interface LoopBack0
ip address 192.2.2.2 255.255.255.255
#
interface Ten-GigabitEthernet3/0/2
ip address 10.1.1.1 255.255.255.0
mpls enable
mpls ldp enable
#
xconnect-group vpna
connection ldp
ac interface Ten-GigabitEthernet3/0/1
peer 192.3.3.3 pw-id 3
#
return
· P
#
sysname P
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 10.2.2.0 0.0.0.255
network 192.4.4.4 0.0.0.0
#
mpls lsr-id 192.4.4.4
#
mpls ldp
#
interface LoopBack0
ip address 192.4.4.4 255.255.255.255
#
interface Ten-GigabitEthernet3/0/1
ip address 10.1.1.2 255.255.255.0
mpls enable
mpls ldp enable
#
interface Ten-GigabitEthernet3/0/2
ip address 10.2.2.2 255.255.255.0
mpls enable
mpls ldp enable
#
return
· PE 2
#
sysname PE2
#
ospf 1
area 0.0.0.0
network 10.2.2.0 0.0.0.255
network 192.3.3.3 0.0.0.0
#
mpls lsr-id 192.3.3.3
#
mpls ldp
#
l2vpn enable
#
interface LoopBack0
ip address 192.3.3.3 255.255.255.255
#
interface Ten-GigabitEthernet3/0/2
ip address 10.2.2.1 255.255.255.0
mpls enable
mpls ldp enable
#
xconnect-group vpna
connection ldp
ac interface Ten-GigabitEthernet3/0/1
peer 192.2.2.2 pw-id 3
#
return
Example: Configuring a BGP PW
Network configuration
Create a BGP PW between PE 1 and PE 2 to allow communication between CE 1 and CE 2.
Figure 4 Network diagram
Table 6 Interface label and interface name mappings
|
Interface label |
Interface name |
|
Interface1 |
Ten-GigabitEthernet3/0/1 |
|
Interface2 |
Ten-GigabitEthernet3/0/2 |
Table 7 Interface and IP address assignment
|
Device |
Interface |
IP address |
Device |
Interface |
IP address |
|
CE 1 |
XGE3/0/1 |
100.1.1.1/24 |
P |
Loop0 |
192.4.4.4/32 |
|
PE 1 |
Loop0 |
192.2.2.2/32 |
|
XGE3/0/1 |
10.1.1.2/24 |
|
|
XGE3/0/1 |
- |
|
XGE3/0/2 |
10.2.2.2/24 |
|
|
XGE3/0/2 |
10.1.1.1/24 |
PE 2 |
Loop0 |
192.3.3.3/32 |
|
CE 2 |
XGE3/0/1 |
100.1.1.2/24 |
|
XGE3/0/1 |
- |
|
|
|
|
|
XGE3/0/2 |
10.2.2.1/24 |
Procedure
1. Configure CE 1.
<Sysname> system-view
[Sysname] sysname CE1
[CE1] interface ten-gigabitethernet 3/0/1
[CE1-Ten-GigabitEthernet3/0/1] ip address 100.1.1.1 24
[CE1-Ten-GigabitEthernet3/0/1] quit
2. Configure PE 1:
# Configure an LSR ID.
<Sysname> system-view
[Sysname] sysname PE1
[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
# Enable global LDP.
[PE1] mpls ldp
[PE1-ldp] quit
# Configure Ten-GigabitEthernet 3/0/2 (the interface connected to the P device), and enable LDP on the interface.
[PE1] interface ten-gigabitethernet 3/0/2
[PE1-Ten-GigabitEthernet3/0/2] ip address 10.1.1.1 24
[PE1-Ten-GigabitEthernet3/0/2] mpls enable
[PE1-Ten-GigabitEthernet3/0/2] mpls ldp enable
[PE1-Ten-GigabitEthernet3/0/2] quit
# Configure OSPF for LDP to create LSPs.
[PE1] ospf
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 10.1.1.1 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 192.2.2.2 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# Create an IBGP connection to PE 2, and enable BGP to advertise L2VPN information to PE 2.
[PE1] bgp 100
[PE1-bgp-default] peer 192.3.3.3 as-number 100
[PE1-bgp-default] peer 192.3.3.3 connect-interface loopback 0
[PE1-bgp-default] address-family l2vpn
[PE1-bgp-default-l2vpn] peer 192.3.3.3 enable
[PE1-bgp-default-l2vpn] quit
[PE1-bgp-default] quit
# Create a cross-connect group named vpnb, create a local site named site 1, and create a BGP PW from site 1 to remote site site 2.
[PE1] xconnect-group vpnb
[PE1-xcg-vpnb] auto-discovery bgp
[PE1-xcg-vpnb-auto] route-distinguisher 2:2
[PE1-xcg-vpnb-auto] vpn-target 2:2 export-extcommunity
[PE1-xcg-vpnb-auto] vpn-target 2:2 import-extcommunity
[PE1-xcg-vpnb-auto] site 1 range 10 default-offset 0
[PE1-xcg-vpnb-auto-1] connection remote-site-id 2
# Bind Ten-GigabitEthernet 3/0/1 to the PW.
[PE1-xcg-vpnb-auto-1-2] ac interface ten-gigabitethernet 3/0/1
[PE1-xcg-vpnb-auto-1-2] return
3. Configure the P device:
# Configure an LSR ID.
<Sysname> system-view
[Sysname] sysname P
[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 global LDP.
[P] mpls ldp
[P-ldp] quit
# Configure Ten-GigabitEthernet 3/0/1 (the interface connected to PE 1), and enable LDP on the interface.
[P] interface ten-gigabitethernet 3/0/1
[P-Ten-GigabitEthernet3/0/1] ip address 10.1.1.2 24
[P-Ten-GigabitEthernet3/0/1] mpls enable
[P-Ten-GigabitEthernet3/0/1] mpls ldp enable
[P-Ten-GigabitEthernet3/0/1] quit
# Configure Ten-GigabitEthernet 3/0/2 (the interface connected to PE 2), and enable LDP on the interface.
[P] interface ten-gigabitethernet 3/0/2
[P-Ten-GigabitEthernet3/0/2] ip address 10.2.2.2 24
[P-Ten-GigabitEthernet3/0/2] mpls enable
[P-Ten-GigabitEthernet3/0/2] mpls ldp enable
[P-Ten-GigabitEthernet3/0/2] quit
# Configure OSPF for LDP to create LSPs.
[P] ospf
[P-ospf-1] area 0
[P-ospf-1-area-0.0.0.0] network 10.1.1.2 0.0.0.255
[P-ospf-1-area-0.0.0.0] network 10.2.2.2 0.0.0.255
[P-ospf-1-area-0.0.0.0] network 192.4.4.4 0.0.0.0
[P-ospf-1-area-0.0.0.0] quit
[P-ospf-1] quit
4. Configure PE 2:
# Configure an LSR ID.
<Sysname> system-view
[Sysname] sysname PE2
[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
# Enable global LDP.
[PE2] mpls ldp
[PE2-ldp] quit
# Configure Ten-GigabitEthernet 3/0/2 (the interface connected to the P device), and enable LDP on the interface.
[PE2] interface ten-gigabitethernet 3/0/2
[PE2-Ten-GigabitEthernet3/0/2] ip address 10.2.2.1 24
[PE2-Ten-GigabitEthernet3/0/2] mpls enable
[PE2-Ten-GigabitEthernet3/0/2] mpls ldp enable
[PE2-Ten-GigabitEthernet3/0/2] quit
# Configure OSPF for LDP to create LSPs.
[PE2] ospf
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 192.3.3.3 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] network 10.2.2.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
# Create an IBGP connection to PE 1, and enable BGP to advertise L2VPN information to PE 1.
[PE2] bgp 100
[PE2-bgp-default] peer 192.2.2.2 as-number 100
[PE2-bgp-default] peer 192.2.2.2 connect-interface loopback 0
[PE2-bgp-default] address-family l2vpn
[PE2-bgp-default-l2vpn] peer 192.2.2.2 enable
[PE2-bgp-default-l2vpn] quit
[PE2-bgp-default] quit
# Create a cross-connect group named vpnb, create a local site named site 2, and create a BGP PW from site 2 to remote site site 1.
[PE2] xconnect-group vpnb
[PE2-xcg-vpnb] auto-discovery bgp
[PE2-xcg-vpnb-auto] route-distinguisher 2:2
[PE2-xcg-vpnb-auto] vpn-target 2:2 export-extcommunity
[PE2-xcg-vpnb-auto] vpn-target 2:2 import-extcommunity
[PE2-xcg-vpnb-auto] site 2 range 10 default-offset 0
[PE2-xcg-vpnb-auto-2] connection remote-site-id 1
# Bind Ten-GigabitEthernet 3/0/1 to the PW.
[PE2-xcg-vpnb-auto-2-1] ac interface ten-gigabitethernet 3/0/1
[PE2-xcg-vpnb-auto-2-1] return
5. Configure CE 2.
<Sysname> system-view
[Sysname] sysname CE2
[CE2] interface ten-gigabitethernet 3/0/1
[CE2-Ten-GigabitEthernet3/0/1] ip address 100.1.1.2 24
[CE2-Ten-GigabitEthernet3/0/1] quit
Verifying the configuration
# Verify that a BGP PW has been established on PE 1.
<PE1> display l2vpn pw
Flags: M - main, B - backup, E - ecmp, BY - bypass, H - hub link, S - spoke link
N - no split horizon, A - administration, ABY – ac-bypass
PBY – pw-bypass
Total number of PWs: 1
1 up, 0 blocked, 0 down, 0 defect, 0 idle, 0 duplicate
Xconnect-group Name: vpnb
Peer PWID/RmtSite/SrvID In/Out Label Proto Flag Link ID State
192.3.3.3 2 1036/1025 BGP M 1 Up
# Verify that a BGP PW has been established on PE 2.
<PE2> display l2vpn pw
Flags: M - main, B - backup, E - ecmp, BY - bypass, H - hub link, S - spoke link
N - no split horizon, A - administration, ABY – ac-bypass
PBY – pw-bypass
Total number of PWs: 1
1 up, 0 blocked, 0 down, 0 defect, 0 idle, 0 duplicate
Xconnect-group Name: vpnb
Peer PWID/RmtSite/SrvID In/Out Label Proto Flag Link ID State
192.2.2.2 1 1025/1036 BGP M 1 Up
# Verify that CE 1 and CE 2 can ping each other. (Details not shown.)
Configuration files
· CE 1
#
sysname CE1
#
interface Ten-GigabitEthernet3/0/1
ip address 100.1.1.1 255.255.255.0
#
return
· CE 2
#
sysname CE2
#
interface Ten-GigabitEthernet3/0/1
ip address 100.1.1.2 255.255.255.0
#
return
· PE 1
#
sysname PE1
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 192.2.2.2 0.0.0.0
#
mpls lsr-id 192.2.2.2
#
mpls ldp
#
l2vpn enable
#
interface LoopBack0
ip address 192.2.2.2 255.255.255.255
#
interface Ten-GigabitEthernet3/0/2
ip address 10.1.1.1 255.255.255.0
mpls enable
mpls ldp enable
#
bgp 100
peer 192.3.3.3 as-number 100
peer 192.3.3.3 connect-interface LoopBack0
#
address-family l2vpn
peer 192.3.3.3 enable
#
xconnect-group vpnb
auto-discovery bgp
route-distinguisher 2:2
vpn-target 2:2 export-extcommunity
vpn-target 2:2 import-extcommunity
site 1 range 10 default-offset 0
connection remote-site-id 2
ac interface Ten-GigabitEthernet3/0/1
#
return
· P
#
sysname P
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 10.2.2.0 0.0.0.255
network 192.4.4.4 0.0.0.0
#
mpls lsr-id 192.4.4.4
#
mpls ldp
#
interface LoopBack0
ip address 192.4.4.4 255.255.255.255
#
interface Ten-GigabitEthernet3/0/1
ip address 10.1.1.2 255.255.255.0
mpls enable
mpls ldp enable
#
interface Ten-GigabitEthernet3/0/2
ip address 10.2.2.2 255.255.255.0
mpls enable
mpls ldp enable
#
return
· PE 2
#
sysname PE2
#
ospf 1
area 0.0.0.0
network 10.2.2.0 0.0.0.255
network 192.3.3.3 0.0.0.0
#
mpls lsr-id 192.3.3.3
#
mpls ldp
#
l2vpn enable
#
interface LoopBack0
ip address 192.3.3.3 255.255.255.255
#
interface Ten-GigabitEthernet3/0/2
ip address 10.2.2.1 255.255.255.0
mpls enable
mpls ldp enable
#
bgp 100
peer 192.2.2.2 as-number 100
peer 192.2.2.2 connect-interface LoopBack0
#
address-family l2vpn
peer 192.2.2.2 enable
#
xconnect-group vpnb
auto-discovery bgp
route-distinguisher 2:2
vpn-target 2:2 export-extcommunity
vpn-target 2:2 import-extcommunity
site 2 range 10 default-offset 0
connection remote-site-id 1
ac interface Ten-GigabitEthernet3/0/1
#
return
Example: Configuring a bypass PW
Network configuration
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.
Create a bypass PW between PE 2 and PE 3 to forward traffic when a primary/backup PW switchover occurs.
Figure 5 Network diagram
Table 8 Interface label and interface name mappings
|
Interface label |
Interface name |
|
Interface1 |
Ten-GigabitEthernet3/0/1 |
|
Interface2 |
Ten-GigabitEthernet3/0/2 |
|
Interface3 |
Ten-GigabitEthernet3/0/3 |
Table 9 Interface and IP address assignment
|
Device |
Interface |
IP address |
Device |
Interface |
IP address |
|
CE 1 |
XGE3/0/1 |
192.1.1.1/24 |
PE 2 |
Loop0 |
2.2.2.2/32 |
|
PE 1 |
Loop0 |
1.1.1.1/32 |
|
XGE3/0/1 |
10.1.1.2/24 |
|
|
XGE3/0/2 |
10.1.1.1/24 |
|
XGE3/0/3 |
10.1.3.1/24 |
|
|
XGE3/0/3 |
10.1.2.1/24 |
PE 3 |
Loop0 |
3.3.3.3/32 |
|
CE 2 |
RAGG1 |
192.1.1.2/24 |
|
XGE3/0/1 |
10.1.2.2/24 |
Procedure
1. Configure CE 1.
<Sysname> system-view
[Sysname] sysname CE1
[CE1] interface ten-gigabitethernet 3/0/1
[CE1-Ten-GigabitEthernet3/0/1] ip address 192.1.1.1 24
[CE1-Ten-GigabitEthernet3/0/1] quit
2. Configure PE 1:
# Configure an LSR ID.
<Sysname> system-view
[Sysname] sysname PE1
[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 L2VPN.
[PE1] l2vpn enable
# Enable global LDP.
[PE1] mpls ldp
[PE1-ldp] quit
# Configure Ten-GigabitEthernet 3/0/2 (the interface connected to PE 2), and enable MPLS and LDP on the interface.
[PE1] interface ten-gigabitethernet 3/0/2
[PE1-Ten-GigabitEthernet3/0/2] ip address 10.1.1.1 24
[PE1-Ten-GigabitEthernet3/0/2] mpls enable
[PE1-Ten-GigabitEthernet3/0/2] mpls ldp enable
[PE1-Ten-GigabitEthernet3/0/2] quit
# Configure Ten-GigabitEthernet 3/0/3 (the interface connected to PE 3), and enable MPLS and LDP on the interface.
[PE1] interface ten-gigabitethernet 3/0/3
[PE1-Ten-GigabitEthernet3/0/3] ip address 10.1.2.1 24
[PE1-Ten-GigabitEthernet3/0/3] mpls enable
[PE1-Ten-GigabitEthernet3/0/3] mpls ldp enable
[PE1-Ten-GigabitEthernet3/0/3] quit
# Configure OSPF for LDP to create LSPs.
[PE1] ospf
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 10.1.1.1 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 10.1.2.1 0.0.0.255
[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] quit
[PE1-ospf-1] quit
# Create a cross-connect group named vpna, create a cross-connect named ldp in the group, and bind Ten-GigabitEthernet 3/0/1 to the cross-connect.
[PE1] xconnect-group vpna
[PE1-xcg-vpna] connection ldp
[PE1-xcg-vpna-ldp] ac interface Ten-GigabitEthernet 3/0/1
[PE1-xcg-vpna-ldp-Ten-GigabitEthernet3/0/1] quit
# Create an LDP PW for the cross-connect to bind the AC to the PW, create a backup PW for the LDP PW, and enable the dual receive feature for PW redundancy.
[PE1-xcg-vpna-ldp] protection dual-receive
[PE1-xcg-vpna-ldp] peer 2.2.2.2 pw-id 11
[PE1-xcg-vpna-ldp-2.2.2.2-11] backup-peer 3.3.3.3 pw-id 22
[PE1-xcg-vpna-ldp-2.2.2.2-11-backup] quit
[PE1-xcg-vpna-ldp-2.2.2.2-11] quit
[PE1-xcg-vpna-ldp] quit
[PE1-xcg-vpna] quit
3. Configure CE 2:
# Create Layer 3 aggregate interface Route-Aggregation 1, use the static aggregation mode (the default), and configure the IP address and subnet mask for the aggregate interface.
<Sysname> system-view
[Sysname] sysname CE2
[CE2] interface route-aggregation 1
[CE2-Route-Aggregation1] ip address 192.1.1.2 24
[CE2-Route-Aggregation1] quit
# Add interfaces Ten-GigabitEthernet 3/0/2 and Ten-GigabitEthernet 3/0/3 to Layer 3 aggregation group 1.
[CE2] interface ten-gigabitethernet 3/0/2
[CE2-Ten-GigabitEthernet3/0/2] port link-aggregation group 1
[CE2-Ten-GigabitEthernet3/0/2] quit
[CE2] interface ten-gigabitethernet 3/0/3
[CE2-Ten-GigabitEthernet3/0/3] port link-aggregation group 1
[CE2-Ten-GigabitEthernet3/0/3] quit
4. Configure PE 2:
# Configure an LSR ID.
<Sysname> system-view
[Sysname] sysname PE2
[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 L2VPN.
[PE2] l2vpn enable
# Enable global LDP.
[PE2] mpls ldp
[PE2-ldp] quit
# Configure Ten-GigabitEthernet 3/0/1 (the interface connected to PE 1), and enable MPLS and LDP on the interface.
[PE2] interface ten-gigabitethernet 3/0/1
[PE2-Ten-GigabitEthernet3/0/1] ip address 10.1.1.2 24
[PE2-Ten-GigabitEthernet3/0/1] mpls enable
[PE2-Ten-GigabitEthernet3/0/1] mpls ldp enable
[PE2-Ten-GigabitEthernet3/0/1] quit
# Configure Ten-GigabitEthernet 3/0/3 (the interface connected to PE 3), and enable MPLS and LDP on the interface.
[PE2] interface ten-gigabitethernet 3/0/3
[PE2-Ten-GigabitEthernet3/0/3] ip address 10.1.3.1 24
[PE2-Ten-GigabitEthernet3/0/3] mpls enable
[PE2-Ten-GigabitEthernet3/0/3] mpls ldp enable
[PE2-Ten-GigabitEthernet3/0/3] quit
# Configure OSPF for LDP to create LSPs.
[PE2] ospf
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 10.1.1.2 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] network 10.1.3.1 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
# Create a cross-connect group named vpna, create a cross-connect named ldp in the group, and bind Ten-GigabitEthernet 3/0/2 to the cross-connect.
[PE2] xconnect-group vpna
[PE2-xcg-vpna] connection ldp
[PE2-xcg-vpna-ldp] ac interface ten-gigabitethernet 3/0/2
[PE2-xcg-vpna-ldp-Ten-GigabitEthernet3/0/2] quit
# Create an LDP PW for the cross-connect to bind the AC to the PW, and create a bypass PW for the LDP PW.
[PE2-xcg-vpna-ldp] peer 1.1.1.1 pw-id 11
[PE2-xcg-vpna-ldp-1.1.1.1-11] bypass-peer 3.3.3.3 pw-id 33
[PE2-xcg-vpna-ldp-1.1.1.1-11-bypass] quit
[PE2-xcg-vpna-ldp-1.1.1.1-11] quit
[PE2-xcg-vpna-ldp] quit
[PE2-xcg-vpna] quit
5. Configure PE 3:
# Configure an LSR ID.
<Sysname> system-view
[Sysname] sysname PE3
[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 L2VPN.
[PE3] l2vpn enable
# Enable global LDP.
[PE3] mpls ldp
[PE3-ldp] quit
# Configure Ten-GigabitEthernet 3/0/1 (the interface connected to PE 1), and enable MPLS and LDP on the interface.
[PE3] interface ten-gigabitethernet 3/0/1
[PE3-Ten-GigabitEthernet3/0/1] ip address 10.1.2.2 24
[PE3-Ten-GigabitEthernet3/0/1] mpls enable
[PE3-Ten-GigabitEthernet3/0/1] mpls ldp enable
[PE3-Ten-GigabitEthernet3/0/1] quit
# Configure Ten-GigabitEthernet 3/0/2 (the interface connected to PE 2), and enable MPLS and LDP on the interface.
[PE3] interface ten-gigabitethernet 3/0/2
[PE3-Ten-GigabitEthernet3/0/2] ip address 10.1.3.2 24
[PE3-Ten-GigabitEthernet3/0/2] mpls enable
[PE3-Ten-GigabitEthernet3/0/2] mpls ldp enable
[PE3-Ten-GigabitEthernet3/0/2] quit
# Configure OSPF for LDP to create LSPs.
[PE3] ospf
[PE3-ospf-1] area 0
[PE3-ospf-1-area-0.0.0.0] network 10.1.2.2 0.0.0.255
[PE3-ospf-1-area-0.0.0.0] network 10.1.3.2 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
# Create a cross-connect group named vpna, create a cross-connect named ldp in the group, and bind Ten-GigabitEthernet 3/0/3 to the cross-connect.
[PE3] xconnect-group vpna
[PE3-xcg-vpna] connection ldp
[PE3-xcg-vpna-ldp] ac interface ten-gigabitethernet 3/0/3
[PE3-xcg-vpna-ldp-Ten-GigabitEthernet3/0/3] quit
# Create an LDP PW for the cross-connect to bind the AC to the PW, and create a bypass PW for the LDP PW.
[PE3-xcg-vpna-ldp] peer 1.1.1.1 pw-id 22
[PE3-xcg-vpna-ldp-1.1.1.1-22] bypass-peer 2.2.2.2 pw-id 33
[PE3-xcg-vpna-ldp-1.1.1.1-22-bypass] quit
[PE3-xcg-vpna-ldp-1.1.1.1-22] quit
[PE3-xcg-vpna-ldp] quit
[PE3-xcg-vpna] quit
Verifying the configuration
# Verify that PWs have been established on PE 1. The PW connection with PE 2 has a Flag field of M, indicating it is the master PW. The PW connection with PE 3 has a Flag field of B, indicating it is the backup PW.
[PE1]display l2vpn pw
Flags: M - main, B - backup, E - ecmp, BY - bypass, H - hub link, S - spoke link
N - no split horizon, A - administration, ABY - ac-bypass
PBY - pw-bypass
Total number of PWs: 2
1 up, 1 blocked, 0 down, 0 defect, 0 idle, 0 duplicate
Xconnect-group Name: vpna
Peer PWID/RmtSite/SrvID In/Out Label Proto Flag Link ID State
2.2.2.2 11 1151/1279 LDP M 1 Up
3.3.3.3 22 1150/1279 LDP B 1 Blocked
# Verify that PWs have been established on PE 2. The PW connection with PE 3 has a Flag field of BY, indicating it is a bypass PW.
[PE2]display l2vpn pw
Flags: M - main, B - backup, E - ecmp, BY - bypass, H - hub link, S - spoke link
N - no split horizon, A - administration, ABY - ac-bypass
PBY - pw-bypass
Total number of PWs: 2
1 up, 1 blocked, 0 down, 0 defect, 0 idle, 0 duplicate
Xconnect-group Name: vpna
Peer PWID/RmtSite/SrvID In/Out Label Proto Flag Link ID State
1.1.1.1 11 1279/1151 LDP M 1 Up
3.3.3.3 33 1278/1278 LDP BY 1 Blocked
# Verify that CE 1 and CE 2 can ping each other. (Details not shown.)
Configuration files
· CE 1
#
sysname CE1
#
interface Ten-GigabitEthernet3/0/1
ip address 192.1.1.1 255.255.255.0
#
return
· CE 2
#
sysname CE2
#
interface Route-Aggregation1
ip address 192.1.1.2 255.255.255.0
#
interface Ten-GigabitEthernet3/0/2
port link-aggregation group 1
#
interface Ten-GigabitEthernet3/0/3
port link-aggregation group 1
#
return
· PE 1
#
sysname PE1
#
ospf 1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 10.1.1.0 0.0.0.255
network 10.1.2.0 0.0.0.255
#
mpls lsr-id 1.1.1.1
#
mpls ldp
#
l2vpn enable
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
interface Ten-GigabitEthernet3/0/2
ip address 10.1.1.1 255.255.255.0
mpls enable
mpls ldp enable
#
interface Ten-GigabitEthernet3/0/3
ip address 10.1.2.1 255.255.255.0
mpls enable
mpls ldp enable
#
xconnect-group vpna
connection ldp
protection dual-receive
ac interface Ten-GigabitEthernet3/0/1
peer 2.2.2.2 pw-id 11
backup-peer 3.3.3.3 pw-id 22
#
return
· PE 2
#
sysname PE2
#
ospf 1
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 10.1.1.0 0.0.0.255
network 10.1.3.0 0.0.0.255
#
mpls lsr-id 2.2.2.2
#
mpls ldp
#
l2vpn enable
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
#
interface Ten-GigabitEthernet3/0/1
ip address 10.1.1.2 255.255.255.0
mpls enable
mpls ldp enable
#
interface Ten-GigabitEthernet3/0/3
ip address 10.1.3.1 255.255.255.0
mpls enable
mpls ldp enable
#
xconnect-group vpna
connection ldp
ac interface Ten-GigabitEthernet3/0/2
peer 1.1.1.1 pw-id 11
bypass-peer 3.3.3.3 pw-id 33
#
return
· PE 3
#
sysname PE3
#
ospf 1
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 10.1.2.0 0.0.0.255
network 10.1.3.0 0.0.0.255
#
mpls lsr-id 3.3.3.3
#
mpls ldp
#
l2vpn enable
#
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
#
interface Ten-GigabitEthernet3/0/1
ip address 10.1.2.2 255.255.255.0
mpls enable
mpls ldp enable
#
interface Ten-GigabitEthernet3/0/2
ip address 10.1.3.2 255.255.255.0
mpls enable
mpls ldp enable
#
xconnect-group vpna
connection ldp
ac interface Ten-GigabitEthernet3/0/3
peer 1.1.1.1 pw-id 22
bypass-peer 2.2.2.2 pw-id 33
#
return
Example: Configuring an intra-domain multi-segment PW
Network configuration
As shown in Figure 6, there is no public tunnel between PE 1 and PE 2. 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 within the backbone to allow communication between CE 1 and CE 2. 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 concatenated on P.
Table 10 Interface label and interface name mappings
|
Interface label |
Interface name |
|
Interface1 |
Ten-GigabitEthernet3/0/1 |
|
Interface2 |
Ten-GigabitEthernet3/0/2 |
Table 11 Interface and IP address assignment
|
Device |
Interface |
IP address |
Device |
Interface |
IP address |
|
CE 1 |
XGE3/0/1 |
100.1.1.1/24 |
P |
Loop0 |
192.4.4.4/32 |
|
PE 1 |
Loop0 |
192.2.2.2/32 |
|
XGE3/0/1 |
23.1.1.2/24 |
|
|
XGE3/0/2 |
23.1.1.1/24 |
|
XGE3/0/2 |
26.2.2.2/24 |
|
CE 2 |
XGE3/0/1 |
100.1.1.2/24 |
PE 2 |
Loop0 |
192.3.3.3/32 |
|
|
|
|
|
XGE3/0/2 |
26.2.2.1/24 |
Procedure
1. Configure CE 1.
<Sysname> system-view
[Sysname] sysname CE1
[CE1] interface ten-gigabitethernet 3/0/1
[CE1-Ten-GigabitEthernet3/0/1] ip address 100.1.1.1 24
[CE1-Ten-GigabitEthernet3/0/1] quit
2. Configure PE 1:
# Configure an LSR ID.
<Sysname> system-view
[Sysname] sysname PE1
[PE1] interface loopback 0
[PE1-LoopBack0] ip address 192.2.2.2 32
[PE1-LoopBack0] ospf 1 area 0
[PE1-LoopBack0] quit
[PE1] mpls lsr-id 192.2.2.2
# Enable L2VPN.
[PE1] l2vpn enable
# Enable LDP globally.
[PE1] mpls ldp
[PE1-ldp] quit
# Create a cross-connect group named vpn1, create a cross-connect named ldp in the group, and bind Ten-GigabitEthernet 3/0/1 to the cross-connect.
[PE1] xconnect-group vpn1
[PE1-xcg-vpn1] connection ldp
[PE1-xcg-vpn1-ldp] ac interface ten-gigabitethernet 3/0/1
[PE1-xcg-vpn1-ldp-Ten-GigabitEthernet3/0/1] quit
# 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 MPLS TE to establish an MPLS TE tunnel between PE 1 and P.
[PE1] ospf 1
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] mpls te enable
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
[PE1] mpls te
[PE1-te] quit
[PE1] rsvp
[PE1-rsvp] quit
[PE1] interface ten-gigabitethernet 3/0/2
[PE1-Ten-GigabitEthernet3/0/2] ip address 23.1.1.1 24
[PE1-Ten-GigabitEthernet3/0/2] mpls enable
[PE1-Ten-GigabitEthernet3/0/2] mpls te enable
[PE1-Ten-GigabitEthernet3/0/2] rsvp enable
[PE1-Ten-GigabitEthernet3/0/2] ospf 1 area 0
[PE1-Ten-GigabitEthernet3/0/2] quit
[PE1] interface tunnel 1 mode mpls-te
[PE1-Tunnel1] ip address 7.1.1.1 255.255.255.0
[PE1-Tunnel1] destination 192.4.4.4
[PE1-Tunnel1] mpls te signaling rsvp-te
[PE1-Tunnel1] quit
3. Configure the P device:
# Configure an LSR ID.
<Sysname> system-view
[Sysname] sysname P
[P] interface loopback 0
[P-LoopBack0] ip address 192.4.4.4 32
[P-LoopBack0] ospf 1 area 0
[P-LoopBack0] quit
[P] mpls lsr-id 192.4.4.4
# Enable L2VPN.
[P] l2vpn enable
# Enable LDP globally.
[P] mpls ldp
[P-ldp] quit
# Create a PW class named pwa, and configure the PW data encapsulation type as ethernet.
[P] pw-class pwa
[P-pw-class-pwa] pw-type ethernet
[P-pw-class-pwa] quit
# 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.
[P] xconnect-group vpn1
[P-xcg-vpn1] connection ldpsvc
[P-xcg-vpn1-ldpsvc] peer 192.2.2.2 pw-id 1000 pw-class pwa
[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 pw-class pwa
[P-xcg-vpn1-ldpsvc-192.3.3.3-1000] quit
[P-xcg-vpn1-ldpsvc] quit
[P-xcg-vpn1] quit
# Configure MPLS TE to establish an MPLS TE tunnel between PE 1 and P, and between P and PE 2.
[P] ospf 1
[P-ospf-1] area 0
[P-ospf-1-area-0.0.0.0] mpls te enable
[P-ospf-1-area-0.0.0.0] quit
[P-ospf-1] quit
[P] mpls te
[P-te] quit
[P] rsvp
[P-rsvp] quit
[P] interface ten-gigabitethernet 3/0/1
[P-Ten-GigabitEthernet3/0/1] ip address 23.1.1.2 24
[P-Ten-GigabitEthernet3/0/1] mpls enable
[P-Ten-GigabitEthernet3/0/1] mpls te enable
[P-Ten-GigabitEthernet3/0/1] rsvp enable
[P-Ten-GigabitEthernet3/0/1] ospf 1 area 0
[P-Ten-GigabitEthernet3/0/1] quit
[P] interface ten-gigabitethernet 3/0/2
[P-Ten-GigabitEthernet3/0/2] ip address 26.2.2.2 24
[P-Ten-GigabitEthernet3/0/2] mpls enable
[P-Ten-GigabitEthernet3/0/2] mpls te enable
[P-Ten-GigabitEthernet3/0/2] rsvp enable
[P-Ten-GigabitEthernet3/0/2] ospf 1 area 0
[P-Ten-GigabitEthernet3/0/2] quit
[P] interface tunnel 1 mode mpls-te
[P-Tunnel1] ip address 7.1.1.2 255.255.255.0
[P-Tunnel1] destination 192.2.2.2
[P-Tunnel1] mpls te signaling rsvp-te
[P-Tunnel1] quit
[P] interface tunnel 2 mode mpls-te
[P-Tunnel2] ip address 8.1.1.2 255.255.255.0
[P-Tunnel2] destination 192.3.3.3
[P-Tunnel2] mpls te signaling rsvp-te
[P-Tunnel2] quit
4. Configure PE 2:
# Configure an LSR ID.
<Sysname> system-view
[Sysname] sysname PE2
[PE2] interface loopback 0
[PE2-LoopBack0] ip address 192.3.3.3 32
[PE2-LoopBack0] ospf 1 area 0
[PE2-LoopBack0] quit
[PE2] mpls lsr-id 192.3.3.3
# Enable L2VPN.
[PE2] l2vpn enable
# Create a cross-connect group named vpn1, create a cross-connect named svc in the group, and bind Ten-GigabitEthernet 3/0/1 to the cross-connect.
[PE2] xconnect-group vpn1
[PE2-xcg-vpn1] connection svc
[PE2-xcg-vpn1-svc] ac interface ten-gigabitethernet 3/0/1
[PE2-xcg-vpn1-svc-Ten-GigabitEthernet3/0/1] quit
# 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 MPLS TE to establish an MPLS TE tunnel between P and PE 2.
[PE2] ospf 1
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] mpls te enable
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
[PE2] mpls te
[PE2-te] quit
[PE2] rsvp
[PE2-rsvp] quit
[PE2] interface ten-gigabitethernet 3/0/2
[PE2-Ten-GigabitEthernet3/0/2] ip address 26.2.2.1 24
[PE2-Ten-GigabitEthernet3/0/2] mpls enable
[PE2-Ten-GigabitEthernet3/0/2] mpls te enable
[PE2-Ten-GigabitEthernet3/0/2] rsvp enable
[PE2-Ten-GigabitEthernet3/0/2] ospf 1 area 0
[PE2-Ten-GigabitEthernet3/0/2] quit
[PE2] interface tunnel 2 mode mpls-te
[PE2-Tunnel2] ip address 8.1.1.1 255.255.255.0
[PE2-Tunnel2] destination 192.4.4.4
[PE2-Tunnel2] mpls te signaling rsvp-te
[PE2-Tunnel2] quit
5. Configure CE 2.
<Sysname> system-view
[Sysname] sysname CE2
[CE2] interface ten-gigabitethernet 3/0/1
[CE2-Ten-GigabitEthernet3/0/1] ip address 100.1.1.2 24
[CE2-Ten-GigabitEthernet3/0/1] quit
Verifying the configuration
# Verify that two PWs have been created to form a multi-segment PW on the P device.
[P] display l2vpn pw
Flags: M - main, B - backup, E - ecmp, BY - bypass, H - hub link, S - spoke link
N - no split horizon, A - administration, ABY – ac-bypass
PBY – pw-bypass
Total number of PWs: 2
2 up, 0 blocked, 0 down, 0 defect, 0 idle, 0 duplicate
Xconnect-group Name: vpn1
Peer PWID/RmtSite/SrvID In/Out Label Proto Flag Link ID State
192.2.2.2 1000 1279/1150 LDP M 0 Up
192.3.3.3 1000 100/200 Static M 1 Up
# Verify that a PW has been created on PE 1.
[PE1] display l2vpn pw
Flags: M - main, B - backup, E - ecmp, BY - bypass, H - hub link, S - spoke link
N - no split horizon, A - administration, ABY – ac-bypass
PBY – pw-bypass
Total number of PWs: 1
1 up, 0 blocked, 0 down, 0 defect, 0 idle, 0 duplicate
Xconnect-group Name: vpn1
Peer PWID/RmtSite/SrvID In/Out Label Proto Flag Link ID State
192.4.4.4 1000 1150/1279 LDP M 1 Up
# Verify that a PW has been created on PE 2.
[PE2] display l2vpn pw
Flags: M - main, B - backup, E - ecmp, BY - bypass, H - hub link, S - spoke link
N - no split horizon, A - administration, ABY – ac-bypass
PBY – pw-bypass
Total number of PWs: 1
1 up, 0 blocked, 0 down, 0 defect, 0 idle, 0 duplicate
Xconnect-group Name: vpn1
Peer PWID/RmtSite/SrvID 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.)
Configuration files
· CE 1
#
sysname CE1
#
interface Ten-GigabitEthernet3/0/1
ip address 100.1.1.1 255.255.255.0
#
return
· CE 2
#
sysname CE2
#
interface Ten-GigabitEthernet3/0/1
ip address 100.1.1.2 255.255.255.0
#
return
· PE 1
#
sysname PE1
#
ospf 1
area 0.0.0.0
mpls te enable
#
mpls lsr-id 192.2.2.2
#
mpls ldp
#
mpls te
#
rsvp
#
l2vpn enable
#
interface LoopBack0
ip address 192.2.2.2 255.255.255.255
ospf 1 area 0.0.0.0
#
interface Ten-GigabitEthernet3/0/2
ip address 23.1.1.1 255.255.255.0
ospf 1 area 0.0.0.0
mpls enable
mpls te enable
rsvp enable
#
interface Tunnel1 mode mpls-te
ip address 7.1.1.1 255.255.255.0
destination 192.4.4.4
#
xconnect-group vpn1
connection ldp
ac interface Ten-GigabitEthernet3/0/1
peer 192.4.4.4 pw-id 1000
#
return
· P
#
sysname P
#
ospf 1
area 0.0.0.0
mpls te enable
#
mpls lsr-id 192.4.4.4
#
mpls ldp
#
mpls te
#
rsvp
#
l2vpn enable
#
pw-class pwa
pw-type ethernet
#
interface LoopBack0
ip address 192.4.4.4 255.255.255.255
ospf 1 area 0.0.0.0
#
interface Ten-GigabitEthernet3/0/1
ip address 23.1.1.2 255.255.255.0
ospf 1 area 0.0.0.0
mpls enable
mpls te enable
rsvp enable
#
interface Ten-GigabitEthernet3/0/2
ip address 26.2.2.2 255.255.255.0
ospf 1 area 0.0.0.0
mpls enable
mpls te enable
rsvp enable
#
interface Tunnel1 mode mpls-te
ip address 7.1.1.2 255.255.255.0
destination 192.2.2.2
#
interface Tunnel2 mode mpls-te
ip address 8.1.1.2 255.255.255.0
destination 192.3.3.3
#
xconnect-group vpn1
connection ldpsvc
peer 192.2.2.2 pw-id 1000 pw-class pwa
peer 192.3.3.3 pw-id 1000 in-label 100 out-label 200 pw-class pwa
#
return
· PE 2
#
sysname PE2
#
ospf 1
area 0.0.0.0
mpls te enable
#
mpls lsr-id 192.3.3.3
#
mpls te
#
rsvp
#
l2vpn enable
#
interface LoopBack0
ip address 192.3.3.3 255.255.255.255
#
interface Ten-GigabitEthernet3/0/2
ip address 26.2.2.1 255.255.255.0
ospf 1 area 0.0.0.0
mpls enable
mpls te enable
rsvp enable
#
interface Tunnel2 mode mpls-te
ip address 8.1.1.1 255.255.255.0
destination 192.4.4.4
#
xconnect-group vpn1
connection svc
ac interface Ten-GigabitEthernet3/0/1
peer 192.4.4.4 pw-id 1000 in-label 200 out-label 100
#
return
Example: Configuring an inter-domain multi-segment PW
Network configuration
PE 1 and ASBR 1 belong to AS 100. PE 2 and ASBR 2 belong to AS 200.
Set up an inter-domain multi-segment PW (a method for inter-AS Option B networking) within the backbone to allow communication between CE 1 and CE 2.
Configure the inter-domain multi-segment PW as follows:
· Configure LDP PWs between PE 1 and ASBR 1, and between PE 2 and ASBR 2, and configure public tunnels through LDP to carry the PWs.
· Configure an LDP PW between ASBR 1 and ASBR 2. Advertise labeled IPv4 routes between ASBR 1 and ASBR 2 through BGP to set up the public tunnel to carry the LDP PW.
· Concatenate the two PWs on ASBR 1.
· Concatenate the two PWs on ASBR 2.
Figure 7 Network diagram
Table 12 Interface label and interface name mappings
|
Interface label |
Interface name |
|
Interface1 |
Ten-GigabitEthernet3/0/1 |
|
Interface2 |
Ten-GigabitEthernet3/0/2 |
Table 13 Interface and IP address assignment
|
Device |
Interface |
IP address |
Device |
Interface |
IP address |
|
CE 1 |
XGE3/0/1 |
100.1.1.1/24 |
ASBR 1 |
Loop0 |
192.2.2.2/32 |
|
PE 1 |
Loop0 |
192.1.1.1/32 |
|
XGE3/0/2 |
23.1.1.2/24 |
|
|
XGE3/0/2 |
23.1.1.1/24 |
|
XGE3/0/1 |
26.2.2.2/24 |
|
PE 2 |
Loop0 |
192.4.4.4/32 |
ASBR 2 |
Loop0 |
192.3.3.3/32 |
|
|
XGE3/0/2 |
22.2.2.1/24 |
|
XGE3/0/1 |
26.2.2.3/24 |
|
CE 2 |
XGE3/0/1 |
100.1.1.2/24 |
|
XGE3/0/2 |
22.2.2.3/24 |
Procedure
1. Configure CE 1.
<Sysname> system-view
[Sysname] sysname CE1
[CE1] interface ten-gigabitethernet 3/0/1
[CE1-Ten-GigabitEthernet3/0/1] ip address 100.1.1.1 24
[CE1-Ten-GigabitEthernet3/0/1] quit
2. Configure PE 1:
# Configure an LSR ID.
<Sysname> system-view
[Sysname] sysname PE1
[PE1] interface loopback 0
[PE1-LoopBack0] ip address 192.1.1.1 32
[PE1-LoopBack0] quit
[PE1] mpls lsr-id 192.1.1.1
# Enable L2VPN.
[PE1] l2vpn enable
# Enable global LDP.
[PE1] mpls ldp
[PE1-ldp] quit
# Configure Ten-GigabitEthernet 3/0/2 (the interface connected to ASBR 1), and enable LDP on the interface.
[PE1] interface ten-gigabitethernet 3/0/2
[PE1-Ten-GigabitEthernet3/0/2] ip address 23.1.1.1 24
[PE1-Ten-GigabitEthernet3/0/2] mpls enable
[PE1-Ten-GigabitEthernet3/0/2] mpls ldp enable
[PE1-Ten-GigabitEthernet3/0/2] quit
# Configure OSPF for LDP to create LSPs.
[PE1] ospf
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 23.1.1.1 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 192.1.1.1 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# Create a cross-connect group named vpn1, create a cross-connect named ldp in the group, and bind Ten-GigabitEthernet 3/0/1 to the cross-connect.
[PE1] xconnect-group vpn1
[PE1-xcg-vpn1] connection ldp
[PE1-xcg-vpn1-ldp] ac interface ten-gigabitethernet 3/0/1
[PE1-xcg-vpn1-ldp-Ten-GigabitEthernet3/0/1] quit
# Create an LDP PW for the cross-connect to bind the AC to the PW.
[PE1-xcg-vpn1-ldp] peer 192.2.2.2 pw-id 1000
[PE1-xcg-vpn1-ldp-192.2.2.2-1000] quit
[PE1-xcg-vpn1-ldp] quit
[PE1-xcg-vpn1] quit
3. Configure ASBR 1:
# Configure an LSR ID.
<Sysname> system-view
[Sysname] sysname ASBR1
[ASBR1] interface loopback 0
[ASBR1-LoopBack0] ip address 192.2.2.2 32
[ASBR1-LoopBack0] quit
[ASBR1] mpls lsr-id 192.2.2.2
# Enable L2VPN.
[ASBR1] l2vpn enable
# Enable global LDP.
[ASBR1] mpls ldp
[ASBR1-ldp] quit
# Configure Ten-GigabitEthernet 3/0/2 (the interface connected to PE 1), and enable LDP on the interface.
[ASBR1] interface ten-gigabitethernet 3/0/2
[ASBR1-Ten-GigabitEthernet3/0/2] ip address 23.1.1.2 24
[ASBR1-Ten-GigabitEthernet3/0/2] mpls enable
[ASBR1-Ten-GigabitEthernet3/0/2] mpls ldp enable
[ASBR1-Ten-GigabitEthernet3/0/2] quit
# Configure Ten-GigabitEthernet 3/0/1 (the interface connected to ASBR 2), and enable MPLS on the interface.
[ASBR1] interface ten-gigabitethernet 3/0/1
[ASBR1-Ten-GigabitEthernet3/0/1] ip address 26.2.2.2 24
[ASBR1-Ten-GigabitEthernet3/0/1] mpls enable
[ASBR1-Ten-GigabitEthernet3/0/1] quit
# Configure OSPF for LDP to create LSPs.
[ASBR1] ospf
[ASBR1-ospf-1] area 0
[ASBR1-ospf-1-area-0.0.0.0] network 23.1.1.2 0.0.0.255
[ASBR1-ospf-1-area-0.0.0.0] network 192.2.2.2 0.0.0.0
[ASBR1-ospf-1-area-0.0.0.0] quit
[ASBR1-ospf-1] quit
# Configure BGP to advertise labeled routes on ASBR 1.
[ASBR1] bgp 100
[ASBR1-bgp-default] peer 26.2.2.3 as-number 200
[ASBR1-bgp-default] address-family ipv4 unicast
[ASBR1-bgp-default-ipv4] import-route direct
[ASBR1-bgp-default-ipv4] peer 26.2.2.3 enable
[ASBR1-bgp-default-ipv4] peer 26.2.2.3 route-policy policy1 export
[ASBR1-bgp-default-ipv4] peer 26.2.2.3 label-route-capability
[ASBR1-bgp-default-ipv4] quit
[ASBR1-bgp-default] quit
[ASBR1] route-policy policy1 permit node 1
[ASBR1-route-policy-policy1-1] apply mpls-label
[ASBR1-route-policy-policy1-1] quit
# Create a cross-connect group named vpn1, create a cross-connect named ldp in the group, and create two LDP PWs for the cross-connect to form a multi-segment PW.
[ASBR1] xconnect-group vpn1
[ASBR1-xcg-vpn1] connection ldp
[ASBR1-xcg-vpn1-ldp] peer 192.1.1.1 pw-id 1000
[ASBR1-xcg-vpn1-ldp-192.1.1.1-1000] quit
[ASBR1-xcg-vpn1-ldp] peer 192.3.3.3 pw-id 1000
[ASBR1-xcg-vpn1-ldp-192.3.3.3-1000] quit
[ASBR1-xcg-vpn1-ldp] quit
[ASBR1-xcg-vpn1] quit
4. Configure ASBR 2:
# Configure an LSR ID.
<Sysname> system-view
[Sysname] sysname ASBR2
[ASBR2] interface loopback 0
[ASBR2-LoopBack0] ip address 192.3.3.3 32
[ASBR2-LoopBack0] quit
[ASBR2] mpls lsr-id 192.3.3.3
# Enable L2VPN.
[ASBR2] l2vpn enable
# Enable global LDP.
[ASBR2] mpls ldp
[ASBR2-ldp] quit
# Configure Ten-GigabitEthernet 3/0/2 (the interface connected to PE 2), and enable LDP on the interface.
[ASBR2] interface ten-gigabitethernet 3/0/2
[ASBR2-Ten-GigabitEthernet3/0/2] ip address 22.2.2.3 24
[ASBR2-Ten-GigabitEthernet3/0/2] mpls enable
[ASBR2-Ten-GigabitEthernet3/0/2] mpls ldp enable
[ASBR2-Ten-GigabitEthernet3/0/2] quit
# Configure Ten-GigabitEthernet 3/0/1 (the interface connected to ASBR 1), and enable MPLS on the interface.
[ASBR2] interface ten-gigabitethernet 3/0/1
[ASBR2-Ten-GigabitEthernet3/0/1] ip address 26.2.2.3 24
[ASBR2-Ten-GigabitEthernet3/0/1] mpls enable
[ASBR2-Ten-GigabitEthernet3/0/1] quit
# Configure OSPF for LDP to create LSPs.
[ASBR2] ospf
[ASBR2-ospf-1] area 0
[ASBR2-ospf-1-area-0.0.0.0] network 22.2.2.3 0.0.0.255
[ASBR2-ospf-1-area-0.0.0.0] network 192.3.3.3 0.0.0.0
[ASBR2-ospf-1-area-0.0.0.0] quit
[ASBR2-ospf-1] quit
# Configure BGP to advertise labeled routes on ASBR 2.
[ASBR2] bgp 200
[ASBR2-bgp-default] peer 26.2.2.2 as-number 100
[ASBR2-bgp-default] address-family ipv4 unicast
[ASBR2-bgp-default-ipv4] import-route direct
[ASBR2-bgp-default-ipv4] peer 26.2.2.2 enable
[ASBR2-bgp-default-ipv4] peer 26.2.2.2 route-policy policy1 export
[ASBR2-bgp-default-ipv4] peer 26.2.2.2 label-route-capability
[ASBR2-bgp-default-ipv4] quit
[ASBR2-bgp-default] quit
[ASBR2] route-policy policy1 permit node 1
[ASBR2-route-policy-policy1-1] apply mpls-label
[ASBR2-route-policy-policy1-1] quit
# Create a cross-connect group named vpn1, create a cross-connect named ldp in the group, and create two LDP PWs for the cross-connect to form a multi-segment PW.
[ASBR2] xconnect-group vpn1
[ASBR2-xcg-vpn1] connection ldp
[ASBR2-xcg-vpn1-ldp] peer 192.2.2.2 pw-id 1000
[ASBR2-xcg-vpn1-ldp-192.2.2.2-1000] quit
[ASBR2-xcg-vpn1-ldp] peer 192.4.4.4 pw-id 1000
[ASBR2-xcg-vpn1-ldp-192.4.4.4-1000] quit
[ASBR2-xcg-vpn1-ldp] quit
[ASBR2-xcg-vpn1] quit
5. Configure PE 2:
# Configure an LSR ID.
<Sysname> system-view
[Sysname] sysname PE2
[PE2] interface loopback 0
[PE2-LoopBack0] ip address 192.4.4.4 32
[PE2-LoopBack0] quit
[PE2] mpls lsr-id 192.4.4.4
# Enable L2VPN.
[PE2] l2vpn enable
# Enable global LDP.
[PE2] mpls ldp
[PE2-ldp] quit
# Configure Ten-GigabitEthernet 3/0/2 (the interface connected to ASBR 2), and enable LDP on the interface.
[PE2] interface ten-gigabitethernet 3/0/2
[PE2-Ten-GigabitEthernet3/0/2] ip address 22.2.2.1 24
[PE2-Ten-GigabitEthernet3/0/2] mpls enable
[PE2-Ten-GigabitEthernet3/0/2] mpls ldp enable
[PE2-Ten-GigabitEthernet3/0/2] quit
# Configure OSPF for LDP to create LSPs.
[PE2] ospf
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 192.4.4.4 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] network 22.2.2.1 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
# Create a cross-connect group named vpn1, create a cross-connect named ldp in the group, and bind Ten-GigabitEthernet 3/0/1 to the cross-connect.
[PE2] xconnect-group vpn1
[PE2-xcg-vpn1] connection ldp
[PE2-xcg-vpn1-ldp] ac interface ten-gigabitethernet 3/0/1
[PE2-xcg-vpn1-ldp-Ten-GigabitEthernet3/0/1] quit
# Create an LDP PW for the cross-connect to bind the AC to the PW.
[PE2-xcg-vpn1-ldp] peer 192.3.3.3 pw-id 1000
[PE2-xcg-vpn1-ldp-192.3.3.3-1000] quit
[PE2-xcg-vpn1-ldp] quit
[PE2-xcg-vpn1] quit
6. Configure CE 2.
<Sysname> system-view
[Sysname] sysname CE2
[CE2] interface ten-gigabitethernet 3/0/1
[CE2-Ten-GigabitEthernet3/0/1] ip address 100.1.1.2 24
[CE2-Ten-GigabitEthernet3/0/1] quit
Verifying the configuration
# Verify that an LDP PW has been created on PE 1.
[PE1] display l2vpn pw
Flags: M - main, B - backup, E - ecmp, BY - bypass, H - hub link, S - spoke link
N - no split horizon, A - administration, ABY – ac-bypass
PBY – pw-bypass
Total number of PWs: 1
1 up, 0 blocked, 0 down, 0 defect, 0 idle, 0 duplicate
Xconnect-group Name: vpn1
Peer PWID/RmtSite/SrvID In/Out Label Proto Flag Link ID State
192.2.2.2 1000 1151/1279 LDP M Up
# Verify that two LDP PWs have been created to form a multi-segment PW on ASBR 1.
[ASBR1] display l2vpn pw
Flags: M - main, B - backup, E - ecmp, BY - bypass, H - hub link, S - spoke link
N - no split horizon, A - administration, ABY – ac-bypass
PBY – pw-bypass
Total number of PWs: 2
2 up, 0 blocked, 0 down, 0 defect, 0 idle, 0 duplicate
Xconnect-group Name: vpn1
Peer PWID/RmtSite/SrvID In/Out Label Proto Flag Link ID State
192.1.1.1 1000 1279/1151 LDP M 0 Up
192.3.3.3 1000 1278/1151 LDP M 1 Up
# Verify that two LDP PWs have been created to form a multi-segment PW on ASBR 2.
[ASBR2] display l2vpn pw
Flags: M - main, B - backup, E - ecmp, BY - bypass, H - hub link, S - spoke link
N - no split horizon, A - administration, ABY – ac-bypass
PBY – pw-bypass
Total number of PWs: 2
2 up, 0 blocked, 0 down, 0 defect, 0 idle, 0 duplicate
Xconnect-group Name: vpn1
Peer PWID/RmtSite/SrvID In/Out Label Proto Flag Link ID State
192.2.2.2 1000 1151/1278 LDP M 0 Up
192.4.4.4 1000 1150/1279 LDP M 1 Up
# Verify that an LDP PW has been created on PE 2.
[PE2] display l2vpn pw
Flags: M - main, B - backup, E - ecmp, BY - bypass, H - hub link, S - spoke link
N - no split horizon, A - administration, ABY – ac-bypass
PBY – pw-bypass
Total number of PWs: 1
1 up, 0 blocked, 0 down, 0 defect, 0 idle, 0 duplicate
Xconnect-group Name: vpn1
Peer PWID/RmtSite/SrvID In/Out Label Proto Flag Link ID State
192.3.3.3 1000 1279/1150 LDP M 1 Up
# Verify that CE 1 and CE 2 can ping each other. (Details not shown.)
Configuration files
· ASBR 1
#
sysname ASBR1
#
ospf 1
area 0.0.0.0
network 23.1.1.0 0.0.0.255
network 192.2.2.2 0.0.0.0
#
mpls lsr-id 192.2.2.2
#
mpls ldp
#
l2vpn enable
#
interface LoopBack0
ip address 192.2.2.2 255.255.255.255
#
interface Ten-GigabitEthernet3/0/1
ip address 26.2.2.2 255.255.255.0
mpls enable
#
interface Ten-GigabitEthernet3/0/2
ip address 23.1.1.2 255.255.255.0
mpls enable
mpls ldp enable
#
bgp 100
peer 26.2.2.3 as-number 200
#
address-family ipv4 unicast
import-route direct
peer 26.2.2.3 enable
peer 26.2.2.3 route-policy policy1 export
peer 26.2.2.3 label-route-capability
#
route-policy policy1 permit node 1
apply mpls-label
#
xconnect-group vpn1
connection ldp
peer 192.1.1.1 pw-id 1000
peer 192.3.3.3 pw-id 1000
#
return
· ASBR 2
#
sysname ASBR2
#
ospf 1
area 0.0.0.0
network 22.2.2.0 0.0.0.255
network 192.3.3.3 0.0.0.0
#
mpls lsr-id 192.3.3.3
#
mpls ldp
#
l2vpn enable
#
interface LoopBack0
ip address 192.3.3.3 255.255.255.255
#
interface Ten-GigabitEthernet3/0/1
ip address 26.2.2.3 255.255.255.0
mpls enable
#
interface Ten-GigabitEthernet3/0/2
ip address 22.2.2.3 255.255.255.0
mpls enable
mpls ldp enable
#
bgp 200
peer 26.2.2.2 as-number 100
#
address-family ipv4 unicast
import-route direct
peer 26.2.2.2 enable
peer 26.2.2.2 route-policy policy1 export
peer 26.2.2.2 label-route-capability
#
route-policy policy1 permit node 1
apply mpls-label
#
xconnect-group vpn1
connection ldp
peer 192.2.2.2 pw-id 1000
peer 192.4.4.4 pw-id 1000
#
return
· PE 1
#
sysname PE1
#
ospf 1
area 0.0.0.0
network 23.1.1.0 0.0.0.255
network 192.1.1.1 0.0.0.0
#
mpls lsr-id 192.1.1.1
#
mpls ldp
#
l2vpn enable
#
interface LoopBack0
ip address 192.1.1.1 255.255.255.255
#
interface Ten-GigabitEthernet3/0/2
ip address 23.1.1.1 255.255.255.0
mpls enable
mpls ldp enable
#
xconnect-group vpn1
connection ldp
ac interface Ten-GigabitEthernet3/0/1
peer 192.2.2.2 pw-id 1000
#
return
· PE 2
#
sysname PE2
#
ospf 1
area 0.0.0.0
network 22.2.2.0 0.0.0.255
network 192.4.4.4 0.0.0.0
#
mpls lsr-id 192.4.4.4
#
mpls ldp
#
l2vpn enable
#
interface LoopBack0
ip address 192.4.4.4 255.255.255.255
#
interface Ten-GigabitEthernet3/0/2
ip address 22.2.2.1 255.255.255.0
mpls enable
mpls ldp enable
#
xconnect-group vpn1
connection ldp
ac interface Ten-GigabitEthernet3/0/1
peer 192.3.3.3 pw-id 1000
#
return
· CE 1
#
sysname CE1
#
interface Ten-GigabitEthernet3/0/1
ip address 100.1.1.1 255.255.255.0
#
return
· CE 2
#
sysname CE2
#
interface Ten-GigabitEthernet3/0/1
ip address 100.1.1.2 255.255.255.0
#
return







