Centos7配置网口捆绑bond

简谈其原理

将多块网卡虚拟成一块来实现冗余,这样对外只显示一张网卡,具有同一个IP。

Linux 多网卡绑定
网卡绑定mode共有七种(0~6) bond0、bond1、bond2、bond3、bond4、bond5、bond6(常用的有三种)
mode=0:平衡负载模式,有自动备援,但需要”Switch”支援及设定。
mode=1:自动备援模式,其中一条线若断线,其他线路将会自动备援。
mode=6:平衡负载模式,有自动备援,不必”Switch”支援及设定

bond0配置步骤

1. cd /etc/sysconfig/network-scripts/ 
2.mv eth0 eth1 /tmp  移除网卡(具体看自己的网卡名称)
3.nmcli con add type bond ifname bond0 mode balance-rr #(balance-rr表示负载均衡)
4.nmcli con add type bond-slave ifname eth0 master bond0 (捆绑网卡1)
5.nmcli con add type bond-slave ifname eth1 master bond0(捆绑网卡2)
6.vim ifcfg-bond-bond0 根据自己上网方式配置网络
7.service network restart
至此bond0捆绑配置完成!

猜你喜欢

转载自blog.csdn.net/kenn_lee/article/details/80681730