Virtual Routing and Forwarding¶
Virtual Routing and Forwarding (VRFs) are a way to split a router into multiple logically split routers. This leads to the possibility of having multiple isolated routing tables running on the same router. VRFs can be described as analogous to VLANs, just operating on Layer 3 instead of 2.
Configuring VRFs¶
Configuring VRFs is somewhat straightforward on VyOS routers. Most commands that can be used to configure functionality on the router can be replicated in VRFs, by prepending the VRF name. What is unique is the need to define the routing table to be used, e.g:
set vrf name <VRF name> table <Table integer>
set vrf name protocol bgp parameter router-id <loopback> (example)
Interfaces can be defined as belonging to a VRF with the command:
Export of VRF BGP routes¶
To share routes from a VRF and retain their uniqueness and identifiability in a broader networking context, routes need to be assigned a RD. Setting RDs for routes exported from a VRF can be done using:
Selecting which route-targets are set for a vrf can be done with:
When the routes are identifiable and exported to targets, they can be exported into the MPLS VPN domain of the router:
set vrf name X protocol bgp address-family ipv4-unicast label vpn export auto
set vrf name X protocol bgp address-family ipv4-unicast import|export vpn
They can then be communicated by BGP using the address-family ipv4-vpn.