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