One router can keep several completely separate routing tables. VRF-Lite does this without MPLS. With BGP inside a VRF, one router can serve several customers or tenants, even if they use the same addresses.
Advanced · 13 min read
You'll learn to define a VRF, assign an interface to it, configure BGP in the VRF address family, and verify with the vrf keyword.
Several routing tables on one router
A VRF (virtual routing and forwarding instance) is a separate routing table with its own interfaces. Two VRFs can contain 198.51.100.0/24 at the same time without clashing. VRF-Lite uses VRFs without MPLS: each VRF is joined to the next router over its own link or VLAN sub-interface.
BGP with VRF-Lite: two customers, two separate tables on one router
On small screens, swipe sideways or focus the diagram and use the arrow keys.
Each VRF is a separate routing table on the same hardware. The BGP session lives inside one VRF and never sees the other.
Two VRFs on one router, each with its own BGP session
On small screens, swipe sideways or focus the diagram and use the arrow keys.
Each neighbour is configured under its VRF address family. The same prefix can exist in both VRFs without clashing.
Configure the VRF and its BGP session
In this example R1 serves a customer (AS 64510) in a VRF called CUST-A. The customer link is a new interface in the VRF; the course ISP links stay in the global table.
Order of configuration
On small screens, swipe sideways or focus the diagram and use the arrow keys.
Moving an interface into a VRF removes its address, so set the address afterwards.
vrf definition CUST-A
rd 64500:1
address-family ipv4
exit-address-family
interface GigabitEthernet0/3
vrf forwarding CUST-A
ip address 192.0.2.9 255.255.255.252
no shutdown
R1. Creating the VRF and assigning the interface removes any address already on the interface, so set the address after vrf forwarding.
The session is Established inside the VRF and one prefix was received. Plain show ip bgp summary would not show this neighbour because it lives in a different table.
Other commands take the same keyword: show ip route vrf CUST-A and ping vrf CUST-A 192.0.2.10. A common beginner error is a ping that fails only because the VRF name was left out.
Verification commands that need vrf
On small screens, swipe sideways or focus the diagram and use the arrow keys.
If a command shows nothing, check you used the vrf form.
A ping to a customer neighbour fails, but the customer interface is up. What did you probably forget?
Predict · scenario 2
Where is the BGP neighbour for a VRF configured?
Predict · scenario 3
You add vrf forwarding to an interface that has an IP address. What happens?
FAQ
What is the difference between VRF-Lite and MPLS VPN?
VRF-Lite keeps separate tables on one router and relies on separate links or sub-interfaces to carry each VRF between routers. MPLS VPN adds labels and MP-BGP to carry many VRFs over one shared core.
What is a route distinguisher for in VRF-Lite?
It makes routes in a VRF unique. Cisco IOS XE requires one for the BGP VRF address family. With VRF-Lite it is a local identifier only.
Why do ping and show ip route need a vrf keyword?
Without the keyword the commands use the global table. A VRF has its own table, so you must name it to see its routes or test its reachability.