B o n d i n g I n t e r f a c e s
/etc/sysconfig/network-scripts/
ifcfg-bond0 interface configuration file
DEVICE=bond0IPADDR=192.168.1.1NETMASK=255.255.255.0GATEWAY=192.168.1.254ONBOOT=yesBOOTPROTO=noneUSERCTL=noNM_CONTROLLED=noBONDING_OPTS="miimon=X mode=X"#bonding parameters separated by spaces
"
说明:
miimon=100
miimon是指多久时间要检查网路一次,单位是ms(毫秒)
这边的100,是100ms,即是0.1秒
意思是假设其中有一条网路断线,会在0.1秒内自动备援
mode共有七种(0~6)
mode=0:平衡负载模式,有自动备援,但需要”Switch”支援及设定。
mode=1:自动备援模式,其中一条线若断线,其他线路将会自动备援。
mode=4:LACP is referred to in linux as bonding mode 4 =>
所以也能用BOND做LACP
mode=6:平衡负载模式,有自动备援,不必”Switch”支援及设定。
For example, if two Ethernet interfaces are being channel bonded, both
eth0 and
eth1 may look like the following example:
DEVICE=ethN
BOOTPROTO=noneONBOOT=yesMASTER=bond0SLAVE=yesUSERCTL=noNM_CONTROLLED=no
建议不指定MAC地址,可以#注释。
To ensure that the module is loaded when the channel bonding interface is brought up, create a new file as root named
bonding.conf in the
/etc/modprobe.d/ directory
alias bond
N
bonding
备注:
不添加NM_CONTROLLED = no,会被NetManager监控,导致两个端口FAILD,bond提示“bond0 connection ativation failed:device not managed by networkmanager”