linux 内核 vrf,内核VRF

本文详细介绍了Linux内核的Virtual Routing and Forwarding (VRF) 技术,包括VRF的安装、示例、进程绑定以及VRF的操作。通过创建VRF设备、设置路由规则和绑定网络接口,可以实现多个独立的路由实例。同时,文章还提到了如何将进程绑定到特定的VRF设备,以及如何查看和管理VRF的邻接表和路由信息。
摘要由CSDN通过智能技术生成

Virtual Routing and Forwarding (VRF)

Linux内核的Virtual Routing and Forwarding (VRF) 是由路由表和一组网络设备组成的路由实例。

VRF安装

Ubuntu默认不包括vrf内核模块,需要额外安装:

apt-get install linux-headers-4.10.0-14-generic linux-image-extra-4.10.0-14-generic

reboot

apt-get install linux-image-extra-$(uname -r)

modprobe vrf

VRF示例

# create vrf device

ip link add vrf-blue type vrf table 10

ip link set dev vrf-blue up

# An l3mdev FIB rule directs lookups to the table associated with the device.

# A single l3mdev rule is sufficient for all VRFs.

# Prior to the v4.8 kernel iif and oif rules are needed for each VRF device:

ip ru add oif vrf-blue table 10

ip ru add iif vrf-blue table 10

#Set the default route for the table (and hence default route for the VRF).

ip route add table 10 unreachable default

# Enslave L3 interfa

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值