Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

VRF Lite Configuration on Cisco IOS

In this lesson you will learn about VRFs (Virtual Routing and Forwarding). By default a router
uses a single global routing table that contains all the directly connected networks and prefixes
that it learned through static or dynamic routing protocols.

VRFs are like VLANs for routers, instead of using a single global routing table we can use
multiple virtual routing tables. Each interface of the router is assigned to a different VRF.

VRFs are commonly used for MPLS deployments, when we use VRFs without MPLS then we call
it VRF lite. That’s what we will focus on in this lesson. Let’s take a look at an example topology:
In the topology above we have one ISP router and two customers called “Red” and “Blue”. Each
customer has two sites and those are connected to the ISP router. The ISP router has only one
global routing table so if we connect everything like the topology above, this i s what the routing
table will look like:

The ISP router has a single global routing table that has all 4 directly connected networks. Let’s use VRFs
to change this, I want to create a seperate routing table for customer “Blue” and “Red”. First we have to
create these VRFs:
Globally we create the VRFs, one for each customer. Our next step is to add the interfaces of the ISP
router to the correct VRF. Here’s how:

On the interface level we use the ip vrf forwarding command to assign the interface to the correct VRF.
Once you do this , you’ll have to add the IP address again. Let’s configure the remaining interfaces:

All interfaces are now configured. There’s a useful command you can use to see all the VRFs and their
interfaces:
Our VRFs are configured, let’s take a look at the global routing table of the ISP router:

The global routing table has no entries, this is because all interfaces were added to a VRF. Let’s check
the VRF routing tables:

We use the show ip route command but you’ll need to specify which VRF you want to look at.
As you can see, each VRF has its own routing table with the interfaces that we configured
earlier.

If you want to do something on the router like sending a ping then you’ll have to specify which
VRF you want to use. By default it will use the global routing table. Here’s an example how to
send a ping:

That’s easy enough, just don’t forget to specify the correct VRF. The same thing applies to
routing (protocols). For example if you want to configure a static route you’ll have to specify the
correct VRF. Take a look at the example below:
Router Blue1 has a loopback interface with IP address 1.1.1.1 /32. Let’s create a static route on
the ISP router so that we can reach it:

We use the same ip route command but I specified to what VRF the static route belongs. Let’s see if this
works:

Easy enough, the ping works. What about routing protocols? We can use OSPF, EIGRP, BGP…no
problem at all. Let’s look at an example for OSPF:
Customer “Blue” and “Red” both want to use OSPF to advertise their networks. Since we use
VRFs, everything is seperated. Let’s start with the OSPF configuration for customer Blue:

The OSPF configuration for the customer routers is pretty straight-forward. On the ISP router, we’ll have
to specify what VRF we want to use:
We configure OSPF process 1 and specify the VRF that we want to use, that’s all there is to it. Let’s do
the same for customer Red:

The configuration is similar, I had to use another process ID on the ISP router since the first one is used
for customer Blue. Here’s what the VRF routing tables on the ISP router look like now:

Two seperate routing tables with the prefixes from each VRF, this is looking good.
This is what VRF lite is about, it has one downside though…it’s not a scalable solution. In our example we
only used a single ISP router but what if we want to use VRFs and multiple ISP routers? That’s something
we’ll discuss in the EVN (Easy Virtual Network) lesson.

You might also like