RHEL Channel Bonding

1. 添加 kernel 模块

RHEL5上编辑 /etc/modprobe.conf 加入
alias bond0 bonding
options bond0 miimon=100 mode=1
 
RHEL6上新建文件  /etc/modprobe.d/ bond0 .conf 加入
alias bond0 bonding
 
关于 bonding 的参数设置问题,RHEL6中推荐在 /etc/modprobe.d/<bonding>.conf 中配置,/etc/modprobe.conf 已经被标记为deprecate
 

bonding参数:html

miimon值表示两块网卡相互监测的时间,以ms为单位。linux

mode值为工做模式,可设置为高可用仍是负载均衡,0为高可用(默认值),1为负载均衡,另外还有一种XOR模式。web

2. 新增 bond0 配置

DEVICE=bond0
IPADDR=192.168.1.1
NETMASK=255.255.255.0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
BONDING_OPTS=""
MODE=1 MIIMON=1000
#为了上网通常还会加网关和DNS,以下
GATEWAY=192.168.12.1
DNS1=8.8.8.8

3.  修改 em1 em2 配置

注意: RHEL6修改前必须先关闭 服务 NetworkManager ,缘由见4
DEVICE=em
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no<N>

4.  重启网络,使配置生效

RHEL5上 service network restart 便可生效
RHEL6上 service network restart 没法生效, 必须先关闭服务 NetworkManager ,且将其设置为不可自启动
service NetworkManager stop
chkconfig NetworkManager off

 

参考文档:网络

Using Channel Bonding

相关文章
相关标签/搜索