linux bond 网卡绑定配置步骤,七种bond模式说明
一、网卡绑定:
第一步:创建一个ifcfg-bondX
# vi /etc/work-scripts/ifcfg-bond0
DEVICE=bond0
BONDING_OPTS="mode=0 miimon=100"
BOOTPROTO=none
ONBOOT=yes
BROADCAST=
IPADDR=
NETMASK=
NETWORK=
USERCTL=no
BONDING_OPTS="mode=0 miimon=100" ,mode有多种模式实现不同的功能,
第二步:修改/etc/work-scripts /ifcfg-ethX
# vi /etc/work-scripts /ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
# vi /etc/work-scripts /ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
第三步:配置/etc/,添加alias bond0 bonding
alias scsi_hostadapter mptbase
alias scsi_hostadapter1 mptspi
alias scsi_hostadapter2 ata_piix
alias scsi_hostadapter3 ahci
-pf-10 off
alias ipv6 off
options ipv6 disable=1
alias eth0 b0 后面分组的名字,eth0 和 eth3 对应的是bond0
alias eth1 b1
alias eth2 e1000
alias eth3 b0
alias eth4 b1
alias bond0 bonding
alias bond1 bonding
options bond0 miimon=100 mode=1 primary=eth0
options bond1 miimon=100 mode=1 primary=eth1
#options bonding max_bonds=2 miimon=200 mode=1
第四步:重启网络服务
#work restart
通过查看//bonding/bond0,查看当前是用什么mode,如果是主备的话,当前是哪个网卡工作。
cat //bonding/bond0
Channel Bonding Driver: -1 (October 7, 2008)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: eth0 (primary_reselect always)
C
bound详解 来自淘豆网www.taodocs.com转载请标明出处.