1.vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
BONDING_OPTS="mode=1 miimon=100"(主备模式)
BOOTPROTO=static
ONBOOT=yes
IPADDR=*.*.*.*
NETMASK=255.255.255.0
GATEWAY=*.*.*.*
NM_CONTROLLED=no
USERCTL=no
TYPE=Ethernet
2.vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0
BOOTPROTO=none
HWADDR=*-*-*-*-*-*(默认mac地址)
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
TYPE=Ethernet
3.vi /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE=eth1
BOOTPROTO=none
HWADDR=*-*-*-*-*-*
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
TYPE=Ethernet
4.vi /etc/modprobe/conf或/etc/modprobe.d/dist.conf或/etc/modprobe.d/bond.conf
alias bond0 bonding
options bond0 miimon=100 mode=1
5.vi /etc/rc.d/rc.local
ifenslave bond0 eth0 eth1
6.service NetworkManager stop #停止服务 chkconfig NetworkManager off #禁用服务
mode=0 负载均衡模式 balance-rr Round-robin
mode=1 主备模式 active-backup
mode=2 平衡策略模式 balance-xor
mode=3 广播策略模式 broadcast
mode=5 适配器传输负载均衡 balance-tlb