You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
net: Introduce VRF device driver
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: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
9972f134a2
commit
193125dbd8
@@ -297,6 +297,13 @@ config NLMON
|
||||
diagnostics, etc. This is mostly intended for developers or support
|
||||
to debug netlink issues. If unsure, say N.
|
||||
|
||||
config NET_VRF
|
||||
tristate "Virtual Routing and Forwarding (Lite)"
|
||||
depends on IP_MULTIPLE_TABLES && IPV6_MULTIPLE_TABLES
|
||||
---help---
|
||||
This option enables the support for mapping interfaces into VRF's. The
|
||||
support enables VRF devices.
|
||||
|
||||
endif # NET_CORE
|
||||
|
||||
config SUNGEM_PHY
|
||||
|
||||
@@ -25,6 +25,7 @@ obj-$(CONFIG_VIRTIO_NET) += virtio_net.o
|
||||
obj-$(CONFIG_VXLAN) += vxlan.o
|
||||
obj-$(CONFIG_GENEVE) += geneve.o
|
||||
obj-$(CONFIG_NLMON) += nlmon.o
|
||||
obj-$(CONFIG_NET_VRF) += vrf.o
|
||||
|
||||
#
|
||||
# Networking Drivers
|
||||
|
||||
685
drivers/net/vrf.c
Normal file
685
drivers/net/vrf.c
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user