Multi Protocol Label Switching (MPLS) VPN

December 30th, 2008 by Daniel Herman Leave a reply »

Challenge Lab #1 – MPLS VPN

.

Overview:

.

A customer at XYZ corporation has just asked you, an engineer at HyperGlobalMegaCorp Regional ISP, to set him up a tunneled VPN connection between two of their sites. The problem is that somehow both XYZ and ABC corporations use the same exact IP addressing scheme, so they need to somehow accommodate that. You’ve been tasked with researching and implementing MPLS VPNs and VRF in order to accommodate both their security and IP addressing needs.

.

Technologies:

.

VRF:

Virtual Routing and Forwarding is a virtualization technology that is used to segment one physical router into two or more logical routers. This is very similar to running software such as VMWare or Microsoft Virtual PC, but on a router. The routing and IP tables contained in each of these logical routers do not communicate with other logical routers. This means that a router can route the same IP address space in completely different ways; this is useful with RFC1918 for example. In order to accomplish this, VRF uses a Route Distinguisher that is configured by the administrator. This will allow for similar routes to become unique. This will become clearer as you progress through the lab. You may also set route-target exports/imports which will send or receive information with the specified BGP extended community. This will come into play when we set up BGP for communication. You may have multiple import and export rules.

.

MPLS:

MPLS, or Multi Protocol Label Switching, is a recent type of transport technology that is eventually intended to replace both ATM and Frame Relay due to it’s enhanced capabilities for simplicity, efficiency, and to still be able to handle the Quality of Service (QoS) need of companies in order to keep time and bandwidth sensitive applications running properly. By applying a label to each route and pre-generating where each label is sent to, speed and efficiency is greatly increased. These labels can either be statically defined or dynamically generated.

.

Tasks:

.

Feel free to skip around. It may be logically easier for you to configure BGP after everything else is set up for example.

.

**You may need to create VLANs or trunks depending on your physical connections in order to create this logical topology.**

.

R1

  • Enable Cisco Express Forwarding. This is required for MPLS to function because the MPLS tags are actually based on the information in the CEF FIB Table, not the routing table itself.
  • Configure VRF ABC. Utilize a route distinguisher of 100:1. Configure a route target import of 100:1, and a route target export of 100:4. These values are arbitrary, but it makes sense to give them a context. Company 100, router 4 for example.
  • Configure VRF XYZ. Utilize a route distinguisher of 200:1. Configure a route target import of 200:1, and a route target export of 200:4.
  • Configure all of the interfaces. Be sure to enable MPLS on F0/0, and put Lo0 and Lo1 in their corresponding VRFs.
  • Enable OSPF Area 0 on Lo2 and F0/0. These two interfaces are part of the Provider network, so we need to run an IGP to have internal connectivity.
  • Configure BGP AS 1. Disable normal BGP IPv4 unicast connectivity. Create a neighbor relationship with R4 utilizing the 4.4.4.4 address, and be sure to source the updates from Lo2. Enter the configuration mode for the VPNv4 address family. Activate the 4.4.4.4 neighbor, and also send the extended community information to it. Enter the configuration mode for the IPv4 VRF XYZ. Disable synchronization, and redistribute the connected interfaces. This will only enter Lo0 into BGP since it is the only interface configured for VRF XYZ. Repeat these steps for VRF ABC.
.

R2/R3

  • Enable Cisco Express Forwarding. This is required for MPLS to function.
  • Configure the two FastEthernet Interfaces, and enable MPLS on them.
  • Enable OSPF Area 0 on both interfaces.
.

R4

  • Enable Cisco Express Forwarding. This is required for MPLS to function.
  • Configure VRF ABC. Utilize a route distinguisher of 100:1. Configure a route target import of 100:4, and a route target export of 100:1.
  • Configure VRF XYZ. Utilize a route distinguisher of 200:1. Configure a route target import of 200:4, and a route target export of 200:1.
  • Configure all of the interfaces. Be sure to enable MPLS on F0/0, and put Lo0 and Lo1 in their corresponding VRFs.
  • Enable OSPF Area 0 on Lo2 and F0/0. These two interfaces are part of the Provider network, so we need to run an IGP to have internal connectivity.
  • Configure BGP AS 1. Disable normal BGP IPv4 unicast connectivity. Create a neighbor relationship with R1 utilizing the 1.1.1.1 address, and be sure to source the updates from Lo2. Enter the configuration mode for the VPNv4 address family. Activate the 1.1.1.1 neighbor, and also send the extended community information to it. Enter the configuration mode for the IPv4 VRF XYZ. Disable synchronization, and redistribute the connected interfaces. This will only enter Lo0 into BGP since it is the only interface configured for VRF XYZ. Repeat these steps for VRF ABC.10
.

Logical Topology

.

MPLS VPN Lab Logical Topology

.
.

Walkthrough

.

R1

.

One of the prerequisites for MPLS to be able to function is to have CEF (Cisco Express Forwarding) enabled on the router, so we will do this before taking any further steps. This is because CEF provides the fast performance of fast switching caches and yet provides resilience because it relies on information pulled directly from the IP Routing tables via the CEF FIB, rather than cached information.

.

1
R1(config)#ip cef

.

Now, let’s create a new VRF for one of our companies, ABC. We’ll call the VRF “ABC” to keep it simple.

.

1
R1(config)#ip vrf ABC

.

Now we’ll define the route distinguisher which is what is prepended to the 32bit IPv4 addresses of the VRF to create truly unique addresses, even when the same RFC1918 addresses are in use on other VRFs.

.

1
R1(config-vrf)# rd 100:1

.

Let’s define the extended import and export communities that we will be using with BGP. Although not shown in this example, this would be used if we wanted to attach other information to the traffic such as QoS or different local preferences. Again we are defining this for ABC which we assigned as company 200, and we are defining that we want to import the community designated for R1, and export the community designated for R4.

.

1
R1(config-vrf)#route-target import 100:1
2
R1(config-vrf)#route-target export 100:4

.

Now let’s repeat these steps again to create the VRF for company XYZ

.

1
R1(config)#ip vrf XYZ
2
R1(config-vrf)#rd 200:1
3
R1(config-vrf)#route-target import 200:1
4
R1(config-vrf)#route-target export 200:4

.

Let’s configure the interfaces that are part of the provider network now. Both Loopback2 and FastEthernet0/0 are a part of this, so each will be added to OSPF Area 0. We will also define the router-id for R1 as 1.1.1.1.

.

1
R1(config)#interface Loopback2
2
R1(config-if)#ip ospf 1 area 0
3
R1(config)#interface FastEthernet0/0
4
R1(config-if)#ip ospf 1 area 0
5
R1(config)#router ospf 1
6
R1(config-router)#router-id 1.1.1.1

.

Now we will enable MPLS connectivity on FastEthernet0/0 which is where we want the MPLS connectivity to begin.

.

1
R1(config)#interface FastEthernet0/0
2
R1(config-if)#mpls ip

.

Now that we have the provider interfaces configured, we need to set up the two Loopback interfaces that will represent our customers. Lets start with customer ABC which will utilize Loopback0.

.

1
R1(config)#interface Loopback0

.

Notice that we have to define the VRF before applying an IP address. If we define an IP address before the VRF, then it will be deleted when the VRF is applied.

.

1
R1(config-if)#ip vrf forwarding ABC
2
R1(config-if)#ip address 192.168.10.1 255.255.255.0

.

Now we will repeat these steps for company XYZ. We are allowed to have duplicate IP addresses because the two “companies” utilize different VRFs.

.

1
R1(config)#interface Loopback1
2
R1(config-if)#ip vrf forwarding XYZ
3
R1(config-if)#ip address 192.168.10.1 255.255.255.0

.

Our VRFs are all completely set up now. Let’s configure our BGP instance so that we will be able to pass routing information between the edge routers for our customers. We will utilize BGP AS 1.

.

1
R1(config)#router bgp 1

.

The first thing we will do is disable normal BGP IPv4 unicast connectivity. We aren’t going to configure it for normal connectivity, and we don’t even want this type of traffic to flow between the routers, so it is best to explicitly disable it.

.

1
R1(config-router)#no bgp default ipv4-unicast

.

We are going to be peering with R4 using it’s Loopback2 address of 4.4.4.4 in AS 1

.

1
R1(config-router)#neighbor 4.4.4.4 remote-as 1

.

We are also going to define that our updates will be sourced from our own Loopback2. This will make it so that the next hop is defined as our Loopback2, rather than the physical interface that the packet is actually sent out.

.

1
R1(config-router)#neighbor 4.4.4.4 update-source Loopback2

.

Now, we are going to define the VPNv4 family, which is what will facilitate communication internally in our MPLS VPNs.

.

1
R1(config-router)#address-family vpnv4

.

Let’s enable the exchange of information for the neighbor adjacency for this address-family and send our configured communities to them.

.

1
R1(config-router-af)#neighbor 4.4.4.4 activate
2
R1(config-router-af)#neighbor 4.4.4.4 send-community both

.

Finally, let’s configure what we want to send to our neighbor routers in each VRF. Let’s start with VRF ABC.

.

1
R1(config-router)#address-family ipv4 vrf ABC

.

We will disable synchronization so that the routes we are advertising in our iBGP setup don’t need to be in an IGP routing table to be exchanged

.

1
R1(config-router-af)#no synchronization

.

Now we will redistribute our connected interfaces. We can either do this or define a network statement, either will have the same effect in this example. When we redistribute connected interfaces, it will only affect Lo0 since it is the only interface in VRF ABC.

.

1
R1(config-router-af)#redistributed connected

.

Now let’s repeat these steps for VRF XYZ.

.

1
R1(config-router)#address-family ipv4 vrf XYZ
2
R1(config-router-af)#no synchronization
3
R1(config-router-af)#redistribute connected

.

And we’re done on R1!

.
.

R2

.

R2 is simply an internal router of the ISP, so it does not need to have any knowledge of the customer’s networks or BGP. All it needs to do is help provide end to end IP and MPLS connectivity.

.

As before, we need to first enable CEF as a prerequisite to running MPLS.

.

1
R2(config)#ip cef

.

Let’s put both FastEthernet interfaces into OSPF Area 0 and enable MPLS on both interfaces

.

1
R2(config)#interface FastEthernet0/0
2
R2(config-if)#ip ospf 1 area 0
3
R2(config-if)#mpls ip
4
R2(config)#interface FastEthernet0/1
5
R2(config-if)#ip ospf 1 area 0
6
R2(config-if)#mpls ip

.

Finally, let’s define the router id for R2 as 2.2.2.2

.

1
R2(config)#router ospf 1
2
R2(config-router)#router-id 2.2.2.2

.

That’s it for R2!

.
.


R3

.

R3 is simply an internal router of the ISP, so it does not need to have any knowledge of the customer’s networks or BGP. All it needs to do is help provide end to end IP and MPLS connectivity.

.

As before, we need to first enable CEF as a prerequisite to running MPLS.

.

1
R3(config)#ip cef

.

Let’s put both FastEthernet interfaces into OSPF Area 0 and enable MPLS on both interfaces

.

1
R3(config)#interface FastEthernet0/0
2
R3(config-if)#ip ospf 1 area 0
3
R3(config-if)#mpls ip
4
R3(config)#interface FastEthernet0/1
5
R3(config-if)#ip ospf 1 area 0
6
R3(config-if)#mpls ip
7

.

Finally, let’s define the router id for R3 as 3.3.3.3

.

1
R3(config)#router ospf 1
2
R3(config-router)#router-id 3.3.3.3

.

That’s it for R3!

.
.

R4

.

First, we have to again enable CEF on the router before enabling MPLS.

.

1
R4(config)#ip cef

.

Now, let’s create a new VRF for company ABC.

.

1
R4(config)#ip vrf ABC

.

Now we’ll define the route distinguisher used for ABC, just as we did on R1.

.

1
R4(config-vrf)# rd 200:1

.

Let’s define the extended import and export communities that we will be using with BGP. Notice that this time we are reversing what we are importing and exporting. This is so that we import the information targeted for R4, and export information for R1.

.

1
R4(config-vrf)#route-target import 100:4
2
R4(config-vrf)#route-target export 100:1

.

Now let’s repeat these steps again to create the VRF for company XYZ

.

1
R4(config)#ip vrf XYZ
2
R4(config-vrf)#rd 200:1
3
R4(config-vrf)#route-target import 200:4
4
R4(config-vrf)#route-target export 200:1

.

Let’s configure the interfaces that are part of the provider network now. Both Loopback2 and FastEthernet0/0 are a part of this, so each will be added to OSPF Area 0. We will also define the router-id for R4 as 4.4.4.4

.

1
R4(config)#interface Loopback2
2
R4(config-if)#ip ospf 1 area 0
3
R4(config)#interface FastEthernet0/0
4
R4(config-if)#ip ospf 1 area 0
5
R4(config)#router ospf 1
6
R4(config-router)#router-id 4.4.4.4

.

Now we will enable MPLS connectivity on FastEthernet0/0 which is where we want the MPLS connectivity to begin.

.

1
R4(config)#interface FastEthernet0/0
2
R4(config-if)#mpls ip

.

Now that we have the provider interfaces configured, we need to set up the two Loopback interfaces that will represent our customers. Lets start with customer ABC which will utilize Loopback0.

.

1
R4(config)#interface Loopback0

.

Notice that we have to define the VRF before applying an IP address. If we define an IP address before the VRF, then it will be deleted when the VRF is applied.

.

1
R4(config-if)#ip vrf forwarding ABC
2
R4(config-if)#ip address 192.168.10.1 255.255.255.0

.

Now we will repeat these steps for company XYZ. We are allowed to have duplicate IP addresses because the two “companies” utilize different VRFs.

.

1
R4(config)#interface Loopback1
2
R4(config-if)#ip vrf forwarding XYZ
3
R4(config-if)#ip address 192.168.10.1 255.255.255.0

.

Our VRFs are all completely set up now. Let’s configure our BGP instance so that we will be able to pass routing information between the edge routers for our customers. We will utilize BGP AS 1.

.

1
R4(config)#router bgp 1

.

The first thing we will do is disable normal BGP IPv4 unicast connectivity. We aren’t going to configure it for normal connectivity, and we don’t even want this type of traffic to flow between the routers, so it is best to explicitly disable it.

.

1
R4(config-router)#no bgp default ipv4-unicast

.

We are going to be peering with R1 using it’s Loopback2 address of 1.1.1.1 in AS 1

.

1
R4(config-router)#neighbor 1.1.1.1 remote-as 1

.

We are also going to define that our updates will be sourced from our own Loopback2. This will make it so that the next hop is defined as our Loopback2, rather than the physical interface that the packet is actually sent out.

.

1
R4(config-router)#neighbor 1.1.1.1 update-source Loopback2

.

Now, we are going to define the VPNv4 family, which is what will facilitate communication internally in our MPLS VPNs.

.

1
R4(config-router)#address-family vpnv4

.

Let’s enable the exchange of information for the neighbor adjacency for this address-family and send our configured communities to them.

.

1
R4(config-router-af)#neighbor 1.1.1.1 activate
2
R4(config-router-af)#neighbor 1.1.1.1 send-community both

.

Finally, let’s configure what we want to send to our neighbor routers in each VRF. Let’s star with VRF ABC.

.

1
R4(config-router)#address-family ipv4 vrf ABC

.

We will disable synchronization so that the routes we are advertising in our iBGP setup don’t need to be in an IGP routing table to be exchanged

.

1
R4(config-router-af)#no synchronization

.

Now we will redistribute our connected interfaces. We can either do this or define a network statement, either will have the same effect in this example. When we redistribute connected interfaces, it will only affect Lo0 since it is the only interface in VRF ABC.

.

1
R4(config-router-af)#redistributed connected

.

Now let’s repeat these steps for VRF XYZ.

.

1
R4(config-router)#address-family ipv4 vrf XYZ
2
R4(config-router-af)#no synchronization
3
R4(config-router-af)#redistribute connected

.

And that’s it!

.
.

Testing and Debug Commands

.

show ip route vrf

Show the routing table for a specific VRF

.

Example:

01
R4#show ip route vrf XYZ
02
Routing Table: XYZ
03
(Notice how it is displaying only the routing table for VRF XYZ)
04
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
05
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
06
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
07
E1 - OSPF external type 1, E2 - OSPF external type 2
08
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
09
ia - IS-IS inter area, * - candidate default, U - per-user static route
10
o - ODR, P - periodic downloaded static route
11
 
12
Gateway of last resort is not set
13
 
14
B 192.168.10.0/24 [200/0] via 1.1.1.1, 00:00:23
15
C 192.168.1.0/24 is directly connected, Loopback1

.
.

ping vrf

Ping an IP address in a specific VRF

.

Example:

1
R4#ping vrf ABC 192.168.10.1
2
 
3
Type escape sequence to abort.
4
Sending 5, 100-byte ICMP Echos to 192.168.10.1, timeout is 2 seconds:
5
!!!!!
6
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/4 ms

.
.

show mpls forwarding-table

Show the MPLS forwarding table. See the different types of tags and the labels. Be sure to note how when the packet reaches the directly connected interface, the final label is popped off.

.

Example:

1
R4#show mpls forwarding-table
2
Local Outgoing Prefix Bytes tag Outgoing Next Hop
3
tag tag or VC or Tunnel Id switched interface
4
16 Aggregate 192.168.1.0/24[V] 1560
5
17 Aggregate 192.168.1.0/24[V] 1248
6
(Even though the two VRF networks are the “same”, they are assigned different tags!)
7
18 Pop tag 10.0.0.4/30 0 Fa0/0 10.0.0.9
8
19 17 1.1.1.1/32 0 Fa0/0 10.0.0.9
9
20 18 10.0.0.0/30 0 Fa0/0 10.0.0.9
.
.

show mpls ldp bindings

Show the LDP bindings for each of the known addresses

.

Example:

01
R4#show mpls ldp bindings
02
tib entry: 1.1.1.1/32, rev 8
03
local binding: tag: 19
04
remote binding: tsr: 10.0.0.2:0, tag: 16
05
remote binding: tsr: 10.0.0.9:0, tag: 17
06
remote binding: tsr: 1.1.1.1:0, tag: imp-null
07
tib entry: 4.4.4.4/32, rev 2
08
local binding: tag: imp-null
09
remote binding: tsr: 10.0.0.9:0, tag: 16
10
remote binding: tsr: 10.0.0.2:0, tag: 17
11
remote binding: tsr: 1.1.1.1:0, tag: 20
12
tib entry: 10.0.0.0/30, rev 10
13
local binding: tag: 20
14
remote binding: tsr: 10.0.0.2:0, tag: imp-null
15
remote binding: tsr: 10.0.0.9:0, tag: 18
16
remote binding: tsr: 1.1.1.1:0, tag: imp-null
17
tib entry: 10.0.0.4/30, rev 6
18
local binding: tag: 18
19
remote binding: tsr: 10.0.0.9:0, tag: imp-null
20
remote binding: tsr: 10.0.0.2:0, tag: imp-null
21
remote binding: tsr: 1.1.1.1:0, tag: 16
22
tib entry: 10.0.0.8/30, rev 4
23
local binding: tag: imp-null
24
remote binding: tsr: 10.0.0.9:0, tag: imp-null
25
remote binding: tsr: 10.0.0.2:0, tag: 18
26
remote binding: tsr: 1.1.1.1:0, tag: 21

.
.

show mpls ldp neighbor

Show the LDP neighbors

.

Example:

01
R4#show mpls ldp neighbor
02
Peer LDP Ident: 10.0.0.9:0; Local LDP Ident 4.4.4.4:0
03
TCP connection: 10.0.0.9.14725 - 4.4.4.4.646
04
State: Oper; Msgs sent/rcvd: 36/37; Downstream
05
Up time: 00:25:14
06
LDP discovery sources:
07
FastEthernet0/0, Src IP addr: 10.0.0.9
08
FastEthernet0/0, Src IP addr: 10.0.0.6
09
Addresses bound to peer LDP Ident:
10
10.0.0.9 10.0.0.6
11
Peer LDP Ident: 10.0.0.2:0; Local LDP Ident 4.4.4.4:0
12
TCP connection: 10.0.0.2.38070 - 4.4.4.4.646
13
State: Oper; Msgs sent/rcvd: 32/31; Downstream
14
Up time: 00:20:32
15
LDP discovery sources:
16
FastEthernet0/0, Src IP addr: 10.0.0.5
17
FastEthernet0/0, Src IP addr: 10.0.0.2
18
Addresses bound to peer LDP Ident:
19
10.0.0.2 10.0.0.5
20
Peer LDP Ident: 1.1.1.1:0; Local LDP Ident 4.4.4.4:0
21
TCP connection: 1.1.1.1.646 - 4.4.4.4.59004
22
State: Oper; Msgs sent/rcvd: 30/31; Downstream
23
Up time: 00:20:28
24
LDP discovery sources:
25
FastEthernet0/0, Src IP addr: 10.0.0.1
26
Addresses bound to peer LDP Ident:
27
10.0.0.1 1.1.1.1
.
.

debug mpls packets

Enable debugging of MPLS packets. Enable this on either R2 or R3, then ping from one end of a company to the other. See how it recognizes the labels are received and how it resends it back out. If it is destined for a directly connected interface, the last label is popped off and you will see an xmit: (no label)

.

Example:

01
R4#debug mpls packets
02
*Apr 17 19:54:43.643: MPLS: Fa0/0: recvd: CoS=6, TTL=255, Label(s)=18
03
*Apr 17 19:54:43.643: MPLS: Fa0/1: xmit: (no label)
04
 
05
(This was generated by an ICMP echo from R1. Notice how the incoming Label is 18 
06
which we know is the “pop” label. It is then sent out the other interface with no label 
07
at all to its final destination!)
08
 
09
*Apr 17 19:54:43.843: MPLS: Fa0/1: recvd: CoS=6, TTL=255, Label(s)=16
10
*Apr 17 19:54:43.843: MPLS: Fa0/0: xmit: (no label)
11
*Apr 17 19:54:44.999: MPLS: Fa0/1: recvd: CoS=6, TTL=255, Label(s)=16
12
*Apr 17 19:54:44.999: MPLS: Fa0/0: xmit: (no label)
13
*Apr 17 19:54:44.999: MPLS: Fa0/0: recvd: CoS=6, TTL=255, Label(s)=18
14
*Apr 17 19:54:44.999: MPLS: Fa0/1: xmit: (no label)/0: xmit: CoS=0, TTL=253, Label(s)=18
15
*Apr 17 20:04:06.223: MPLS: Fa0/0: recvd: CoS=0, TTL=255, Label(s)=17/16
16
*Apr 17 20:04:06.223: MPLS: Fa0/1: xmit: CoS=0, TTL=254, Label(s)=16/16

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

Solutions

.
.

R1

.

01
hostname R1
02
!
03
ip cef
04
!
05
ip vrf ABC
06
rd 100:1
07
route-target export 100:4
08
route-target import 100:1
09
!
10
ip vrf XYZ
11
rd 200:1
12
route-target export 200:4
13
route-target import 200:1
14
!
15
interface Loopback0
16
ip vrf forwarding ABC
17
ip address 192.168.10.1 255.255.255.0
18
!
19
interface Loopback1
20
ip vrf forwarding XYZ
21
ip address 192.168.10.1 255.255.255.0
22
!
23
interface Loopback2
24
ip address 1.1.1.1 255.255.255.255
25
ip ospf 1 area 0
26
!
27
interface FastEthernet0/0
28
ip address 10.0.0.1 255.255.255.252
29
ip ospf 1 area 0
30
duplex auto
31
speed auto
32
mpls ip
33
!
34
router ospf 1
35
router-id 1.1.1.1
36
log-adjacency-changes
37
!
38
router bgp 1
39
no bgp default ipv4-unicast
40
bgp log-neighbor-changes
41
neighbor 4.4.4.4 remote-as 1
42
neighbor 4.4.4.4 update-source Loopback2
43
!
44
address-family vpnv4
45
neighbor 4.4.4.4 activate
46
neighbor 4.4.4.4 send-community both
47
exit-address-family
48
!
49
address-family ipv4 vrf XYZ
50
redistribute connected
51
no synchronization
52
exit-address-family
53
!
54
address-family ipv4 vrf ABC
55
redistribute connected
56
no synchronization
57
exit-address-family
58
!
59
end

.
.

R2

.

01
hostname R2
02
!
03
ip cef
04
!
05
interface FastEthernet0/0
06
ip address 10.0.0.2 255.255.255.252
07
ip ospf 1 area 0
08
duplex auto
09
speed auto
10
mpls ip
11
!
12
interface FastEthernet0/1
13
ip address 10.0.0.5 255.255.255.252
14
ip ospf 1 area 0
15
duplex auto
16
speed auto
17
mpls ip
18
!
19
router ospf 1
20
router-id 2.2.2.2
21
log-adjacency-changes
22
!
23
end

.
.

R3

.

01
hostname R3
02
!
03
ip cef
04
!
05
interface FastEthernet0/0
06
ip address 10.0.0.9 255.255.255.252
07
ip ospf 1 area 0
08
duplex auto
09
speed auto
10
mpls ip
11
!
12
interface FastEthernet0/1
13
ip address 10.0.0.6 255.255.255.252
14
ip ospf 1 area 0
15
duplex auto
16
speed auto
17
mpls ip
18
!
19
router ospf 1
20
router-id 3.3.3.3
21
log-adjacency-changes
22
!
23
end

.
.

R4

.

01
hostname R4
02
!
03
ip cef
04
!
05
ip vrf ABC
06
rd 100:1
07
route-target export 100:1
08
route-target import 100:4
09
!
10
ip vrf XYZ
11
rd 200:1
12
route-target export 200:1
13
route-target import 200:4
14
!
15
interface Loopback0
16
ip vrf forwarding ABC
17
ip address 192.168.1.1 255.255.255.0
18
!
19
interface Loopback1
20
ip vrf forwarding XYZ
21
ip address 192.168.1.1 255.255.255.0
22
!
23
interface Loopback2
24
ip address 4.4.4.4 255.255.255.255
25
ip ospf 1 area 0
26
!
27
interface FastEthernet0/0
28
ip address 10.0.0.10 255.255.255.252
29
ip ospf 1 area 0
30
duplex auto
31
speed auto
32
mpls ip
33
!
34
router ospf 1
35
router-id 4.4.4.4
36
log-adjacency-changes
37
!
38
router bgp 1
39
no bgp default ipv4-unicast
40
bgp log-neighbor-changes
41
neighbor 1.1.1.1 remote-as 1
42
neighbor 1.1.1.1 update-source Loopback2
43
!
44
address-family vpnv4
45
neighbor 1.1.1.1 activate
46
neighbor 1.1.1.1 send-community extended
47
exit-address-family
48
!
49
address-family ipv4 vrf XYZ
50
redistribute connected
51
no synchronization
52
exit-address-family
53
!
54
address-family ipv4 vrf ABC
55
redistribute connected
56
no synchronization
57
exit-address-family
58
!
59
end

Advertisement

Leave a Reply