歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> CentOS 6中配置Bond多網卡負載均衡

CentOS 6中配置Bond多網卡負載均衡

日期:2017/2/28 15:53:57   编辑:Linux教程

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 配置交換機的端口,將與服務器連接的端口加入到一個端口聚合組中

Copyright © Linux教程網 All Rights Reserved