Chinaunix首页 | 论坛 | 博客
  • 博客访问: 988075
  • 博文数量: 195
  • 博客积分: 4890
  • 博客等级: 上校
  • 技术积分: 2221
  • 用 户 组: 普通用户
  • 注册时间: 2009-06-09 15:34
文章分类

全部博文(195)

文章存档

2014年(1)

2013年(8)

2012年(22)

2011年(9)

2010年(54)

2009年(101)

我的朋友

分类: LINUX

2009-08-29 08:40:57

LINUX网卡绑定聚合设置

1.建立虚拟网络接口配置文件:ifcfg-bond0

cd /etc/sysconfig/ network-scripts/

[root@rhas-13 root]# vi ifcfg-bond0      (建立ifcfg-bond0文件)

 

2.编辑虚拟网络接口配置文件

#vi ifcfg-bond0 

将第一行改成 DEVICE=bond0 

# cat ifcfg-bond0

DEVICE=bond0

BOOTPROTO=static

IPADDR=192.168.113.55

NETMASK=255.255.255.0

ONBOOT=yes

MAST=bond0

 

这里要主意,不要指定单个网卡的IP 地址、子网掩码或网卡 ID。将上述信息指定到虚拟适配器(bonding)中即可。

[root@rhas-13 network-scripts]# cat ifcfg-eth1 

DEVICE=eth1

BOOTPROTO=no

ONBOOT=yes

MASTER=bond0

USERCTL=no

 

[root@rhas-13 network-scripts]# cat ifcfg-eth2 

DEVICE=eth2

BOOTPROTO=no

ONBOOT=yes

MASTER=bond0

USERCTL=no

 

3 设置启动时加载绑定模块

# vi /etc/modules.conf 

编辑 /etc/modules.conf 文件,加入如下一行内容,以使系统在启动时加载bonding模块,对外虚拟网络接口设备为 bond0 

 

加入下列两行 

alias bond0 bonding

options bond0  miimon=100 mode=0

 

说明:miimon是用来进行链路监测的。 比如:miimon=100,那么系统每100ms监测一次链路连接状态,如果有一条线路不通就转入另一条线路;mode的值表示工作模式,他共有01,2,3四种模式,常用的为0,1两种。

   mode=0表示load balancing (round-robin)为负载均衡方式,两块网卡都工作。

   mode=1表示fault-tolerance (active-backup)提供冗余功能,工作方式是主备的工作方式,也就是说默认情况下只有一块网卡工作,另一块做备份.  

bonding只能提供链路监测,即从主机到交换机的链路是否接通。如果只是交换机对外的链路down掉了,而交换机本身并没有故障,那么bonding会认为链路没有问题而继续使用

 

4 # vi /etc/rc.d/rc.local 

加入

ifenslave bond0 eth1 eth2

 

 

到这时已经配置完毕重新启动机器.

重启会看见以下信息就表示配置成功了

................ 

Bringing up interface bond0 OK 

Bringing up interface eth0 OK 

Bringing up interface eth1 OK 

阅读(829) | 评论(0) | 转发(0) |
0

上一篇:红帽防伪证书说明

下一篇:空间太小

给主人留下些什么吧!~~