1.bond的定义
简单来讲 ,bonding就是把多个物理网络接口绑定到一起,使它们就像一个网络接口那样运行。通过Bonding技术,可以实现网口冗余,负载均衡,从而达到高可用高可靠的目的。
Red Hat Enterprise Linux 允许管理员使用bonding 内核模块和称为通道绑定接口的特殊网络接口将多个网络接口绑定到一个通道。根据选择的绑定模式 , 通道绑定使两个或更多个网络接口作为一个网络接口 , 从而增加带宽和 / 提供冗余性
2.如何设置bond,实现链路聚合?
首先我们需要由两块虚拟网卡的主机,
像这样有两块虚拟网卡eth0 和eth1
在做实验之前 我们需要将之前配置的ip都删掉,保持一个纯净的环境
如下图就行
[[email protected] Desktop]# nmcli connection add con-name bond0 ifname bond0 type bond mode active-backup ip4 172.25.254.20/24 ##建立bond0
[[email protected] Desktop]# watch -n 1 cat /proc/net/bonding/bond0 ##监控
[[email protected] Desktop]# nmcli connection add con-name eth0 ifname eth0 type bond-slave master bond0 ##将eth0加入bond0中
[[email protected] Desktop]# nmcli connection add con-name eth1 ifname eth1 type bond-slave master bond0 ##将eth1加入bond0中
测试
[[email protected] Desktop]# ifconfig eth0 down
[[email protected] Desktop]# ifconfig eth0 up