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

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);