Linux系统中bond模式详解

最近接触的大二层项目中,接触到了Linux的bond模式,一共有7类分别是0-6

mode=0
平衡轮询策略:轮流使用每个接口来发送接收数据包,需要交换机支持,由于交换机不能识别多个同一个MAC地址对应多个端口,需要做链路聚合

mode=1
主备策略:只使用其中一块网卡,当发生故障后启用另外一块

mode=2
平衡策略:基于锁选的传送hash进行策略

mode=3
广播策略:所有网卡都收发报文,提高了容错性

mode=4
802.3ad(链路聚合):LACP链路聚合模式,需要交换机支持和服务器硬件支持ethtool

mode=5
自适应传输负载均衡:不需要交换机支持,每个网卡根据当前负载情况来分配流量

mode=6
自适应负载均衡:不需要交换机支持,通过ARP协商实现

配置实现:使用nmcli方式

mncli connection add type bond ifname bond1 mode 1
nmcli connection add type bond-slave ifname em1 master bond1
mncli connection add type bond-slave ifname em2 master bond1
mncli connection add type bond-slave ifname em3 master bond1
在/etc/sysconfig/network-scripts/中修改bond的信息
重启网卡 systemctl restart network


发表评论

您的电子邮箱地址不会被公开。

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据