On the PE1 router, you configure RIPv2 with the following commands:
PE1#config t
PE1(config)#router rip
PE1(config-rotuer)#version 2
PE1(config-router)#network 192.168.1.0
On the P1 router, you configure RIPv2 with the following commands:
P1#config t
P1(config)#router rip
P1(config-rotuer)#version 2
P1(config-router)#network 192.168.1.0
On the P2 router, you configure RIPv2 with the following commands:
P2#config t
P2(config)#router rip
P2(config-rotuer)#version 2
P2(config-router)#network 192.168.1.0
On the PE2 router, you configure RIPv2 with the following commands:
PE2#config t
PE2(config)#router rip
PE2(config-rotuer)#version 2
PE2(config-router)#network 192.168.1.0
Now that an IGP is up and running, you need to configure BGP on the PE routers.
On the PE1 router, you configure BGP with the following commands:
PE1#config t
PE1(config)#router bgp 1
PE1(config-router)#no synchronization
PE1(config-router)#network 192.168.1.1 mask 255.255.255.255
PE1(config-router)#neighbor 192.168.1.4 remote-as 1
PE1(config-router)#neighbor 192.168.1.4 update-source Loopback0
PE1(config-router)#no auto summary
PE1(config-router)#redistribute static
On the PE2 router, you configure BGP with the following commands:
PE2#config t
PE2(config)#router bgp 1
PE2(config-router)#no synchronization
PE2(config-router)#network 192.168.1.4 mask 255.255.255.255
PE2(config-router)#neighbor 192.168.1.1 remote-as 1
PE2(config-router)#neighbor 192.168.1.1 update-source Loopback0
PE2(config-router)#no auto summary
PE2(config-router)#redistribute static
Now that all the routing protocols are in place, you need to enable MPLS on the routers.
On the PE1 router, you configure MPLS for Serial 0/0 only with the following commands:
PE1#config t
PE1(config)#ip cef
PE1(config)#mpls ip
PE1(config-if)#interface serial 0/0
PE1(config-if)#mpls ip
On the P1 router, you configure MPLS for both Serial 0/0 and Serial 0/1 with the following commands:
P1#config t
P1(config)#ip cef
P1(config)#mpls ip
P1(config-if)#interface serial 0/0
P1(config-if)#mpls ip
P1(config-if)#exit
P1(config)#interface serial 0/1
P1(config-if)#mpls ip
On the P2 router, you configure MPLS for both Serial 0/0 and Serial 0/1 with the following commands:
P2#config t
P2(config)#ip cef
P2(config)#mpls ip
P2(config-if)#interface serial 0/0
P2(config-if)#mpls ip
P2(config-if)#exit
P2(config)#interface serial 0/1
P2(config-if)#mpls ip
On the PE2 router, you configure MPLS for Serial 0/0 only with the following commands:
PE1#config t
PE1(config)#ip cef
PE1(config)#mpls ip
PE1(config-if)#interface serial 0/0
PE1(config-if)#mpls ip
Since you will be implementing MPLS VPNs, go ahead and set up MPBGP between PE1 and PE2.
On the PE1 router PE1, you configure MP-BGP with the following commands:
PE1#config t
PE1(config)#router bgp 1
PE1(config-router)#address-family vpnv4
PE1(config-router)#neighbor 192.168.1.4 activate
PE1(config-router)#neighbor 192.168.1.4 next-hop-self
PE1(config-router)#neighbor 192.168.1.4 send-community both
On the PE2 router, you configure MP-BGP with the following commands:
PE2#config t
PE2(config)#router bgp 1
PE2(config-router)#address-family vpnv4
PE2(config-router)#neighbor 192.168.1.1 activate
PE2(config-router)#neighbor 192.168.1.1 next-hop-self
PE1(config-router)#neighbor 192.168.1.1 send-community both
Simple VPN Configuration
To set up a simple VPN for Customer X, VRFs need to be configured on PE1 and PE2. You’ll need to create a VRF; let’s call it customer_x. You’ll use a route distinguisher of 1:1 and a route target of 1:1. Here are the commands to accomplish this:
PE1#config t
PE1(config)#ip vrf customer_x
PE1(config-vrf)#rd 1:1
PE1(config-vrf)#route-target both 1:1
The route-target both command is the equivalent of entering the two commands route-target import and route-target export. When you view the configuration with the show running-configuration command,
you’ll see the configuration as route-target import and route-target export. The route-target both command is a shortcut.
To place the Serial 0/1 interface on PE1 into the VRF for Customer X, use the following commands:
PE1#config t
PE1(config)#interface serial 0/1
PE1(config-if)#ip vrf forwarding customer_x
Remember that the IP address on the interface goes away after it is associated with a VRF. You’ll need to configure it with the IP address again, as follows:
PE1(config-if)#ip address 10.2.0.1 mask 255.255.0.0
The configuration of PE2 is pretty much a repeat of the configuration of PE1:
PE2#config t
PE2(config)#ip vrf customer_x
PE2(config-vrf)#rd 1:1
PE2(config-vrf)#route-target both 1:1
PE2(config-vrf)#exit
PE1(config)#interface serial 0/1
PE1(config-if)#ip vrf forwarding customer_x
PE1(config-if)#ip address 10.3.0.1 mask 255.255.0.0
Configuring the PE-CE Routing Protocol
The last thing you need to do is configure a routing protocol between the PE routers and the Customer X routers. Let’s configure RIPv2. The first step is to get the customer routers running RIPv2. Here are the commands for Customer X1:
CustomerX1#config t
CustomerX1(config)#router rip
CustomerX1(config-router)#version 2
CustomerX1(config-router)#network 10.0.0.0
You need to execute the same commands on Customer X2:
CustomerX2#config t
CustomerX2(config)#router rip
CustomerX2(config-router)#version 2
CustomerX2(config-router)#network 10.0.0.0
Now on to the service provider devices. On PE1 and PE2, you need to configure RIPv2 for the VRF and redistribution of BGP routes into RIP. In addition, you need to configure RIP routes to be redistributed into BGP. The following commands accomplish this configuration:
PE1#config t
PE1(config)#router rip
PE1(config)#version 2
PE1(config-router)#address-family ipv4 vrf customer_x
PE1(config-router-af)#redistribute bpg 1 metric transparent
PE1(config-router-af)#exit
PE1(config-router)#exit
PE1(config)#router bgp 1
PE1(config-router)#address-family ipv4 vrf customer_x
PE1(config-router-af)#redistribute rip
The same commands can be used to accomplish the configuration on PE2:
PE2#config t
PE2(config)#router rip
PE2(config)#version 2
PE2(config-router)#address-family ipv4 vrf customer_x
PE2(config-router-af)#redistribute bpg 1 metric transparent
PE2(config-router-af)#exit
PE2(config-router)#exit
PE2(config)#router bgp 1
PE2(config-router)#address-family ipv4 vrf customer_x
PE2(config-router-af)#redistribute rip