Example of mpls vpn configuration on Cisco routers

by Ras 11. December 2011 04:27

Below I show you a sample configuration of mpls vpn on the Cisco routers:


Assume Router 1 and Router 2 are the edge provider routers connected to Router 3 via the serial interfaces as below:

R1 Serial 1/0 <-> R2 Serial 1/0
R3 Serial 1/1 <-> R2 Serial 1/1

DVT and IIM are two customers that they have one office connected to R1 and the other connected to R3. You will need to configure mpls and ospf on all routers but BGP only on R1 and R3.

Router 1 configuration :

ip cef
!
!
ip vrf DVT
rd 100:110
route-target export 100:1010
route-target import 100:1010
!
ip vrf IIM
rd 100:120
route-target export 100:1020
route-target import 100:1020
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface Loopback110
ip vrf forwarding DVT
ip address 192.168.1.1 255.255.255.0
!
interface Loopback120
ip vrf forwarding IIM
ip address 192.168.1.1 255.255.255.0
!
interface Serial1/0
ip address 10.1.1.1 255.255.255.0
mpls ip
serial restart-delay 0
clock rate 128000
!
interface Serial1/1
no ip address
shutdown
serial restart-delay 0
!

router ospf 1
log-adjacency-changes
network 1.1.1.1 0.0.0.0 area 0
network 10.1.1.0 0.0.0.255 area 0
!
router bgp 65000
bgp log-neighbor-changes
neighbor 3.3.3.3 remote-as 65000
neighbor 3.3.3.3 update-source Loopback0
!
address-family vpnv4
neighbor 3.3.3.3 activate
neighbor 3.3.3.3 send-community both
exit-address-family
!
address-family ipv4 vrf IIM
redistribute connected
no synchronization
exit-address-family
!
address-family ipv4 vrf DVT
redistribute connected
no synchronization
exit-address-family
!

Router 3 Configuration:

ip cef
!
ip vrf DVT
rd 100:110
route-target export 100:1010
route-target import 100:1010
!
ip vrf IIM
rd 100:120
route-target export 100:1020
route-target import 100:1020
!
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface Loopback110
ip vrf forwarding DVT
ip address 192.168.2.1 255.255.255.0
!
interface Loopback120
ip vrf forwarding IIM
ip address 192.168.2.1 255.255.255.0
!
interface Serial1/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/1
ip address 10.2.2.2 255.255.255.0
mpls ip
serial restart-delay 0
!
router ospf 1
log-adjacency-changes
network 3.3.3.3 0.0.0.0 area 0
network 10.2.2.0 0.0.0.255 area 0
!
router bgp 65000
no synchronization
bgp log-neighbor-changes
neighbor 1.1.1.1 remote-as 65000
neighbor 1.1.1.1 update-source Loopback0
no auto-summary
!
address-family vpnv4
neighbor 1.1.1.1 activate
neighbor 1.1.1.1 send-community both
exit-address-family
!
address-family ipv4 vrf IIM
redistribute connected
no synchronization
exit-address-family
!
address-family ipv4 vrf DVT
redistribute connected
no synchronization
exit-address-family
!

Router 2 configuration:

ip cef
!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface Serial1/0
ip address 10.1.1.2 255.255.255.0
mpls ip
serial restart-delay 0
!
interface Serial1/1
ip address 10.2.2.1 255.255.255.0
mpls ip
serial restart-delay 0
clock rate 128000
!
router ospf 1
log-adjacency-changes
redistribute connected
network 2.2.2.2 0.0.0.0 area 0
network 10.1.1.0 0.0.0.255 area 0
network 10.2.2.0 0.0.0.255 area 0
!

Comments (1) -

Deepak. B
Deepak. B India
7/11/2012 3:59:39 AM #

This was so informative. Listed only the necessary configurations, no junks. Figure should give a quick idea at first and while referring. Thanks for the post.

Reply

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

About the author

Ras is a network/Security professional working on multiple areas with multiple certificates like CCNP, CCIP, CCSP, CCSA, CCSE, LPI, PM, IPv6, ..

Month List