What Is a VRF (Virtual Routing and Forwarding) and How Does Network Virtualization Work?

What Is a VRF (Virtual Routing and Forwarding) and How Does Network Virtualization Work?

Many times I’ve been asked by people both in and out of the networking field questions about VRFs. What is a VRF and how is it used?

Definition:

VRF is an Acronym

VRF stands for Virtual Routing and Forwarding.

VRF Image
VRF Image

Virtualization and networking

In networking we’ve been doing virtualization for quite a while. Think of virtual in the same sense of a Virtual Machine and think of a router or switch as a Hypervisor or Host.

Break it apart

An easy way to think of a VRF is by treating each VRF as its own independent virtual router. A VRF partitions the routing table between two different parts of a network. For instance, a network may have a public and private zone. When this occurs you may have 3 different VRFs.

  1. Management VRF
  2. Public VRF
  3. Private VRF
Shattered Glass
Shattered Glass

Without a VRF we would end up with 3 different routers. The whole point of VRF technology is to save money and instead of buying 3 routers, we only need one router.

Security with VRFs

Typically in networking, we view security in a sense of, if you can’t talk to it, then you can’t break into it. With VRFs this limits the ability for something in one VRF to talk to something in another VRF (there are exceptions here like route leaking but for the most part this is the case).

VRF terminology in Cisco, Cumulus, Juniper, and Linux

  • Cisco IOS / NX-OS: vrf
  • Cumulus Linux / FRR: vrf
  • Juniper Junos OS: routing-instance
  • Linux Kernel (iproute2): ip rule / routing table & VRF device

Contributing:

As always if you know of something that I’ve left out or if you have any suggestions drop me a comment and I will modify this post as to help the next person that stumbles across this blog.

>_ Engineering Discussion 3 Comments

+ Add Field Note ↓
  1. ↗ Cumulus Linux 3.6 Release Highlights: EVPN, FRR & Netshow — Nertwork Cross-Reference

    […] Building on our VRF routing table isolation deep dive, Cumulus Linux 3.6 expands native VRF and EVPN scale […]

  2. Best concise explanation of VRF-Lite vs MP-BGP MPLS VPNs I've read. Binding management interfaces into vrf mgmt on Linux and Junos has saved us from out-of-band routing leaks more than once.

  3. Using ip route show vrf and ip vrf exec in modern Linux kernels makes multi-tenant routing table isolation feel just like hardware VRF instances on Arista or Juniper.

Leave a Technical Comment

Share CLI tips, hardware notes, or questions below. Inline backticks (`command`) are supported.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Engineering Notes