• David Ahern's avatar
    net: Introduce VRF device driver · 193125db
    David Ahern authored
    This driver borrows heavily from IPvlan and teaming drivers.
    
    Routing domains (VRF-lite) are created by instantiating a VRF master
    device with an associated table and enslaving all routed interfaces that
    participate in the domain. As part of the enslavement, all connected
    routes for the enslaved devices are moved to the table associated with
    the VRF device. Outgoing sockets must bind to the VRF device to function.
    
    Standard FIB rules bind the VRF device to tables and regular fib rule
    processing is followed. Routed traffic through the box, is forwarded by
    using the VRF device as the IIF and following the IIF rule to a table
    that is mated with the VRF.
    
    Example:
    
       Create vrf 1:
         ip link add vrf1 type vrf table 5
         ip rule add iif vrf1 table 5
         ip rule add oif vrf1 table 5
         ip route add table 5 prohibit default
         ip link set vrf1 up
    
       Add interface to vrf 1:
         ip link set eth1 master vrf1
    Signed-off-by: default avatarShrijeet Mukherjee <shm@cumulusnetworks.com>
    Signed-off-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    193125db
vrf.c 15.4 KB