您的位置:首页 > 运维架构 > Linux

CentOS 6中配置bond多网卡负载均衡

2013-07-01 14:01 489 查看
安装bonding模块

[root@dengyw ~]# modprobe bonding

[root@dengyw ~]# lsmod |grep bonding

bonding 102210 0

ipv6 264702 30 bonding,sit,ip6t_REJECT,nf_conntrack_ipv6

1 设置开机加载bonding模块

vi /etc/modprobe.d/bonding.conf 加入以下两行:

alias bond0 bonding

options bond0 miimon=100 mode=0 #mode0表示负载均衡

2 修改网卡配置文件

cd /etc/sysconfig/network-scripts/ ,新建ifcfg-bond0文件 ,内容如下:

DEVICE=bond0

IPADDR=192.168.106.162

NETMASK=255.255.255.0

NETWORK=192.168.106.0

ONBOOT=yes

NAME=bond0

BOOTPROTO=none

USERCTL=no

GATEWAY=192.168.106.254

修改想要做成bond的网卡的配置文件,如ifcfg-eth0、ifcfg-eth1,内容分别如下:

DEVICE=eth0

ONBOOT=yes

BOOTPROTO=none

USERCTL=no

MASTER=bond0

SLAVE=yes

DEVICE=eth1

ONBOOT=yes

BOOTPROTO=none

USERCTL=no

MASTER=bond0

SLAVE=yes

3 重启系统,使配置生效

4 配置交换机的端口,将与服务器连接的端口加入到一个端口聚合组中
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: