This Cisco MPLS Tutorial will guide you through building the simple MPLS topology below. This consists of a 3 router MPLS core and two remote sites in the same VRF running OSPF as the PE=CE routing protocol. This will be quite a long post as I will be taking you through every single verification along the way to ensure you understand how each section works. I will be using GNS3 and building the routers as we go so you can follow along.
Cisco MPLS Tutorial Topology
Step 1 – IP addressing of MPLS Core and OSPF
First bring 3 routers into your topology R1, R2, R3 position them as below. We are going to address the routers and configure ospf to ensure loopback to loopback connectivity between R1 and R3
R1 hostname R1 int lo0 ip add 184.108.40.206 255.255.255.255 ip ospf 1 area 0 int f0/0 ip add 10.0.0.1 255.255.255.0 no shut ip ospf 1 area 0 R2 hostname R2 int lo0 ip add 220.127.116.11 255.255.255.255 ip ospf 1 are 0 int f0/0 ip add 10.0.0.2 255.255.255.0 no shut ip ospf 1 area 0 int f0/1 ip add 10.0.1.2 255.255.255.0 no shut ip ospf 1 area 0 R3 hostname R3 int lo0 ip add 18.104.22.168 255.255.255.0 ip ospf 1 are 0 int f0/0 ip add 10.0.1.3 255.255.255.0 no shut ip ospf 1 area 0
You should now have full ip connectivity between R1, R2, R3 to verify this we need to see if we can ping between the loopbacks of R1 and R3
R1#ping 22.214.171.124 source lo0 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 126.96.36.199, timeout is 2 seconds: Packet sent with a source address of 188.8.131.52 !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 40/52/64 ms R1#
You could show the routing table here, but the fact that you can ping between the loopbacks is verification enough and it is safe to move on.
Step 2 – Configure LDP on all the interfaces in the MPLS Core
In order to run MPLS you need to enable it, there are two ways to do this.
- At each interface enter the mpls ip command
- Under the ospf process use the mpls ldp autoconfig command
For this tutorial we will be using the second option, so go int the ospf process and enter mpls ldp autoconfig – this will enable mpls label distribution protocol on every interface running ospf under that specific process.
R1(config)#router ospf 1 R1(config-router)#mpls ldp autoconfig R2(config)#router ospf 1 R2(config-router)#mpls ldp autoconfig R3(config)#router ospf 1 R3(config-router)#mpls ldp autoconfig
You should see log messages coming up showing the LDP neighbors are up.
R2# *Mar 1 00:31:53.643: %SYS-5-CONFIG_I: Configured from console by console *Mar 1 00:31:54.423: %LDP-5-NBRCHG: LDP Neighbor 184.108.40.206:0 (1) is UP R2# *Mar 1 00:36:09.951: %LDP-5-NBRCHG: LDP Neighbor 220.127.116.11:0 (2) is UP
To verify the mpls interfaces the command is very simple – sh mpls interface
This is done on R2 and you can see that both interfaces are running mpls and using LDP
R2#sh mpls interface Interface IP Tunnel Operational FastEthernet0/0 Yes (ldp) No Yes FastEthernet0/1 Yes (ldp) No Yes
You can also verify the LDP neighbors with the sh mpls ldp neighbors command.
R2#sh mpls ldp neigh Peer LDP Ident: 18.104.22.168:0; Local LDP Ident 22.214.171.124:0 TCP connection: 126.96.36.199.646 - 188.8.131.52.37909 State: Oper; Msgs sent/rcvd: 16/17; Downstream Up time: 00:07:46 LDP discovery sources: FastEthernet0/0, Src IP addr: 10.0.0.1 Addresses bound to peer LDP Ident: 10.0.0.1 184.108.40.206 Peer LDP Ident: 220.127.116.11:0; Local LDP Ident 18.104.22.168:0 TCP connection: 22.214.171.124.22155 - 126.96.36.199.646 State: Oper; Msgs sent/rcvd: 12/11; Downstream Up time: 00:03:30 LDP discovery sources: FastEthernet0/1, Src IP addr: 10.0.1.3 Addresses bound to peer LDP Ident: 10.0.1.3 188.8.131.52
One more verification to confirm LDP is running ok is to do a trace between R1 and R3 and verify if you get MPLS Labels show up in the trace.
R1#trace 184.108.40.206 Type escape sequence to abort. Tracing the route to 220.127.116.11 1 10.0.0.2 [MPLS: Label 17 Exp 0] 84 msec 72 msec 44 msec 2 10.0.1.3 68 msec 60 msec *
As you can see the trace to R2 used an MPLS Label in the path, as this is a very small MPLS core only one label was used as R3 was the final hop.
So to review we have now configured IP addresses on the MPLS core, enabled OSPF and full IP connectivity between all routers and finally enabled mpls on all the interfaces in the core and have established ldp neighbors between all routers.
The next step is to configure MP-BGP between R1 and R3
Step 3 – Configure MP-BGP between R1 and R3
We need to establish a Multi Protocol BGP session between R1 and R3 this is done by configuring the vpnv4 address family as below
R1# router bgp 1 neighbor 18.104.22.168 remote-as 1 neighbor 22.214.171.124 update-source Loopback0 no auto-summary ! address-family vpnv4 neighbor 126.96.36.199 activate R3# router bgp 1 neighbor 188.8.131.52 remote-as 1 neighbor 184.108.40.206 update-source Loopback0 no auto-summary ! address-family vpnv4 neighbor 220.127.116.11 activate *Mar 1 00:45:01.047: %BGP-5-ADJCHANGE: neighbor 18.104.22.168 Up
You should see log messages showing the BGP sessions coming up.
To verify the BGP session between R1 and R3 issue the command sh bgp vpnv4 unicast all summary
R1#sh bgp vpnv4 unicast all summary BGP router identifier 22.214.171.124, local AS number 1 BGP table version is 1, main routing table version 1 Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 126.96.36.199 4 1 218 218 1 0 0 03:17:48 0
You can see here that we do have a bgp vpnv4 peering to R3 – looking at the PfxRcd you can see it says 0 this is because we have not got any routes in BGP. We are now going to add two more routers to the topology. These will be the customer sites connected to R1 and R3. We will then create a VRF on each router and put the interfaces connected to each site router into that VRF.
Step 4 – Add two more routers, create VRFs
We will add two more routers into the topology so it now looks like the final topology