天天看点

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地址可以注释

MASTER=bond0

SLAVE=yes

IPV6INIT=no

### 查看ifcfg-eth1

DEVICE=eth1

#HWADDR=00:0c:29:a8:19:d5  #MAC地址可以注释

 #创建或修改模块文件

  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

上一篇: BOND linux
下一篇: 网卡bond实战