redhat6.8链路聚合

centos 6.X   聚合链路


0、查看NetworkManager服务,停止NetworkManager服务。不做这一步很可能出问题
          service NetworkManager status
          service NetworkManager stop

1、修改三类文件
          /etc/sysconfig/network-scripts/下的ifcfg-*文件
          /etc/modprobe.conf 文件   redhat 6.8 :   /etc/modprobe.d/bond0.conf
          /etc/init.d/rc.local 文件

2、编辑虚拟网口配置文件 ,记住此文件复制的时候要把MAC地址去掉,去掉UUID
     vi     /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static 
IPADDR=192.168.1.111
NETMASK=255.255.255.0
GATEWAY=192.168.1.1

3、编辑各网卡的配置文件
     vi /etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=none
TYPE=Ethernet 
DEVICE=em1
ONBOOT=yes
MASTER=bond0
SLAVE=yes

vi /etc/sysconfig/network-scripts/ifcfg-eth1
BOOTPROTO=none
TYPE=Ethernet
DEVICE=em2
ONBOOT=yes
MASTER=bond0
SLAVE=yes

4、修改/etc/modprobe.conf     centos 6.5 是/etc/modprobe.d/bonding.conf    redhat6.8 是/etc/modprobe.d/bond0.conf 
     最后两行加入
alias bond0 bonding
options bond0 miimon=100 mode=6

//     如果有多个bond配置文件,可按如下方式添加
alias bond1 bonding
options bond1 miimon=100 mode=6

注:
(1)、miimon 是链路监测的时间间隔单位是毫秒,miimon=100的意思就是,每100毫秒检测网卡和交换机之     间是否连通,如不通则使用另外的链路。
(2)、mode=0 表示负载均衡方式,两块网卡都工作,需要交换机作支持
      mode=1 表示冗余方式,网卡只有一个工作,一个出问题启用另外的
      mode=6 表示负载均衡方式,两块网卡都工作,不需要交换机作支持

5、修改/etc/rc.d/rc.local,加入以下内容     ,配置了modprobe.conf 可能不再需要配置rc.local
     modprobe bonding miimon=100 mode=0     // 也有加入 ifenslave bond0 eth0 eth1 这种形式
6、service network  restart     // 查看虚拟接口是否起来
     reboot        // 查看是否开机启动

原文地址:https://www.cnblogs.com/jjp816/p/6435012.html