How to configure MPLS VPN using Cisco routers?
Normally VPN tunnel enables an encrypted connection between private networks over a public network such as the internet, but when using MPLS, the VPN feature allows several sites to interconnect
transparently through a service provider's network.
Follow the network topology of provider routers and customers edge routers as in the given figure:
Configuration on Router R1 In global configuration Mode: R1(config)# interface Loopback0 R1(config)#ip address [Link] [Link] R1(config)#router ospf 1 R1(config-router) # network [Link] [Link] area 0
R1(config-router) #network [Link] [Link] area 0 A (config-router) #end Configuration on Router R2 In global configuration Mode: R2(config)# ip cef R2(config)#mpls label protocol ldp R2(config)# ip vrf site1 R2(config-vrf)#rd 1:1 R2(config-vrf)#route-target export 1:1 R2(config-vrf)#route-target import 1:1 R2(config)#interface Loopback0 R2(config)#ip address [Link] [Link] R2(config)#interface Serial1/0 R2(config)# ip vrf forwarding site1 R2(config)#ip address [Link] [Link] R2(config)#interface Serial1/1 R2(config)# mpls ip R2(config)#ip address [Link] [Link] R2(config)# router ospf 10 vrf site1 R2(config-router)# redistribute bgp 1 subnets R2(config-router)# network [Link] [Link] area 0 R2(config)# router ospf 1 R2(config-router)# network [Link] [Link] area 0 R2(config-router)# network [Link] [Link] area 0
R2(config)# router bgp 1 R2(config-router)# bgp router-id [Link] R2(config-router)# neighbor [Link] remote-as 1 R2(config-router)# neighbor [Link] update-source Loopback0 R2(config-router)# address-family vpnv4 R2(config-router-af)# neighbor [Link] activate R2(config-router-af)# neighbor [Link] send-community extended R2(config-router-af)# exit R2(config-router)# address-family ipv4 vrf site1 R2(config-router-af)# redistribute ospf 10 vrf site1 match internal external 1 external 2 R2(config-router-af)# end Configuration on Router R3 In global configuration Mode: R3(config)# ip cef R3(config)#mpls label protocol ldp R3(config)#interface Loopback0 R3(config)#ip address [Link] [Link] R3(config)#interface Serial1/0 R3(config)# mpls ip R3(config)#ip address [Link] [Link] R3(config)#interface Serial1/1 R3(config)# mpls ip R3(config)#ip address [Link] [Link] R3(config)# router ospf 1 R3(config-router)# network [Link] [Link] area 0
R3(config-router)# network [Link] [Link] area 0 R3(config-router)# network [Link] [Link] area 0 R3 (config-router) #end Configuration on Router R4 In global configuration Mode: R4(config)# ip cef R4(config)#mpls label protocol ldp R4(config)# ip vrf site1 R4(config-vrf)#rd 1:1 R4(config-vrf)#route-target export 1:1 R4(config-vrf)#route-target import 1:1 R4(config)#interface Loopback0 R4(config)#ip address [Link] [Link] R4(config)#interface Serial1/1 R4(config)# ip vrf forwarding site1 R4(config)#ip address [Link] [Link] R4(config)#interface Serial1/0 R4(config)# mpls ip R4(config)#ip address [Link] [Link] R4(config)# router ospf 10 vrf site1 R4(config-router)# redistribute bgp 1 subnets R4(config-router)# network [Link] [Link] area 0 R4(config)# router ospf 1 R4(config-router)# network [Link] [Link] area 0
R4(config-router)# network [Link] [Link] area 0 R4(config)# router bgp 1 R4(config-router)# bgp router-id [Link] R4(config-router)# neighbor [Link] remote-as 1 R4(config-router)# neighbor [Link] update-source Loopback0 R4(config-router)# address-family vpnv4 R4(config-router-af)# neighbor [Link] activate R4(config-router-af)# neighbor [Link] send-community extended R4(config-router-af)# exit R4(config-router)# address-family ipv4 vrf site1 R4(config-router-af)# redistribute ospf 10 vrf site1 match internal external 1 external 2 R4(config-router-af)# end Configuration on Router R5 In global configuration Mode: R5(config)# interface Loopback0 R5(config)#ip address [Link] [Link] R5(config)#router ospf 1 R5(config-router) # network [Link] [Link] area 0 R5(config-router) #network [Link] [Link] area 0
R5(config-router) #end