VRF is same as FIB (personal draft)

What is VRF?

The historical context matters here.

The original term VRF appeared in the MPLS VPN architecture, and RFC 4026 defines it as:

A VRF is a per-site forwarding table.

In other words, a VRF is a per-site FIB.

The RFC continues:

In networks running 2547 VPN's [RFC2547], PE routers maintain VRFs.
Every site to which the PE router is attached is associated with one of these tables.

So a VRF is a FIB associated with a site.

VRF by itself is not especially meaningful without that context. In practice, it became widely known through MPLS, where it describes the routing context used to isolate customer routes.

However, the underlying capability is older than MPLS branding. FreeBSD has supported separate forwarding contexts from early on by way of multiple FIBs. That is the important point: people often assume FreeBSD "does not have VRF," when in fact it has had the underlying model from the beginning, before MPLS VRF terminology became common.

Later, vendors repackaged the same idea under the name VRF-lite, because it was easier for Network Engineers to understand its use case. In practice, VRF-lite is the same operational concept as a separate FIB.

So the relationship is:

That is why engineers often use "VRF" when they really mean a separate forwarding table. Over time, the term was generalized from MPLS to describe the same separation model on non-MPLS systems.

FreeBSD and VRF behavior

FreeBSD already had this model through FIBs. For example:

ifconfig vtnet0 inet 192.168.1.1/24 fib 1
ifconfig vtnet1 inet 192.168.1.1/24 fib 2
route -4 add -net 172.16.0.0/24 -gateway 192.168.1.1 -fib 1
route -4 add -net 172.16.0.0/24 -gateway 192.168.1.1 -fib 2
setfib -F1 ping 172.16.0.1
setfib -F2 ping 172.16.0.1

This is the same practical model people usually want when they ask for VRF-lite behavior.

If route leaking or more advanced policy control is needed, FreeBSD can use mechanisms such as PF or IPFW to influence forwarding decisions.

You want to match based on criteria's like protocol or src/dst? See this IPFW example:

ipfw add 100 setfib 10 udp from 192.168.10.0/24 123 to any in recv vtnet0

If traffic was udp port 123 from source 192.168.10.0/24 and it received from vtnet0 interface, set its FIB to 10.

Linux comparison

Linux uses a different model. It relies on RPDB or Routing Policy Database plus multiple routing tables, rather than forwarding tables in the same sense as FreeBSD.

That is why Linux later introduced a VRF device model: it provides a more direct forwarding-context abstraction than RPDB alone.

The practical takeaway is simple:

FreeBSD did have the VRF-style forwarding model early on, but it was implemented as FIBs rather than under the later VRF label.

spmzt/VRF (last edited 2026-07-30T18:43:57+0000 by spmzt)