OcNOS-SP : Multi-Protocol Label Switching Guide : Multi-Protocol Label Switching Configuration Guide : MPLS Layer-3 VPN Configurations : Configure MPLS Layer-3 VPN
Configure MPLS Layer-3 VPN
The MPLS Layer-3 VPN configuration process can be divided into the following tasks
1. Establish connection between PE routers.
2. Configure PE1 and PE2 as iBGP neighbors.
3. Create VRF.
4. Associate interfaces to VRFs.
5. Configure VRF Route Destination and Route Targets.
6. Configure CE neighbor for the VPN.
7. Verify the MPLS to VPN configuration.
Topology
In this example, the CConnect MPLS-VPN backbone has two customers — ComA and ComB. Both customers have sites in California and Arizona. The following topology shows BGP4 address assignment between PE and CE routers. The steps that follow provision a customer VPN service across the MPLS-VPN backbone.
Figure 3-4: Connect Sample Topology
To establish this connection involves three steps:
Enable Label Switching
This is a sample configuration to enable label switching for the Labeled Switched Path (LSP) between PE1 and PE2 (refer to Figure 3-4).
Enable Label Switching: PE1
 
configure terminal
Enter configure mode
(config)#interface lo
Enter interface mode
(config-if)#ip address 2.2.2.2/32 secondary
Assign the IPv4 address
(config-if)#exit
Exit interface mode
(config)#interface xe1
Enter Interface mode
(config-if)#ip address 10.10.12.1/24
Assign IPv4 address
(config-if)#label-switching
Enabling label switching capability on router
(config-if)#commit
Commit the transaction.
Enable Label Switching: P
 
configure terminal
Enter configure mode
(config)#interface lo
Enter interface mode
(config-if)#ip address 4.4.4.4/32 secondary
Assign the IPv4 address
(config-if)#exit
Exit interface mode
(config)#interface xe1
Enter Interface mode
(config-if)#ip address 10.10.12.2/24
Assign IPv4 address
(config-if)#label-switching
Enabling label switching capability on router
(config-if)#commit
Commit the transaction.
(config)#interface xe2
Enter Interface mode
(config-if)#ip address 10.10.13.1/24
Assign IPv4 address
(config-if)#label-switching
Enabling label switching capability on router
(config-if)#commit
Commit the transaction.
Enable Label Switching: PE2
 
configure terminal
Enter configure mode
(config)#interface lo
Enter interface mode
(config-if)#ip address 3.3.3.3/32 secondary
Assign the IPv4 address
(config-if)#exit
Exit interface mode
(config)#interface xe2
Enter Interface mode
(config-if)#ip address 10.10.13.2/24
Assign IPv4 address
(config-if)#label-switching
Enabling label switching capability on router
(config-if)#commit
Commit the transaction.
Enable IGP
What follows is a sample configuration to establish connections between the two Provider Edge routers PE1 and PE2.
Enable IGP Switching: PE1
 
configure terminal
Enter configure mode
(config)#router ospf 100
Configure the routing process and specify the Process ID (100)
(config-router)#network 10.10.12.0/24 area 0
Define the interface on which OSPF runs and associate the area ID (0) with the interface
(config-router)#network 2.2.2.2/32 area 0
Define the interface on which OSPF runs and associate the area ID (0) with the interface
(config-router)#commit
Commit the transaction.
Enable IGP Switching: P
 
configure terminal
Enter configure mode
(config)#router ospf 100
Configure the routing process and specify the Process ID (100)
(config-router)#network 10.10.12.0/24 area 0
Define the interface on which OSPF runs and associate the area ID (0) with the interface
(config-router)#network 10.10.13.0/24 area 0
Define the interface on which OSPF runs and associate the area ID (0) with the interface
(config-router)#network 4.4.4.4/32 area 0
Define the interface on which OSPF runs and associate the area ID (0) with the interface
(config-router)#commit
Commit the transaction.
Enable IGP Switching: PE2
 
configure terminal
Enter configure mode
(config)#router ospf 100
Configure the routing process and specify the Process ID (100)
(config-router)#network 3.3.3.3/32 area 0
Define the interface on which OSPF runs and associate the area ID (0) with the interface
(config-router)#commit
Commit the transaction.
Enable Label Switching Protocol
Label switching protocols are used to set up a Label-Switched Path (LSP) between PE routers. OcNOS supports LDP and RSVP-TE protocols for label switching. Enable either LDP or RSVP-TE.
This is a sample configuration to enable LDP on the whole path between PE1 and PE2 (see Figure 3-4).
LDP: PE1
 
configure terminal
Enter configure mode
(config)#router ldp
Enter router mode for LDP
(config-router)#exit
Exit router mode
(config)#interface xe1
Enter interface mode
(config-if)#enable-ldp ipv4
Enabling LDP on interface
(config-if)#commit
Commit the transaction.
LDP: P
 
configure terminal
Enter configure mode
(config)#router ldp
Enter router mode for LDP
(config-router)#exit
Exit router mode
(config)#interface xe1
Enter interface mode
(config-if)#enable-ldp ipv4
Enabling LDP on interface
(config-if)#exit
Exit interface mode
(config)#interface xe2
Enter interface mode
(config-if)#enable-ldp ipv4
Enabling LDP on interface
(config-if)#commit
Commit the transaction.
LDP: PE2
 
configure terminal
Enter configure mode
(config)#router ldp
Enter router mode for LDP
(config-router)#exit
Exit router mode
(config)#interface xe2
Enter interface mode
(config-if)#enable-ldp ipv4
Enabling LDP on interface
(config-if)#commit
Commit the transaction.
This is a sample configuration to enable RSVP-TE along the entire path between PE1 and PE2 (see Figure 3-4).
RSVP-TE: PE1
 
configure terminal
Enter configure mode
(config)#router rsvp
Enter Configure Router mode
(config-router)#rsvp-path p1 mpls
Enter the path mode for RSVP P1.
(config-path)#10.10.12.2 loose
Configure loose path
(config-path)#exit
Exit Configure Router mode
(config)#rsvp-trunk t1
Configure RSVP trunk t1
(config-rsvp)#primary path p1
Specify an RSVP path to be used
(config-rsvp)#from 2.2.2.2
Assign the source loopback address to the RSVP trunk
(config-rsvp)#to 3.3.3.3
Assign the source loopback address to the to the RSVP trunk
(config-rsvp)#exit
Exit RSVP trunk mode
(config)#interface xe1
Enter the interface mode
(config-if)#enable-rsvp
Enable RSVP in interface
(config-if)#commit
Commit the transaction.
RSVP-TE: P
 
configure terminal
Enter configure mode
(config)#router rsvp
Enter Configure Router mode
(config-router)#exit
Exit Configure Router mode
(config)#interface xe1
Enter the interface mode
(config-if)#enable-rsvp
Enable RSVP in interface
(config-if)#exit
Exit interface mode
(config)#interface xe2
Enter the interface mode
(config-if)#enable-rsvp
Enable RSVP in interface
(config-if)#commit
Commit the transaction.
RSVP-TE: PE2
 
configure terminal
Enter configure mode
(config)#router rsvp
Enter Configure Router mode
(config-router)#rsvp-trunk t1
Configure RSVP trunk t1
(config-rsvp)#from 3.3.3.3
Assign the source loopback address to the RSVP trunk
(config-rsvp)#to 2.2.2.2
Assign the source loopback address to the to the RSVP trunk
(config-rsvp)#exit
Exit RSVP trunk mode
(config)#interface xe2
Enter the interface mode
(config-if)#enable-rsvp
Enable RSVP in interface
(config-if)#commit
Commit the transaction.
Configure PEs as BGP Neighbors
BGP is the preferred protocol to transport VPN routes because of its multiprotocol capability and its scalability. Its ability to exchange information between indirectly connected routers supports keeping VPN routing information out of the Provider (P) routers. The P routers carry information as an optional BGP attribute. Additional attributes are transparently forwarded by any P router. The MPLS-VPN forwarding model does not require the P routers to make routing decisions based on VPN addresses: They forward packets based on the label value attached to the packet. The P routers do not require a VPN configuration in order to carry this information.
PE1
 
#configure terminal
Enter the configure terminal
(config)#router bgp 100
Enter the Router BGP mode, ASN: 100
(config-router)#bgp router-id 2.2.2.2
Router identifier for BGP
(config-router)#exit
Exit router BGP mode
(config)#router ldp
Enter the Router LDP mode
(config-router)#exit
Exit the Router LDP mode
(config)#router bgp 100
Enter the Router BGP mode, ASN: 100
(config-router)#neighbor 3.3.3.3 remote-as 100
Configuring ABR1 as iBGP neighbor using it's loopback IP
(config-router)#neighbor 3.3.3.3 update-source 2.2.2.2
Source of routing updates
(config-router)#address-family vpnv4 unicast
Configure VPNv4 address family
(config-router-af)#neighbor 3.3.3.3 activate
Activate the VPN neighbor
(config-router-af)exit-address-family
Exit address family mode
(config-router)#address-family ipv4 unicast
Configure IPv4 address family
(config-router-af)#neighbor 3.3.3.3 activate
Activate the IPv4 neighbor
(config-router-af)#commit
Commit the transaction.
PE2
 
#configure terminal
Enter the configure terminal
(config)#router bgp 100
Enter the Router BGP mode, ASN: 100
(config-router)#bgp router-id 3.3.3.3
Router identifier for BGP
(config-router)#exit
Exit router BGP mode
(config)#router ldp
Enter the Router LDP mode
(config-router)#exit
Exit the Router LDP mode
(config)#router bgp 100
Enter the Router BGP mode, ASN: 100
(config-router)#neighbor 2.2.2.2 remote-as 100
Configuring ABR1 as iBGP neighbor using it's loopback IP
(config-router)#neighbor 2.2.2.2 update-source 3.3.3.3
Source of routing updates
(config-router)#address-family vpnv4 unicast
Configure VPNv4 address family
(config-router-af)#neighbor 2.2.2.2 activate
Activate the VPN neighbor
(config-router-af)exit-address-family
Exit address family mode
(config-router)#address-family ipv4 unicast
Configure IPv4 address family
(config-router-af)#neighbor 2.2.2.2 activate
Activate the IPv4 neighbor
(config-router-af)#commit
Commit the transaction.
Create VRF
Each PE router in the MPLS-VPN backbone is attached to a site that receives routes from a specific VPN, so the PE router must have the relevant Virtual Routing and Forwarding (VRF) configuration for that VPN.
This command creates a VRF RIB (Routing Information Base), assigns a VRF-ID, and switches the command mode to vrf mode. The following example creates a VRF named ComB.
PE1
 
#configure terminal
Enter the configure terminal
(config)#ip vrf ComB
Configure VRF instance
(config-vrf)#rd 2:1
Configure Router Distinguisher value
(config-vrf)#exit
Exit VRF mode
(config)#ip vrf ComA
Configure VRF instance
(config-vrf)#rd 1:2
Configure Router Distinguisher value
(config-vrf)#exit
Exit VRF mode
(config)#commit
Commit the transaction.
PE2
 
#configure terminal
Enter the configure terminal
(config)#ip vrf ComB
Configure VRF instance
(config-vrf)#rd 1:2
Configure Router Distinguisher value
(config-vrf)#exit
Exit VRF mode
(config)#ip vrf ComA
Configure VRF instance
(config-vrf)#rd 2:1
Configure Router Distinguisher value
(config-vrf)#exit
Exit VRF mode
(config)#commit
Commit the transaction.
Associate Interfaces to VRFs
After the VRFs are defined on the PE router, the PE router needs to recognize which interfaces belong to which VRF. The VRF is populated with routes from connected sites. More than one interface can belong to the same VRF.
In the following example, interface xe48 is associated with the VRF named ComB.
PE1
 
#configure terminal
Enter the configure terminal
(config)#interface xe48
Enter interface mode
(config-if)#ip vrf forwarding ComB
Bind the VRF instance to the interface
(config-if)exit
Exit interface mode
(config)#interface xe49
Enter interface mode
(config-if)#ip vrf forwarding ComA
Bind the VRF instance to the interface
(config-if)#ip address 192.16.2.2/24
Assign IPv4 address
(config-if)exit
Exit interface mode
(config)#interface xe48
Enter interface mode
(config-if)#ip vrf forwarding ComA
Bind the VRF instance to the interface
(config-if)#ip address 168.12.0.3/24
Assign IPv4 address
(config-if)exit
Exit interface mode
(config)#commit
Commit the transaction.
PE2
 
#configure terminal
Enter the configure terminal
(config)#interface xe48
Enter interface mode
(config-if)#ip vrf forwarding ComA
Bind the VRF instance to the interface
(config-if)#ip address 192.16.4.2/24
Assign IPv4 address
(config-if)exit
Exit interface mode
(config)#interface xe49
Enter interface mode
(config-if)#ip vrf forwarding ComB
Bind the VRF instance to the interface
(config-if)#ip address 168.12.4.2/24
Assign IPv4 address
(config-if)exit
Exit interface mode
(config)#commit
Commit the transaction.
Configure VRF—RD and Route Targets
After the VRF is created, configure Router Distinguishers and the Route Targets.
Configure Route Distinguishers
Route Distinguishers (RDs) make all customer routes unique. The routes must be unique, so that Multi-Protocol BGP treats the same prefix from two different VPNs as non-comparable routes. To configure RDs, a sequence of 64 bits is prepended to the IPv4 address in the Multi-Protocol BGP update. BGP considers two IPv4 addresses with different RDs as non-comparable, even if they have the same address and mask.
Assign a particular value to the RD for each VRF on the PE router. To display the routing table for a VRF, use the show ip route vrf command.
The following example shows adding an RD. Configure a VRF in both PEs with a unique RD value:
PE1
 
#configure terminal
Enter the configure terminal
(config)#ip vrf ComA
Configure VRF instance
(config-vrf)#rd 2:2
Configure Router Distinguisher value
(config-vrf)#route-target both 200:1
Configure route-target as both
(config-vrf)#exit
Exit VRF mode
(config)#ip vrf ComB
Configure VRF instance
(config-vrf)#rd 1:1
Configure Router Distinguisher value
(config-vrf)#route-target both 100:1
Configure route-target as both
(config-vrf)#exit
Exit VRF mode
(config)#commit
Commit the transaction.
PE2
 
#configure terminal
Enter the configure terminal
(config)#ip vrf ComA
Configure VRF instance
(config-vrf)#rd 2:1
Configure Router Distinguisher value
(config-vrf)#route-target both 200:1
Configure route-target as both
(config-vrf)#exit
Exit VRF mode
(config)#ip vrf ComB
Configure VRF instance
(config-vrf)#rd 1:2
Configure Router Distinguisher value
(config-vrf)#route-target both 100:1
Configure route-target as both
(config-vrf)#exit
Exit VRF mode
(config)#commit
Commit the transaction.
Configure Route Targets
Any routes learned from customers are advertised across the network through Multi-Protocol BGP, and any routes learned through Multi-Protocol BGP are added into the appropriate VRFs. The route target helps PE routers identify which VRFs should receive the routes.
The route-target command creates lists of import and export route-target extended communities for the VRF. It specifies a target VPN extended community. Execute the command once for each community. All routes with the specific route-target extended community are imported into all VRFs with the same extended community as an import route-target.
The following example demonstrates the route-target configuration.
PE1
 
#configure terminal
Enter the configure terminal
(config)#ip vrf ComA
Configure VRF instance
(config-vrf)#rd 2:2
Configure Router Distinguisher value
(config-vrf)#route-target both 200:1
Configure route-target as both
(config-vrf)#exit
Exit VRF mode
(config)#ip vrf ComB
Configure VRF instance
(config-vrf)#rd 1:1
Configure Router Distinguisher value
(config-vrf)#route-target both 100:1
Configure route-target as both
(config-vrf)#exit
Exit VRF mode
(config)#commit
Commit the transaction.
PE2
 
#configure terminal
Enter the configure terminal
(config)#ip vrf ComA
Configure VRF instance
(config-vrf)#rd 2:1
Configure Router Distinguisher value
(config-vrf)#route-target both 200:1
Configure route-target as both
(config-vrf)#exit
Exit VRF mode
(config)#ip vrf ComB
Configure VRF instance
(config-vrf)#rd 1:2
Configure Router Distinguisher value
(config-vrf)#route-target both 100:1
Configure route-target as both
(config-vrf)#exit
Exit VRF mode
(config)#commit
Commit the transaction.
Configure CE Neighbor for the VPN (Using BGP/ OSPF)
To provide a VPN service, the PE-router must be configured so that any routing information learned from a VPN customer interface can be associated with a particular VRF. This is achieved using any standard routing protocol process (OSPF, BGP or static routes etc). Use any one of the following configurations (BGP, or OSPF) to configure the CE neighbor.
Using BGP
The BGP sessions between PE and CE routers can carry different types of routes (VPN-IPv4, IPv4 routes). Address families are used to control the type of BGP session. Configure a BGP address family for each VRF on the PE-router, and a separate address family to carry VPN-IPv4 routes between PE routers. All non-VPN BGP neighbors are defined using the IPv4 address mode. Each VPN BGP neighbor is defined under its associated address family mode.
A separate address family entry is used for every VRF, and each address family entry can have multiple CE routers within the VRF.
The PE and CE routers must be directly connected for BGP4 sessions; BGP multihop is not supported between PE and CE routers.
The following example places the router in address family mode, and specifies company names, ComA and ComB, as the names of the VRF instance to associate with subsequent IPv4 address family configuration mode commands. This configuration is used when BGP is used for PE and CE.
PE1
 
configure terminal
Enter configure mode
(config)#router bgp 100
Enter BGP router mode
(config-router)#address-family ipv4 unicast
Enter address family mode
(config-router-af)#redistribute connected
Redistribute connected addresses
(config-router-af)#exit-address-family
Exit address family mode
(config-router)#address-family ipv4 vrf ComA
Enter the IPv4 address family for VRF comA
(config-router)#neighbor 192.16.2.3 remote-as 65001
Specify the neighbor
(config-router-af)#neighbor 192.16.2.3 activate
Activate the neighbor
(config-router-af)#exit-address-family
Exit address family mode
(config-router)#address-family ipv4 vrf ComB
Enter the IPv4 address family for VRF comA
(config-router)#neighbor 168.12.0.2 remote-as 65003
Specify the neighbor
(config-router-af)#neighbor 192.12.0.2 activate
Activate the neighbor
(config-router-af)#exit-address-family
Exit address family mode
(config-router)#commit
Commit the transaction
PE2
 
configure terminal
Enter configure mode
(config)#router bgp 100
Enter BGP router mode
(config-router)#address-family ipv4 unicast
Enter address family mode
(config-router-af)#redistribute connected
Redistribute connected addresses
(config-router-af)#exit-address-family
Exit address family mode
(config-router)#address-family ipv4 vrf ComA
Enter the IPv4 address family for VRF comA
(config-router)#neighbor 192.16.4.3 remote-as 65004
Specify the neighbor
(config-router-af)#neighbor 192.16.4.3 activate
Activate the neighbor
(config-router-af)#exit-address-family
Exit address family mode
(config-router)#address-family ipv4 vrf ComB
Enter the IPv4 address family for VRF comA
(config-router)#neighbor 168.12.4.1 remote-as 65005
Specify the neighbor
(config-router-af)#neighbor 192.12.4.1 activate
Activate the neighbor
(config-router-af)#exit-address-family
Exit address family mode
(config-router)#commit
Commit the transaction
CE1: BGP
 
configure terminal
Enter configure mode
(config)#interface xe48
Enter interface mode for xe48
(config-if)#ip address 168.12.0.2/24
Assign IP address
(config-if)#exit
Exit interface mode
(config)#router bgp 65003
Enter BGP router mode
(config-router)#neighbor 168.12.0.3 remote-as 100
Specify the neighbor
(config-router)#address-family ipv4 unicast
Enter address family mode
(config-router-af)#neighbor 168.12.0.3 activate
Activate the neighbor
(config-router-af)#redistribute connected
Redistribute connected addresses
(config-router-af)#commit
Commit the transaction
CE2: BGP
 
configure terminal
Enter configure mode
(config)#interface xe23
Enter interface mode for xe48
(config-if)#ip address 192.12.4.1/24
Assign IP address
(config-if)#exit
Exit interface mode
(config)#router bgp 65005
Enter BGP router mode
(config-router)#neighbor 192.12.4.2 remote-as 100
Specify the neightbor
(config-router)#address-family ipv4 unicast
Enter address family mode
(config-router-af)#neighbor 192.12.4.2 activate
Activate the neighbor
(config-router-af)#redistribute connected
Redistribute connected addresses
(config-router-af)#commit
Commit the transaction
Using OSPF
Unlike BGP, OSPF does not run different routing contexts within one process. Thus, for running OSPF between the PE and CE routers, configure a separate OSPF process for each VRF that receives VPN routes through OSPF. The PE router distinguishes routers belonging to a specific VRF, by associating a particular customer interface to a specific VRF and to a particular OSPF process.
To redistribute VRF OSPF routes into BGP, redistribute OSPF under the BGP VRF address family submode.
PE1
 
configure terminal
Enter configure mode
(config)#router ospf 101 comA
Enter OSPF router mode
(config-router)#network 192.16.3.0/24 area 0
Define the network on which OSPF runs and associate area ID
(config-router)#redistribute bgp
Redistribute BGP
(config-router)#exit
Exit router mode
(config)#router ospf 102 comB
Enter OSPF router mode
(config-router)#network 168.12.0.2/24 area 0
Define the network on which OSPF runs and associate area ID
(config-router)#redistribute bgp
Redistribute BGP
(config-router)#commit
Commit the transaction
(config-router)#exit
Exit router mode
(config)#router bgp 100
Enter the Router BGP mode, ASN: 100
(config-router)#address-family ipv4 vrf ComA
Configure VRF address family
(config-router-af)#redistribute ospf
Redistribute OSPF
(config-router-af)#exit-address-family
Exit address family mode
(config-router)#address-family ipv4 vrf ComB
Configure VRF address family
(config-router-af)#redistribute ospf
Redistribute OSPF
(config-router-af)#redistribute rip
Redistribute RIP
(config-router-af)#commit
Commit the transaction
PE2
 
configure terminal
Enter configure mode
(config)#router ospf 101 comA
Enter OSPF router mode
(config-router)#network 192.16.4.0/24 area 0
Define the network on which OSPF runs and associate area ID
(config-router)#redistribute bgp
Redistribute BGP
(config-router)#exit
Exit router mode
(config)#router ospf 102 comB
Enter OSPF router mode
(config-router)#network 168.12.0.3/24 area 0
Define the network on which OSPF runs and associate area ID
(config-router)#redistribute bgp
Redistribute BGP
(config-router)#commit
Commit the transaction
(config-router)#exit
Exit router mode
(config)#router bgp 100
Enter the Router BGP mode, ASN: 100
(config-router)#address-family ipv4 vrf ComA
Configure VRF address family
(config-router-af)#redistribute ospf
Redistribute OSPF
(config-router-af)#exit-address-family
Exit address family mode
(config-router)#address-family ipv4 vrf ComB
Configure VRF address family
(config-router-af)#redistribute ospf
Redistribute OSPF
(config-router-af)#redistribute rip
Redistribute RIP
(config-router-af)#commit
Commit the transaction
Last modified date: 10/17/2023