码迷,mamicode.com
首页 > 其他好文 > 详细

Centos BOND配置

时间:2015-09-14 16:59:50      阅读:257      评论:0      收藏:0      [点我收藏+]

标签:centos bond配置

#Centos bond

- centos 6.5 bond

-eth0

-eth1

# 创建ifcfg-bond0

/etc/sysconfig/network-scripts/ifcfg-bond0

 

DEVICE=bond0

BOOTPROTO=none

ONBOOT=yes

IPADDR=10.58.11.11

NETMASK=255.255.255.0

NETWORK=10.58.11.0

GATEWAY=10.58.11.254

USERCTL=no

NAME=bond0

### 查看ifcfg-eth0

```
# Intel Corporation 82545EM GigabitEthernet Controller (Copper)  #网卡名字可注释
DEVICE=eth0
BOOTPROTO=static
#HWADDR=00:0C:29:A8:19:CB #MAC地址可以注释
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
IPV6INIT=no
```

### 查看ifcfg-eth1

```
# Intel Corporation 82545EM GigabitEthernet Controller (Copper)  #网卡名字可注释
DEVICE=eth1
BOOTPROTO=static
ONBOOT=yes
#HWADDR=00:0c:29:a8:19:d5  #MAC地址可以注释
MASTER=bond0
SLAVE=yes
USERCTL=no
IPV6INIT=no
```

 #创建或修改模块文件

  vim  /etc/modprode.conf

 

#加载bongding 模块,对外虚拟网络接口设备为bond0,在最后加入以下2行

alias bond0 bongding

options bond0 mode=1 miimon=100

 

 

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

 


##添加自启动

/etc/rc.d/rc.local

ifenslave   bond0 eth0 eth1

 

##检测

###重启网络服务

 

/etc/init.d/network restart

 

## 查看bond0 状态

more  /proc/net/bonding/bond0

 

###查看网口

ifconfig  -a

 

 

 

 

 

 

 

本文出自 “崔瑞洲” 博客,请务必保留此出处http://cuiruizhouok.blog.51cto.com/2909906/1694530

Centos BOND配置

标签:centos bond配置

原文地址:http://cuiruizhouok.blog.51cto.com/2909906/1694530

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!