This blog will give you answers to these two mostly asked questions i.e. "what is vrf lite' and "how to configure vrf lite" particularly on Cisco routers but the concept is not only limited to Cisco.
In order to understand the concept of VRF lite and its step by step configuration on Cisco routers, let's consider a scenario where two routers connected to each other via two physical links (these links can be sub-interfaces as well) but for simplicity
I have taken two physical links as shown in the below diagram. Based on the scenario some tasks are design to configure respective VRFs and achieve a result.
● Configure the IP addresses on the two interfaces of R01 and R02 connected to each other as per the topology.
● Configure interface GigabitEthernet0/0 on both R01 and R02 so that it belongs to vrf VPN_A.
● Configure interface GigabitEthernet0/1 on both R01 and R02 so that it belongs to vrf VPN_B.
● Configure the following interfaces on R02:
✓ Loopback101 with IP address of 172.16.2.2/24, assigned to vrf VPN_A.
✓ Loopback102 with IP address of 192.168.2.2/24, assigned to vrf VPN_B (As a part of VRF lite configuration)
● Configure default routes on R02 for both VRFs toward R01.
● Configure R01 so that from R02, you have IP connectivity between Loopback101 and Loopback102.
Before moving to the Cisco VRF lite, make sure you have the IP addressing configured as per above diagram. Here is the initial configuration for the same.
R01:
! |
R02:
! |
VRF (Virtual Routing and Forwarding) are essentially required to make a single router into multiple virtual routers.
With the help of VRF lite configuration, you can create multiple virtual routing tables which has isolated networks and separate interfaces. They each has its own separate RIB (Routing Information Base) and FIB (Forwarding Information Base). These structures are also known as CEF tables.
You can assign any interface of a router to a VRF using the command "ip vrf forwarding
However, the Cisco VRF lite has limited scope of scalability because it requires a dedicated inter-router link for every VPN.
Therefore, if you have two routers and 100 VPNs, you must provision. 100 connections between the two routers, one for every VPN. The connection could be either a separate interface or some Layer 2 virtualization technique, such as Frame-Relay PVC or Ethernet VLAN.
In a router, all interfaces (physical or sub-interfaces) are in a global VRF by default which is the regular routing table used in non-VRF capable routers.
In VRF (lite) capable router, you can create a new VRF by issuing the command "ip vrf
Alternatively, you may use the format IP-Address:NN, where IP is the router’s IP address and NN is the VRF name. The second format properly reflects the feature of RD being a local distinguisher, but using the format ASN:NN is more popular and common, because it easily associates a VRF with a particular VPN in the network.
It is possible to associate static routes or dynamic routing protocol processes with the VRFs. In this lab, we work with static routing only. The syntax for a VRF-bound static route is ip route vrf
Now as per tasks, here are the steps of Cisco VRF lite configuration for both the routers.
R01:
! ip vrf VPN_A rd 100:1 ! ip vrf VPN_B rd 100:2 ! interface GigabitEthernet0/0 ip vrf forwarding VPN_A ip address 192.1.12.1 255.255.255.0 ! interface GigabitEthernet0/1 ip vrf forwarding VPN_B ip address 192.1.21.1 255.255.255.0 ! ip route vrf VPN_A 192.168.2.0 255.255.255.0 GigabitEthernet0/1 192.1.21.2 ip route vrf VPN_B 172.16.2.0 255.255.255.0 GigabitEthernet0/0 192.1.12.2 ! |
R02:
! ip vrf VPN_A rd 100:1 ! ip vrf VPN_B rd 100:2 ! interface GigabitEthernet0/0 ip vrf forwarding VPN_A ip address 192.1.12.2 255.255.255.0 ! interface GigabitEthernet0/1 ip vrf forwarding VPN_B ip address 192.1.21.2 255.255.255.0 ! interface Loopback101 ip vrf forwarding VPN_A ip address 172.16.2.2 255.255.255.0 ! interface Loopback102 ip vrf forwarding VPN_B ip address 192.168.2.2 255.255.255.0 ! ip route vrf VPN_A 0.0.0.0 0.0.0.0 192.1.12.1 ip route vrf VPN_B 0.0.0.0 0.0.0.0 192.1.21.1 ! |
Start by checking the VRF interfaces and basic IPv4 connectivity. Notice that the verification commands now use the vrf argument to select the specific routing table.
Let’s look at inter-VRF connectivity in detail. First, check the CEF table for VRF VPN_A in R01.
It appears accurate and complete. Now ping 172.16.2.2 from within VRF VPN_B in R02 and vice-versa.
He is a senior solution network architect and currently working with one of the largest financial company. He has an impressive academic and training background. He has completed his B.Tech and MBA, which makes him both technically and managerial proficient. He has also completed more than 450 online and offline training courses, both in India and ...
More... | Author`s Bog | Book a MeetingWhy do require to use vrf lite anyways ?
Most of the cases it is not required however in some corner cases where you may require to extend your virtual routing table from one router to another then VRF lite is to be configured.
There may be a case when you do not have a budget to have other router for separate routing table then you can divide the router into multiple routing table using VRF and extend that to other router using vrf lite.
Great post with configuration scenario example. I do not have 2 physical links to connect two routers to each other. can this work with sub-interfaces i.e. if router interface is connected to a switch port as trunk port.
Hello Ankit, yes you can configure vrf lite using sub-interfaces of the routers but make sure you have enough bandwidth on these interfaces.