Overview¶
VRF is a Virtual Routing and Forwarding framework built on top of Linux network namespaces.
Virtual Routing and Forwarding (VRF) is an IP technology that allows multiple instances of a routing table to work simultaneously within the same router. Thus, overlapping IP addresses do not conflict with each other.
Linux - Fast Path Synchronization - VRF is a compatibility layer between network namespaces and 6WIND VRF. Routing or management daemons use it to configure the kernel and the cache manager to replicate the kernel configuration into the fast path.
Features¶
Overall initialization of VRF instances
API allowing the management of VRF instances at user space level and kernel module level
Dependencies¶
Linux¶
Linux - Fast Path Synchronization - VRF relies on your Linux distribution’s support of network namespaces. The CONFIG_NET_NS variable must be set to yes (y) in the kernel configuration.
For Linux versions lower than 3.12, the following patches are required to allow cross-VRF through IP and IPv6 tunnels:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=0bd8762
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=6c742e7
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=5e6700b
Link-level VRF instances’ identifiers are passed to the user space via the IFLA_AF_SPEC attribute, which requires the following patch:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=f8ff182c716c
libnl3 >= 3.2.25
API¶
Userspace API: libvrf¶
The libvrf library allows to manage and monitor VRF instances.
Initialize:
int libvrf_init(void);
Enter another VRF instance to run subsequent commands within this instance:
int libvrf_change(int vrfid);
Go back to the previous VRF instance:
int libvrf_back(void);
Return the file descriptor bound to a given VRF instance. The value can be used in the netlink API to fill the IFLA_NET_NS_FD attribute.
int libvrf_get_fd(int vrfid);
Iterate over all existing VRF instances and execute the callback function:
int libvrf_iterate(void( *callback)(int vrfid, void *data), void *data);
Initialize the monitoring system:
int libvrf_monitor_init(void);
Monitor adding and removing VRF instances, and call associated callbacks:
int libvrf_monitor_event(void( *add)(int vrfid, void *data),
void( *del)(int vrfid, void *data),
void *data);