MPLS Lab 01
MPLS Lab 01
MPLS Lab 01
MPLS Layer 3 Virtual Private Networks
Topology:
Task 01:
Assign IPv4 addresses to all interfaces in the SP network (Every inter-node connection prefix
length should be /24 and IP addressing scheme should be 10.Y.X.R/24 where Y stands for
highest R#, X stands for lowest R# and R stands for R#, for example the IP address of R88’s
interface between R88 and R11 should have IP address of 10.88.11.88/24) and also all SP
routers should have a Lo0 interface with this scheme : 10.255.255.R/32 where R stands for
router number, for example R99’s Lo0 interface should have IPv4 address of
10.255.255.99/32.
Create an IS-IS Process
IS-IS NET scheme: 49.0000.0000.0000.00RN.00 (RN stands for router number)
Configure the routers to only form Level-2 adjacency
Advertise Lo0 interfaces in the IS-IS
Configure adjacency logging for IS-IS
Enable IS-IS 10000 on all SP router interfaces
Solution:
You don’t need to follow the exact procedure of tasks, just need to complete the task in any
order you like! For example I first create IS-IS process:
SP-P-R88:
router isis
net 49.0000.0000.0000.0088.00
is-type level-2-only
log-adjacency-changes all
passive-interface Loopback0
Take a look at the NET command, you remember Router-ID in OSPF? It is the equivalent to
OSPF Router-ID in IS-IS, not exactly but just think that way! There is 49.0000 in the beginning,
it is the Area-ID, in this Lab we are going to use only a Single area IS-IS, then we configure
49.0000 for all routers NET.
Next we have System ID, every router in the domain should have a unique System ID, for SP-P-
R88 router it is set to 0000.0000.0088.
Let NSEL to be 00 on all routers.
Next we should configure all routers to form only L2 Adjacency, if we don’t configure this
command all routers form L1 as well as L2 adjacency, and the task only wants us to configure
only single area L2 adjacency. we can configure this adjacency type per interface, but in this
case this is easier to configure L2-Adjancency only under IS-IS process.
By default IS-IS does not generate any syslog messages for Adjacency changes on Cisco routers
(unlike OSPF), in order to enable logging for IS-IS we must put log-adjacency-changes all
command under IS-IS process to get detailed logs.
The task asks us to also advertise Lo0 interfaces in IS-IS domain. IS-IS’s behavior differs from
OSPF, by making an interface passive in IS-IS, that interface is also being advertised in the IS-IS
domain.
Let’s configure other routers as well:
SP-P-R99:
router isis
net 49.0000.0000.0000.0099.00
is-type level-2-only
log-adjacency-changes all
passive-interface Loopback0
SP-PE-R11:
router isis
net 49.0000.0000.0000.0011.00
is-type level-2-only
log-adjacency-changes all
passive-interface Loopback0
SP-PE-R22:
router isis
net 49.0000.0000.0000.0022.00
is-type level-2-only
log-adjacency-changes all
passive-interface Loopback0
SP-PE-R33:
router isis
net 49.0000.0000.0000.0033.00
is-type level-2-only
log-adjacency-changes all
passive-interface Loopback0
SP-PE-R44:
router isis
net 49.0000.0000.0000.0044.00
is-type level-2-only
log-adjacency-changes all
passive-interface Loopback0
!
Now we need to configure IPv4 addresses on SP router’s interfaces and also make the IS-IS
network type point-to-point then enable IS-IS on those interfaces.
SP-P-R88:
interface Loopback0
interface Ethernet0/0
bandwidth 10000000
ip router isis
interface Ethernet0/1
bandwidth 10000000
ip router isis
interface Ethernet0/2
bandwidth 10000000
ip router isis
interface Ethernet0/3
bandwidth 10000000
ip router isis
interface Ethernet1/0
bandwidth 10000000
ip router isis
we issued the bandwidth 10000000 (10 Gb/s) command to just pretend that these links are 10
Gb/s links in SP core, because this IOS does not support any 10 Mb/s+ links. this command
does not affect router’s interfaces speed, only it is used for QoS topics, Traffic Engineering,
IGP’s metric calculations and also affects EIGRP Bandwidth-limitation, so be careful using this
explicit bandwidth command!
By entering ip router isis command, that interface would become part of IS-IS process and
actively looks at neighboring routers to form adjacency and also that the network would be
advertised in the IS-IS routing domain.
IS-IS is an L2 protocol, it has its own L2 Protocol and also uses DSAP/SSAP LLC fields, unlike
OSPF and EIGRP it does not use L3 protocol. We have captured some traffics using WireShark,
Take a look at below capture:
SP-P-R99:
interface Loopback0
interface Ethernet0/0
bandwidth 10000000
ip router isis
interface Ethernet0/1
bandwidth 10000000
ip router isis
interface Ethernet0/2
bandwidth 10000000
ip router isis
interface Ethernet0/3
bandwidth 10000000
ip router isis
interface Ethernet1/0
bandwidth 10000000
ip router isis
SP-PE-R11:
interface Loopback0
interface Ethernet0/1
bandwidth 10000000
ip router isis
interface Ethernet0/3
bandwidth 10000000
ip router isis
SP-PE-R22:
interface Loopback0
interface Ethernet0/1
bandwidth 10000000
ip router isis
interface Ethernet0/3
bandwidth 10000000
ip router isis
SP-PE-R33:
interface Loopback0
interface Ethernet0/2
bandwidth 10000000
ip router isis
interface Ethernet1/0
bandwidth 10000000
ip router isis
SP-PE-R44:
interface Loopback0
interface Ethernet0/2
bandwidth 10000000
ip router isis
interface Ethernet1/0
bandwidth 10000000
ip router isis
Task 02:
Define MPLS label range for every router, so we can track packets LSPs easily in this lab,
you don’t have to always do that, we just do it for some purposes you will see that!
Configure static router-id for LDP on every router and force it to use Lo0 interface as
LDP Router-ID.
Enable MPLS LDP session protection.
Enable MPLS and LDP on all IS-IS enabled interfaces by using IS-IS Auto-Config
mechanism.
Enable MPLS LDP IGP Synchronization on all IS-IS enabled interfaces by using a single
command.
Configure IS-IS in order to only advertise host routes (/32 Networks of Lo0 interfaces)
Solution:
SP-P-R88:
router isis
advertise passive-only
MPLS LDP session protection feature provides faster LDP convergence when a link recovers
following an outage. It helps routers to maintain LDP distributed Labels for a while till
neighbor comes up again, so after the neighbor becomes alive no need to label generation and
distribution between those neighbors for the same prefixes.
The task asked that we should configure Lo0 interface of every router as being used as LDP
Router-ID. Two neighbors form LDP session using TCP port number 646 and also UDP port
646 to discover and track the state of neighbor using a hello mechanism, as you already know
we need a source IP address and also a destination IP address to form a TCP session, Cisco
router uses Router-ID as the source for LDP packets/datagrams, if we don’t configure any
explicit Router-ID for LDP, the IOS is going to use the highest non-shutdown Lo0 interface IP
address as the source of its packets. It’s a best practice to make this happen in a predictable
way, maybe router chooses a Loopback address as a source for LDP sessions that we have not
advertised in IS-IS session. So we configure an explicit Router-id for all routers using mpls ldp
router-id lo0 command.
The task asked that we should configure Lo0 interface of every router as being used as LDP
Router-ID. Two neighbors form LDP session using TCP port number 646 and also UDP port
646 to discover and track the state of neighbor using a hello mechanism, as you already know
we need a source IP address and also a destination IP address to form a TCP session, Cisco
router uses Router-ID as the source for LDP packets/datagrams, if we don’t configure any
explicit Router-ID for LDP, the IOS is going to use the highest non-shutdown Lo0 interface IP
address as the source of its packets. It’s a best practice to make this happen in a predictable
way, maybe router chooses a Loopback address as a source for LDP sessions that we have not
advertised in IS-IS session. So we configure an explicit Router-id for all routers using mpls ldp
router-id lo0 command.
By entering mpls ldp sync command under router isis process, MPLS LDP IGP Synchronization
would be enabled on every IS-IS enabled interfaces (Physical interfaces), it prevents black
holing issue.
When IGP is established between two routers, the router begins forwarding packets based on
IGP learned routes (RIB/FIB) even before LDP Label exchange completes between the peers.
Then the packets will be exchanged unlabeled then those packets will be black-holed because
of label absence. The second problem is, if an LDP session closes, the device continues to
forward traffic using the link associated with the LDP peer rather than an alternate pathway
with a fully synchronized LDP session.
IGP LDP Sync feature prevents this packet loss. You will see in Segment-Routing, we don’t face
those kind of problems because we don’t have to have a separate protocol like LDP, in SR,
Index (let’s say label) is also carried by IGP itself.
The task also asked us to enable MPLS on every physical interface. In order to do that we have
two choices, the first one is to enable MPLS forwarding on each interface by using mpls ip
interface-level command, the second and convenient one is to issue mpls ldp autoconfig
command under IS-IS process. By using the second option MPLS forwarding is going to be
enabled on each interface that we have enabled IS-IS on.
Task also asks us to advertise only /32 host routes. In MPLS we care only about reachability
between two hosts not reachability of physical interfaces of those hosts! As far as one host is
able to reach the other host’s Lo0 address using it’s Lo0 address we are happy! Because we will
use BGP with different Address-Families or sometimes LDP in order to make MPLS beneficial.
No one would want to form an iBGP session based on Physical interfaces, when we have
Loopbacks that are always up because those are not physical interfaces, as long as we can
reach Loopback interfaces somehow the iBGP sessions will be up. You will realize why when
we do next tasks and all other MPLS Labs of the workbook.
MPLS LAB 01 (L3VPNS) 10
ORHAN ERGUN LLC CCIE SP WORKBOOK
The command advertise passive-only under router isis process suppresses the advertisement
of other interface prefixes other than passive ones. You remember the previous task was
asking us to make Loopback0 interfaces passive. You can achieve the same result in OSPF by
using prefix-suppression command.
Let’s configure other routers as well:
SP-P-R99:
router isis
advertise passive-only
SP-PE-R11:
router isis
advertise passive-only
SP-PE-R22:
router isis
advertise passive-only
SP-PE-R33:
router isis
advertise passive-only
SP-PE-R44:
router isis
advertise passive-only
Verification:
An interesting thing with IS-IS is: every device can see the other devices hostname, because
there is a TLV for this feature and routers can include their hostnames inside that TLV. IS-IS is
an extensible protocol thanks to these TLVs. Whenever new feature wants to be added to IS-IS,
it’s done using a new TLV. No need to Protocol rewrite!
Another interesting thing! Where are all /24 prefixes?! You remember we issued a command
that caused IS-IS to only advertise passive /32 host NLRIs not inter-router connection.
As you can see, IS-IS’s AD is 115, and all routes are L2.
SP-P-R88#show mpls ldp neighbor | include Peer
LDP neighborship is also formed, and SP-P-R88 uses it’s Lo0 IPv4 address as LDP Identifier.
Let’s analyze one neighbor in detail:
SP-P-R88#show mpls ldp neighbor
Up time: 06:04:51
10.99.33.99 10.99.88.99
TCP connection has been established for about 6 hours. We use Source port of 646 and the
neighbor uses an ephemeral port of 37264.
Also targeted hellos are being generated using UDP between Loopback addresses.
Take a look at Src and Dst Port numbers they are both 646.
Let’s confirm that LDP has done its job and now we should have Labels for all /32 prefixes:
SP-PE-R11#show mpls fo | include 10.255.255
Sounds good! You see ECMP and prefix labels from different neighbors for other PE’s Lo0s.
What about Pop Label ones? Where is the labels for those prefixes? This is because of
something called PHP (not a programming language!) Penultimate Hop Popping. The default
behavior of Cisco routers when they are the final destination for a particular prefix. The final
destination of a prefix (The owner or the actual advertiser of the prefix) tells the neighboring
router: Hey when you want to send me something that is destined for this prefix, please
remove the outer label (yes the outer label because we can have multiple labels at the same
time for a particular packet, this is called Label Stacking) and send it to me, I know what to do
with that packet, I’m the owner of the prefix! But how the router tells the neighboring routers
that do that way?
MPLS LAB 01 (L3VPNS) 14
ORHAN ERGUN LLC CCIE SP WORKBOOK
There is a label reserved for this purpose. Label number 3, this is called Implicit null. That Pop
Label that we have highlighted stands for that. This router should pop the label for that
destination before it sends it to the neighboring router.
Before we proceed with Next Task, Let me explain about P and PE routers in MPLS.
P stands for Provider device, and PE stands for Provider Edge device. We have another one
called CE device. You can guess it stands for Customer Edge device.
When we say a device is P, it means that device only forwards packets based on Labels. To be
exact: based on IGP created labels. This device is not going to talk to any Customer device and
also we are not going to configure any BGP on this device. The Core devices on SP network are
called P devices.
When we say a device is PE, it means that device can forward traffic that are labeled or
unlabeled, and this device can be connected to Customer Edge devices. We run BGP on PE
devices only. Have you heard of the most famous benefit of MPLS? Core Free BGP. We don’t
have to run BGP on Core (P) when we play with MPLS. The traffic between PE devices are
going to be tunneled somehow that we will discuss soon!
Task 03:
Configure iBGP on every PE router and only enable VPNv4 Unicast address family. All
sessions should be established between Lo0 interfaces.
The BGP AS number should be 10000.
SP-PE-R11 and SP-PE-R22 should be configured as Route-Reflectors with the same
Cluster-ID: 10.255.255.11.
On Route Reflectors use session and policy templates to configure neighbor’s session and
policy parameters. Configure MD5 password “ccie_ei” for all sessions.
Solution:
In this Lab we don’t have many PE devices, we can configure full mesh peering between them,
but in real life situations you face many PE devices. For example more than PE devices you see
in an SP network. Can you do a full mesh between all of them? It would be a nightmare! I
almost forgot to mention why we even need Route-Reflectors! In SP network an even in MPLS
Enabled campus network all Edge Devices form iBGP peering together. BGP’s Loop Prevention
mechanism assists AS-Path Attribute in order to avoid loops. When an eBGP peer receives
NLRI’s that are bounded to some attributes, it looks at AS-Path attribute, if the peer sees itself
AS number in the AS-Path List, it ignores that reachability information.
When we form iBGP peering, there is no loop prevention mechanism like AS-Path because a
router only prepends it’s AS# to the Reachability Information when it sends them to an eBGP
neighbor (a neighbor with different AS#). So it is dangerous to advertise an iBGP learned route
to other iBGP peer and we should configure full mesh peering between all iBGP peers.
As I already mentioned it is not a scalable method. We can use Confederations or Route
Reflectors instead.
A Route Reflector (RR) can get a route from an iBGP client and advertise it to another iBGP
client. I don’t want to get into all RR capabilities to confuse you. All you need to know for out
Lab is an RR gets a route from a client and advertises it to another client.
How does an RR prevent loops? A good question! RR uses a field called Cluster-ID, when a
route receives from a client, RR puts it’s cluster-id into that route and sends it to another
neighbor, by looking at cluster-id field routers can know if that route it advertised back to
them.
rx pathid: 0, tx pathid: 0
Take a look at Cluster List and Originator field. Every RR adds it’s cluster ID to that list. Then
by assisting that list they can prevent loops. The Originator is the owner of the route, in this
example it is another Client of our RR.
Let’s configure out first Route-Reflector:
SP-PE-R11:
route-reflector-client
exit-peer-policy
remote-as 10000
password ccie_ei
update-source Loopback0
exit-peer-session
bgp log-neighbor-changes
address-family ipv4
exit-address-family
address-family vpnv4
exit-address-family
First we define a BGP process with AS# 10000, by default IOS/IOS-XE enables IPv4 Unicast
address family for every peer that we define. But the task explicitly have asked us to enable
only VPNv4 Unicast Address Family. To disable this default behavior we need to enter no bgp
default ipv4-unicast command. Now we must activate whatever AF we want to be enabled for a
particular neighbor.
By default BGP router-id the same steps that it uses for OSPF. And also sets router-id as
cluster-id. The task explicitly have asked us to configure it manually the same value on both
RR. That’s why we must enter bgp cluster-id 10.255.255.11 command.
Then we define Templates. Session template can contain any parameter that is needed for BGP
session formation:
SP-PE-R11(config-router)# template peer-session iBGP-SESSION-TEMPLATE
SP-PE-R11(config-router-stmp)#?
reset)
networks
Take a look at inherit word in the neighbor commands. All those neighbors inherits attributes
we defined under the templates. And also activate word in the neighbor command, this
command enables that particular AF for a neighbor.
Cisco IOS/IOS-XE automatically adds send-community extended command after you activate
VPNv4 for a neighbor. No need to enter it manually.
VPNv4 uses extended communities a lot! Then it is necessary for this VPN service.
Let’s configure the other RR:
SP-PE-R22:
route-reflector-client
exit-peer-policy
remote-as 10000
password ccie_ei
update-source Loopback0
exit-peer-session
bgp log-neighbor-changes
address-family ipv4
exit-address-family
address-family vpnv4
exit-address-family
The important thing is: RR’s must be fully meshed, in this scenario they are neighbors with
each other and there is no route-reflector-client because they are not client of each other.
It’s time to configure clients:
SP-PE-R33 and SP-PE-R44:
bgp log-neighbor-changes
address-family vpnv4
address-family vpnv4
exit-address-family
Just copy paste the same configurations on all client PEs of this cluster!
Congratulations! Our SP network is ready to provide L3VPN services to customers.
Take a rest and continue with the next Task!
Task 04:
Provide MPLS L3VPN Service to CustA (Customer A)
Use Static-Routes as PE-CE Routing Protocol
CustA-Static-CE1 device should reach other sites using it’s Lo0 interface and also reach
the router that is doing NAT (CustA-2-Static-CE12 device) using it’s Lo200 interface.
Solution:
First let’s talk about MPLS L3VPN service. Using MPLS VPNs an SP can provide both L2 and L3
connectivity between customer sites. L2 Connectivity means, customer sites can reach
together just like they are connected to an L2 switch, they can reach each other using a subnet
for example 172.16.10.0/24, each site router’s (CE device) interface would have an IP address
in that subnet, in other words broadcast, unknown unicast and multicast traffic (BUM Traffic)
will be flooded to every site using services like VPLS (Virtual Private LAN Service, a P2MP
connection).
It sounds good to have this kind of connectivity, but the problem is Scalability. What if a
customer has many sites like a 1000 or more? Or customer wants redundant connections on
many sites? Using VPLS it’s a nightmare to have this kind of connections, only a single
misconfiguration or a misbehaving device would cause a loop in the network and bring down
the whole network!
L3VPN service comes into play, a Customer on each of its sites, gives the Service Provider its
reachability information (the routing table information) then Service Provider routers
somehow spread this reachability information to other sites.
We discussed about CE and PE devices, and now we know the Customer side device is called
CE (Customer Edge) and the Provider side device is called PE (Provider Edge). In L3VPN
service CE must tell its reachability information to PE device and also CE must get other sites
reachability information from the PE device.
There are different ways of doing this job. We can use different routing protocols such as Static
one (Static-Routes), or Dynamic ones like BGP, OSPF, EIGRP, RIP or even IS-IS (but it’s not
recommended! I will tell you why in this workbook).
Let’s continue with the task.
First configure Site 2 and 3 of the CustA. Every CE device has a Loopback IP address. On CustA-
Static-CE2 we have Lo0: 172.16.255.2/32 and also a subnet connected to the SP-PE-R22
172.16.22.0/24, on the other site for CustA-Static-CE3 we have Lo0: 172.16.255.3/32 and
subnet connected to SP-PE-R33 172.16.33.0/24.
What is common on these subnets? 172.16.0.0/16 right? Then we only need a single Static
route on every CE device pointing to next-hop of the appropriate PE device:
CustA-Static-CE2:
interface Loopback0
interface Ethernet1/0
interface Loopback0
interface Ethernet1/2
SP-PE-R22:
rd 10000:1
address-family ipv4
exit-address-family
By using vrf definition command we define a VRF instance named CustA-Static, you could also
use ip vrf CustA-Static command for this scenario because we don’t have any IPv6 addresses
here (You got the point, vrf definition command both supports IPv4 and IPv6 address families).
So what is RD (Route-Distinguisher) here? You remember we configured an MP-BGP AF
before, named VPNv4 Unicast. BGP is going to do the magic for us in L3VPNs! The routes that
are learned from each CE device are going to be distributed to other CE devices on another PEs
using MP-BGP AF VPNv4 Unicast. We discussed about that each customer reachability
information should be isolated from other customers, so we need to add something to their
routes in order to make them unique between other customers. The RD (Route-Distinguisher)
is going to do exactly what we need to do, adding a unique 32 bit in the beginning of an NLRI
makes it unique (it is actually 64 bit, but 32 bit is considered by all implementations). Then we
have 32-bit IPv4 prefix + 32-bit prefix-length + 32-bit RD = 96-bit unique NLRI.
So if 2 customers use the same prefix/prefix length with different RDs, the result is like this:
Cust1 RD=10000:1, Cust2 RD=10000:2
Cust1 NLRI: 10000:1:192.168.1.0/24
Cust2 NLRI: 10000:2:192.168.1.0/24
Different routes even if they are overlapping right?
SP-PE-R22#show bgp vpnv4 uni rd 10000:1 172.16.255.1/32
Advertised to update-groups:
What about RT (Route-Target)? When a PE gets routes from a CE device, it places them into
the VRF routing table, we need a mechanism to export these routes from the VRF table and
send them to other PE devices, we must redistribute these routes into MP-BGP and also tag
them to let the other PEs to import them selectively, because they don’t care about the RD for
doing this job, they only import what we explicitly tell them to import.
On SP-PE-R22 we told the PE under VRF CustA-Static to export routes that have received from
the CE (the routes that has in its vrf routing table now) using an extended community (let’s
name it tag) of 10000:1 and send it to other PEs. And also we told the PE that import routes
that have extended community tag of 10000:1.
We could use different RD and RT for a customer. To make this scenario simple and
understandable we used the same 10000:1 for both RD/RT.
But there is an important rule: we can only define one RD for a VRF on a PE but we can have
multiple RTs for that VRF on a PE.
Now let’s configure PE interfaces and static routes:
SP-PE-R22:
interface Ethernet1/0
Take a look at the vrf forwarding command, this command makes interface e1/0 to be part of
vrf CustA-Static and we should write a static route in order to reach CustA-Static-CE2
Loopback 0 interface, this route also needs to be part of that VRF instance because of that we
include vrf after ip route command.
The last thing we need to do is to redistribute that route into MP-BGP VPNv4 unicast AF:
SP-PE-R22:
redistribute connected
redistribute static
exit-address-family
Under BGP process we should define an IPv4 AF for that VRF instance and redistribute static
routes into it. It is not necessary for other sites to also reach the interface between PE-CE
(connected/direct network) but we do so, let’s configure full reachability between sites even
PE-CE connections.
It’s time to configure the other site:
SP-PE-R33:
rd 10000:1
address-family ipv4
exit-address-family
interface Ethernet1/2
redistribute connected
redistribute static
exit-address-family
Verification:
Look at vrf word after show ip route command and also B (BGP learned routes) and 200 AD
because those are iBGP routes (Every PE forms iBGP session with other PEs, the same AS#).
To view MP-BGP learned routes on BGP use command show bgp vpnv4 unicast rd 10000:1
SP-PE-R22#show bgp vpnv4 uni rd 10000:1 | begin Network
SP-PE-R33 has two routes for other PE’s networks, because it gets them from two redundant
Route-Reflectors.
To get detailed information about each route we can use the prefix at the end of previous
command:
SP-PE-R22#show bgp vpnv4 uni rd 10000:1 172.16.255.3/32
Advertised to update-groups:
1 2
Refresh Epoch 1
You see the label number 30006 for this route? This is the label that PE33 told PE22 using MP-
BGP VPNv4 unicast AF: “If you want to reach this network include this label at the bottom of all
labels”. If we traceroute on CE2 we should see this label:
1 172.16.22.22 1 msec
4 172.16.33.3 2 msec
The label number 80002 is the label to reach the other PE device (SP-PE-R33).
We can have something called Label Stacking in MPLS, mean multiple labels for a packet:
Interesting right? A packet with multiple Labels, this is the power of MPLS and its capability to
tunnel the traffic between two end points. Core Routers are not aware of the bottom label they
only look at the top label 80002:
SP-P-R88#show mpls forwarding-table
The Core router LFIB proofs that it has no information about bottom label.
Now you realize why these services are called VPN. They are Virtual and Private and also the
traffic is being tunneled.
MPLS LAB 01 (L3VPNS) 29
ORHAN ERGUN LLC CCIE SP WORKBOOK
permit 10.200.255.1
permit 172.16.255.1
rd 10000:1
address-family ipv4
exit-address-family
SP-PE-R11:
rd 10000:1111
address-family ipv4
exit-address-family
And then define a route-map to put the traffic with different source IP addresses to different
VRFs:
SP-PE-R11:
interface Ethernet0/2
Instead of putting the interface under a VRF (using vrf forwarding command), we use
ip vrf receive [vrf name] command and also use the route-map that we have defined previously
by entering ip policy route-map command, Just like PBR.
Configure static routes for 2 VRFs in order to reach Lo0/Lo200 interface of CE1:
SP-PE-R11:
redistribute static
exit-address-family
redistribute static
exit-address-family
CustA-Static-CE1:
interface Loopback0
interface Loopback200
interface Ethernet0/2
We need static routes in order to reach other sites and also outside network 200.0.0.0/8 (NAT
doing router connected).
Now CE1 can ping CE2 and CE3 using Loopback0 IP addresses:
CustA-Static-CE1#ping 172.16.255.2 source lo 0 re 10
!!!!!!!!!!
!!!!!!!!!!
What about packets with Loopback 200 source? We have not configured Site 12 yet (NAT
doing router site):
SP-PE-R33:
rd 10000:1111
address-family ipv4
exit-address-family
interface Ethernet0/1
redistribute static
exit-address-family
interface Loopback0
interface Ethernet0/0
CustA-2-Static-CE12:
interface Ethernet0/0
ip nat outside
ip virtual-reassembly in
interface Ethernet0/1
ip nat inside
ip virtual-reassembly in
permit 10.200.255.1
Verification:
!!!!!!!!!!
2 10.88.11.88 [MPLS: Labels 80002/30020 Exp 0] 2 msec 2 msec 1 msec 1 msec 1 msec
3 10.16.133.33 [MPLS: Label 30020 Exp 0] 2 msec 1 msec 1 msec 2 msec 1 msec
Task 05:
Provide MPLS L3VPN Service to CustB (Customer B)
Use RIP as PE-CE Routing Protocol
Solution:
We have already done L3VPN service using Static-Routes. It’s not a scalable solution, for
scalability we have to use Dynamic Routing Protocols like BGP, OSPF, RIP, EIGRP and even IS-
IS. Each of them has advantages and disadvantages.
The steps to configure L3VPN using RIP as a PE-CE Routing Protocol are the same as Previous
tasks (Static-Routes) plus one more step.
First Configure RIP on CE routers:
CustB-RIP-CE1:
interface Loopback0
interface Ethernet0/0
router rip
version 2
passive-interface default
no passive-interface Ethernet0/0
network 172.17.0.0
no auto-summary
CustB-RIP-CE2:
interface Loopback0
interface Ethernet0/0
router rip
version 2
passive-interface default
no passive-interface Ethernet0/0
network 172.17.0.0
no auto-summary
CustB-RIP-CE3:
interface Loopback0
interface Ethernet1/0
router rip
version 2
passive-interface default
no passive-interface Ethernet1/0
network 172.17.0.0
no auto-summary
rd 10000:2
address-family ipv4
exit-address-family
interface Ethernet0/0
ip address
MPLS 172.17.11.11 255.255.255.0
LAB 01 (L3VPNS) 37
!
ORHAN ERGUN LLC CCIE SP WORKBOOK
redistribute rip
exit-address-family
router rip
network 172.17.0.0
default-metric 2
no auto-summary
version 2
exit-address-family
Look at Highlighted commands, Instead of using the same Route-Target values as RD, this time
I used different values for import and export.
Lo0 interface address of PE router + Customer unique number:
route-target export 10.255.255.11:2 command causes PE 11 to export customer routes from
VRF table and tag them using RT Extended Community value of 10.255.255.11:2 then send
them to other PEs using VPNv4 Unicast MP-BGP Address Family.
Other PE routers must be explicitly configured for this value in order to import these routes
into the appropriate VRF routing table.
You can see on PE 11 we also configured
route-target import 10.255.255.22:2 and route-target import 10.255.255.44:2
using these two commands this router is going to import the routes that PE 22 and PE 44 have
exported from CutB-RIP VRF routing table.
What is the benefit of doing this way instead of using the same value for both import/export
RT values? The reason is Flexibility and Inter-VRF route leaking!
We can selectively import/export whatever site routes we want. If a Customer does not want
to have connectivity between 2 of their sites but the other sites stay fully connected, SP can do
it for the customer in an easy way using RT import/export values.
The other benefit is route leaking between 2 or many customers. I will show you how it works.
Look at this configuration:
CustB-RIP-CE1:
router rip
Many thanks to Cisco! They have made RIP and other Routing protocols like OSPF, EIGRP to be
VRF aware. Using this VRF awareness RIP can send/receive routes to/from Customer CE
device.
An important step is mutual redistribution between RIP/BGP. Routes have received from CE
device must be redistributed into MP-BGP and also routes received from MP-BGP (Other PEs)
need to be redistributed into RIP.
SP-PE-R11:
redistribute rip
exit-address-family
router rip
default-metric 2
exit-address-family
Seed metric is also necessary for RIP, Because by default RIP does not have any seed metric
and routes are not going to be redistributed from BGP. Another way of setting metric is during
redistribution: redistribute bgp 10000 metric 1
Configure other PEs the same way:
SP-PE-R22:
rd 10000:2
address-family ipv4
exit-address-family
interface Ethernet0/0
redistribute rip
exit-address-family
router rip
network 172.17.0.0
no auto-summary
version 2
exit-address-family
SP-PE-R44:
rd 10000:2
address-family ipv4
route-target export 10.255.255.44:2
route-target import 10.255.255.11:2
route-target import 10.255.255.22:2
exit-address-family
!
!
interface Ethernet0/1
vrf forwarding CustB-RIP
ip address 172.17.44.44 255.255.255.0
!
router bgp 10000
!
address-family ipv4 vrf CustB-RIP
redistribute rip
exit-address-family
!
router rip
!
address-family ipv4 vrf CustB-RIP
redistribute bgp 10000 metric 1
network 172.17.0.0
no auto-summary
version 2
exit-address-family
!
Verification:
Advertised to update-groups:
Refresh Epoch 1
Local
Advertised to update-groups:
3 4
Refresh Epoch 1
1 172.17.11.11 2 msec
4 172.17.22.2 2 msec
1 172.17.11.11 0 msec
4 172.17.44.3 1 msec
Let’s assume the customer has asked us to block Site 2 and 3 connection but they want
connection between site 1 and 2 other sites (Like Hub and spoke connection, Site 1 is the hub):
SP-PE-R22:
SP-PE-R22(config-vrf)#address-family ipv4
SP-PE-R22:
SP-PE-R22(config-vrf)#address-family ipv4
SP-PE-R44:
Verification:
SP-PE-R22:
SP-PE-R11(config-vrf)#address-family ipv4
Task 06:
Provide MPLS L3VPN Service to CustC (Customer C)
Use BGP as PE-CE Routing Protocol
Use the same BGP AS#65003 on all Customer Sites. Do not use allowas-in option.
Configure Site-Of-Origin Extended Community for CE2/CE4 site.
Configure ECMP for VPNv4 traffic of CustC, then CustC-BGP-CE3 traffic must be
load-shared between SP-PE-R11 and SP-PE-R33 towards CE4 Lo0.
Solution:
eBGP can also be used as Dynamic PE-CE routing protocol in MPLS L3VPN services. In
fact it is the most convenient and easy to configure and manage protocol as a PE-CE
routing protocol. There is no need for any redistribution, PE devices will form eBGP
peering with CE device and when it gets routes, It will automatically send them to other
PE devices using VPNv4 unicast AF.
First Configure Site 1 and Site 3:
CustC-BGP-CE1:
interface Loopback0
interface Ethernet1/0
bgp log-neighbor-changes
CustC-BGP-CE3:
interface Loopback0
interface Ethernet1/2
bgp log-neighbor-changes
CE device configuration is straight forward, the only key point was: the Task asks us to
use the same AS# on every Customer site. The problem of using same AS# for all
customer site is the Loop prevention mechanism of BGP, CE devices are peering with PE
devices using eBGP session, as you already know eBGP peering edge device prepends it’s
own AS# to the AS_Path attribute then other CE devices receiving these routes just
ignore them because they see their own AS# in AS_Path attribute.
To fix this problem we can use allowas-in option for the neighbor statement, but the Task
restricts us to only use other options on Service Provider side.
SP-PE-R11:
rd 10000:65003
address-family ipv4
exit-address-family
interface Ethernet1/0
exit-address-family
SP-PE-R44:
rd 10000:3
address-family ipv4
exit-address-family
interface Ethernet1/2
maximum-paths ibgp 2
exit-address-family
Look at RD value: 10000:65003 and 10000:3, I will explain the reason of using different
RD values and also maximum-paths ibgp 2 command at next section of configuration.
PE device must form eBGP peering with CE devices using VRF aware BGP, to do so we
configure neighbors and other related commands under address-family ipv4 vrf CustC-
BGP, there is no need for redistribution because VRF aware BGP gets routes from CE
device and sends them to other PE devices using VPNv4 Unicast address-family.
In fact we don’t need these networks (PE-CE connected subnets) to be learned by other
Sites, only Loopback interfaces reachability is enough for Site connectivity, but we do it
in order to provide Full connectivity between sites. Instead of network statement,
redistribute connected command could be used, in that case Origin attribute of NLRI
becomes incomplete instead of IGP.
as-override command is used for the neighbors to solve the AS_Path loop prevention
problem for our scenario that I’ve already described. CE devices drop the routes because
they see their own AS# in AS_Path. as-override command on Service Provider PE devices
replaces Customer AS Number with Provider AS Number when it advertises routes to
the customer device, but Provider still sees AS_Path with the actual Customer’s AS
number.
CustC-BGP-CE1#show ip bgp | begin Network
Verification:
172.18.255.1/32
172.18.255.3/32
interface Loopback0
interface Ethernet0/0
interface Ethernet0/1
bgp log-neighbor-changes
CustC-BGP-CE4:
interface Loopback0
interface Ethernet0/1
interface Ethernet0/3
interface Ethernet1/2
bgp log-neighbor-changes
CE2 and CE4 form iBGP peering using their Loopback 0 interfaces, so we need to write a
static route for Lo0 networks on each router or we can run an IGP between them. To
keep the scenario simple we choose static routes for Lo0 reachability.
Have a close look at the topology, CustC-BGP-CE4 has two physical connections towards
SP network, e1/2 (to PE-R11) e0/3 (to PE-R33). Task asks us to load share VPNv4 traffic
from site 3 to CE4 device, because of that we have configured different RD value other
than 10000:3 on SP-PE-R11, the reason is:
PE devices advertise VPNv4 routes to Route-Reflectors, then Route-Reflectors reflect
(send) them to another PE devices, by default a Route-Reflector only advertises the Best
route to other PEs, means only a single best route. In this scenario we have two
connections from different PE devices to Customer Edge device 4 (CE4), tasks expilicitly
asks of doing load sharing between two PEs (PE11, PE33), in other words CE3 packets
should be load shared between PE11 and PE33. So we need to advertise both routes to
PE44, if we set different RDs on different PEs for that customer, then Route-Reflector
will send both routes to the PE44:
SP-PE-R11:
rd 10000:65003
address-family ipv4
exit-address-family
interface Ethernet1/2
exit-address-family
SP-PE-R33:
rd 10000:3
address-family ipv4
exit-address-family
interface Ethernet0/0
interface Ethernet0/3
exit-address-family
What is SoO here? You noticed that these two CE devices are at the customer site, and they
have redundant connections from the Service Provider, every CE device advertises routes to SP
PE devices, they can cause a loop if for some reason they advertise back the CE learned routes
to another CE device on the same site, and also SP network could become a transit network for
CE2-CE4 communication. To avoid these situations every PE must tag routes from the same
Customer site with the same value, then PEs simply avoid sending the routes with the same
SoO (Site-Of-Origin) extended community value to the CE device.
PE44 receives two routes for network 172.18.255.4/32 with different RDs but puts only one of
them to CustC-BGP VRF RIB because of BGP default behavior:
SP-PE-R44#show ip route vrf CustC-BGP | begin Gateway
To change BGP’s default behavior, an additional command is needed under BGP for Customer
VRF:
SP-PE-R44:
maximum-paths ibgp 2
exit-address-family
4 172.18.114.4 1 msec
To enable Per Micro-Flow load sharing on Cisco IOS enter this command on all routers:
* 172.18.233.33 0 10000 i
Task 07:
Provide MPLS L3VPN Service to CustD (Customer D)
Use OSPF as PE-CE Routing Protocol
Configure domain-id type 0005 value 000000065004 for OSPF process
Sites should use optimal paths in order to reach each other (Serial WAN links
should be used as a backup path as long as PE-CE connections are up)
CE5 int e0/0, Lo0 and also OSPF process should be configured under a VRF
Solution:
First configure CE devices, they have a straight forward configuration other than CE5, so we
only configure CE1-4 for now:
CustD-OSPF-CE1:
interface Loopback0
ip ospf 4 area 0
interface Ethernet1/1
ip ospf 4 area 0
interface Serial2/0
ip ospf 4 area 0
serial restart-delay 0
router ospf 4
passive-interface default
no passive-interface Ethernet1/1
no passive-interface Serial2/0
CustD-OSPF-CE2:
interface Loopback0
ip ospf 4 area 0
interface Ethernet0/3
ip ospf 4 area 0
interface Serial2/0
ip ospf 4 area 0
serial restart-delay 0
router ospf 4
passive-interface default
no passive-interface Ethernet0/3
no passive-interface Serial2/0
CustD-OSPF-CE3:
interface Loopback0
ip ospf 4 area 0
interface Ethernet1/1
ip ospf 4 area 0
interface Serial2/0
ip ospf 4 area 0
serial restart-delay 0
router ospf 4
passive-interface default
no passive-interface Ethernet1/1
no passive-interface Serial2/0
CustD-OSPF-CE4:
interface Loopback0
ip ospf 4 area 0
interface Ethernet1/1
ip ospf 4 area 0
interface Serial2/0
ip ospf 4 area 0
serial restart-delay 0
router ospf 4
passive-interface default
no passive-interface Ethernet1/1
no passive-interface Serial2/0
Configure PE side:
SP-PE-R11:
rd 10000:4
address-family ipv4
exit-address-family
interface Ethernet1/1
interface Loopback65004
router-id 172.19.255.11
exit-address-family
SP-PE-R22:
rd 10000:4
address-family ipv4
exit-address-family
interface Ethernet1/1
interface Loopback65004
router-id 172.19.255.22
exit-address-family
Most configurations are the same as previous tasks but there are some additional command
that we have highlighted:
IOS/IOS-XE sets domain-id value to based on OSPF Process ID, this value is used for some
reason that will be explained in next pages.
IOS-XR does not set domain-id automatically, you must set it expilicitly. There is no IOS-XR
device in this lab but you will see XRv routers in next labs, and should be aware of this default
behavior.
CustD-OSPF-CE3#show ip route ospf | begin Gate
Why CE3 and CE4 use Serial2/0 WAN connection to reach each other Loopback 0?
Let’s shutdown Serial 2/0 interface to see what happens:
CustD-OSPF-CE4(config)#int s2/0
CustD-OSPF-CE4(config-if)#shu
CustD-OSPF-CE4(config-if)#shutdown
CustD-OSPF-CE4(config-if)#
*Apr 6 15:21:00.142: %OSPF-5-ADJCHG: Process 4, Nbr 172.19.255.3 on Serial2/0 from FULL to DOWN, Neighbor
Down: Interface down or detached
CustD-OSPF-CE4(config-if)#do
*Apr 6 15:21:03.146: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to down
Interesting! SP advertised routes are Inter-Area routes, but all interfaces of all PE and CE
routers are in Area 0, What are those Inter-Area routes? We don’t have any other Areas than
area 0.
This is because of domain-id configuration on PE routers, If OSPF DOMAIN ID extended
community value of a route is the same as the value we configured on every PE device, routes
become Inter-Area:
SP-PE-R11#show bgp vpnv4 unicast rd 10000:4 172.19.255.4/32
Advertised to update-groups:
Refresh Epoch 1
Local
Let’s change Domain-ID value on PE22 and check the result again:
SP-PE-R22(config)#router ospf 65004 vrf CustD-OSPF
CustD-OSPF-CE3(config)#int s2/0
CustD-OSPF-CE3(config-if)#no sh
*Apr 6 15:37:10.473: %OSPF-5-ADJCHG: Process 4, Nbr 172.19.255.4 on Serial2/0 from LOADING to FULL, Loading
Done
We have to convert SP learned routes to Intra-Area routes. But how? Can we make SP network
between PE11 and PE22 Backbone? Using Sham-Link yes! SP network becomes Backbone for
our Backbones! This is called Super-Backbone.
Create a loopback interface on each PE router and advertise them into the BGP:
SP-PE-R11:
interface Loopback65004
SP-PE-R22:
interface Loopback65004
Now PE11 and PE22 can ping each other Loopback 65004:
SP-PE-R11#show bgp vpnv4 unicast rd 10000:4 | include 172.19.255.22
!!!!!
This Area 0 using Sham-Link on PE Routers acts like a Super-Backbone area for OSPF process
on Customer sites, and Ethernet1/1 is prefered over Serial 2/0:
CustD-OSPF-CE3#show ip route ospf | begin Gate
rd 10000:4
address-family ipv4
exit-address-family
interface Ethernet1/1
shutdown
interface Loopback65004
router-id 172.19.255.33
exit-address-family
SP-PE-R44:
rd 10000:4
address-family ipv4
exit-address-family
interface Ethernet0/0
shutdown
interface Ethernet0/3
shutdown
interface Loopback65004
router-id 172.19.255.44
exit-address-family
CE5 Configuration, the Task asks us to configure CE5 using a VRF not global routing table:
CustD-OSPF-CE5:
address-family ipv4
exit-address-family
interface Loopback0
ip ospf 4 area 0
interface Ethernet0/0
ip ospf 4 area 0
router-id 172.19.255.5
a - application route
RIB is incomplete, some routes are missing! But what about OSPF LS Database? It is complete:
CustD-OSPF-CE5#show ip ospf 4 database
Link-State Database is fully collected, but some routes are not imported to the RIB. The reason
is DN-bit or Downward bit. It is a loop prevention mechanism of OSPF in MPLS VPNs. When a
PE router imports OSPF learned routes from VPNv4 AF (Inter-Area and External routes, not
Sham-Link learned routes), it sets Downward bit for those LSAs, then other VRF aware OSPF
processes on another routers ignore those LSAs and never import the routes to the RIB. It is a
loop prevention mechanism of VRF aware OSPF. When we configure normal OSPF process on a
CE device, these downward bit tagged LSAs are accepted from PE device, but if we run VRF
aware OSPF Process on CE devices, downward bit tagged LSAs are ignored by CE device and
never get into RIB.
Some routes are imported to CE device’s RIB, because they don’t have Downward bit.
To fix this problem we need to enter a command on CE device under the OSPF process, then CE
device ignores DN-bit:
CustD-OSPF-CE5:
capability vrf-lite
Task 07:
Customer B wants to have IPv6 connectivity, Provide it using 6VPE service
Configure OSPFv3 as the PE-CE routing protocol
Physical Interface IPv6 addressing scheme must be:
FD02:172:17:PE_R#::R#/64
Loopback Interface IPv6 addressing scheme must be:
FD02:172:17:255::R#/128
Solution:
First, configure CE devices:
CustB-RIP-CE1:
ipv6 unicast-routing
interface Loopback0
interface Ethernet0/0
CustB-RIP-CE2:
ipv6 unicast-routing
interface Loopback0
interface Ethernet0/0
CustB-RIP-CE3:
ipv6 unicast-routing
interface Loopback0
interface Ethernet1/0
IPv6 Unicast routing and also OSPFv3 must be enable on CE devices because RIP does not
support IPv4 Address-Family and also VRF aware RIPng is not supported in IOS.
Between PE devices, iBGP session using IPv4 Unicast addresses is enough for 6VPE service, the
Underlay connectivity is going to be IPv4 only.
We need to also enable VPNv6 Address-Family between PE devices:
SP-PE-R11:
ipv6 unicast-routing
address-family vpnv6
SP-PE-R22:
ipv6 unicast-routing
address-family vpnv6
SP-PE-R44:
ipv6 unicast-routing
address-family vpnv6
Verification:
MP-BGP VPNv6 Unicast peering has been established, time to configure PE devices to
communicate with CE devices and transmit their IPv6 routes:
SP-PE-R11:
address-family ipv6
exit-address-family
interface Ethernet0/0
router ospfv3 2
exit-address-family
exit-address-family
exit-address-family
SP-PE-R22:
address-family ipv6
exit-address-family
interface Ethernet0/0
router ospfv3 2
exit-address-family
exit-address-family
exit-address-family
SP-PE-R44:
address-family ipv6
exit-address-family
interface Ethernet0/1
router ospfv3 2
exit-address-family
exit-address-family
exit-address-family
Verification:
SP-PE-R11(config)#do sh bgp vpnv6 uni rd 10000:2 | begin Net
*> FD02:172:17:255::1/128
FE80::A8BB:CCFF:FE00:700
10 32768 ?
*>i FD02:172:17:255::2/128
::FFFF:10.255.255.22
10 100 0 ?
*>i FD02:172:17:255::3/128
::FFFF:10.255.255.44
10 100 0 ?
Advertised to update-groups:
Refresh Epoch 5
Local
OSPF RT:0.0.0.0:2:0
Look at the Next-Hops of VPNv6 learned routes, those are IPv4-IPv6 mapped addresses.
CustB-RIP-CE1(config-if)#do sh ipv6 route ospf | begin FD
OI FD02:172:17:255::2/128 [110/20]
OI FD02:172:17:255::3/128 [110/20]
OI FD02:172:17:255::1/128 [110/20]
OI FD02:172:17:255::3/128 [110/20]
OI FD02:172:17:255::1/128 [110/20]
OI FD02:172:17:255::2/128 [110/20]
!!!!!
!!!!!
CustB-RIP-CE1#traceroute
Priority [0]:
In the SP Core we have not enabled IPv6 unicast routing, Only PE-CE connection is IPv6 unicast
using VRF, this method is called 6VPE MPLS VPN. Take a look at below packet capture: