CentOS 7 网卡 bond 配置

第一块网卡配置

[root@localhost network-scripts]# cat ifcfg-eth0 
TYPE=Ethernet
BOOTPROTO=none
USERCTL=no
DEVICE=eth0
ONBOOT=yes
NAME=eth0
MASTERR=bond0
SLAVE=yes

第二块网卡配置

[root@localhost network-scripts]# cat ifcfg-eth1
TYPE=Ethernet
BOOTPROTO=none
USERCTL=no
DEVICE=eth1
ONBOOT=yes
NAME=eth1
SLAVE=yes
MASTER=bond0

bond 配置文件

[root@localhost network-scripts]# cat ifcfg-bond0 
TYPE=Bond
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
DEVICE=bond0
NAME=bond0
IPADDR=10.0.20.3
PREFIX=24
GATEWAY=10.0.20.1
NM_CONTROLLED=no
BONDING_MASTER=yes
BONDING_OPTS="mode=1 miimon=100"

bond模式:

  • Mode=0(balance-rr)表示负载分担round-robin
  • Mode=1(active-backup)表示主备模式,只有一块网卡是active,另外一块是备的standby
  • Mode=2(balance-xor)表示XOR Hash负载分担
  • Mode=3(broadcast)表示所有包从所有接口发出,这个不均衡
  • Mode=4(802.3ad)表示支持802.3ad协议,和交换机的聚合LACP方式配合
  • Mode=5(balance-tlb)是根据每个slave的负载情况选择slave进行发送,接收时使用当前轮到的slave
  • Mode=6(balance-alb)在5的tlb基础上增加了rlb。

猜你喜欢

转载自www.cnblogs.com/winstom/p/11949669.html
今日推荐