ipvlan-l3s模式

本文探讨ipvlan的L3S模式,该模式在网络协议处理中起到关键作用,尤其适用于多租户NAT场景。L3S模式与L3模式在代码实现上存在显著差异,它在接收到报文后直接进入内核协议栈,通过自定义路由查找方式确定slave接口,并在相应netns中进行路由查找。与L3模式相比,L3S模式在nat场景下不经过完整的协议栈,限制了DNAT操作的可能性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ipvlan 三种模式,l2、l3、l3s,前两种网上资料很多,但第三种却很少,自己看了下代码记录一下。
为什么要看ipvlan?它特别适合做多租户nat场景,这种场景下,用户的内网VPC地址网段可能是重叠的,需要使用net namespace、vrf等手段隔离路由,但通常公网网卡和公网网关就一个,且网关地址和用户公网地址通常不是一个网段的,也就是说不能放到一个二层中。但使用ipvlan l3 mode可以解决这个问题。到此为止,有时间写一下用法,继续l3s mode。
附英文注释:

4.1 L2 mode:
	In this mode TX processing happens on the stack instance attached to the
slave device and packets are switched and queued to the master device to send
out. In this mode the slaves will RX/TX multicast and broadcast (if applicable)
as well.

4.2 L3 mode:
	In this mode TX processing up to L3 happens on the stack instance attached
to the slave device and packets are switched to the stack instance of the
master device for the L2 processing and routing from that instance will be
used before packets are queued on the outbound device. In this mode the slaves
will not receive nor can send multicast / broadcast tr
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值