Account Links: Cart | Register | Log In

Skip to content

Red Hat Knowledgebase
Red Hat Knowledgebase Search
Article translations:
Currently Being Moderated

在红帽企业版3上面,如何实现多块网卡的绑定(bonding)功能?

Article ID: 12071 - Created on: Jul 22, 2008 6:00 PM - Last Modified:  Oct 10, 2008 3:17 PM

[英文原文] How can I bond multiple network interfaces (bonding) together into a single channel in Red Hat Enterprise Linux 3?

 

在红帽企业版Linux里面,通过bonding内核模块和一个特殊的网络接口来实现多网卡的绑定功能。将多块网卡绑定为一块网卡,可以增加网络带宽,提供冗余。

 

要创建一个bonding接口,首先,在目录/etc/sysconfig/network-scripts/下建立一个文件ifcfg-bond

<N>,用网络接口号来代替N,例如0。

文件ifcfg-bond<N>的内容跟要绑定的接口的配置基本相同。唯一的不同是 DEVICE=必须是bond<N>
,用网络接口号来代替N。

 

下面是一个ifcfg-bond0示例配置文件:

 



DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
NETWORK=10.0.1.0
NETMASK=255.255.255.0
IPADDR=10.0.1.27
USERCTL=no

 

Bonding接口创建以后,被绑定的网卡必须在它们的配置文件里面添加MASTER=和SLAVE=两个参数。每个bonding接口的配置基本相同。

 

例如,如果绑定两块以太网卡eth0和eth1,它们的配置文件如下:

 



DEVICE=eth<N>
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

 

用网络接口号代替

<N>

 

在使bonding接口生效之前,必须要确认系统内核已装载bonding模块。如何装载bonding模块,红帽企业版3和红帽企业版4有一点不一样。

 

对于红帽企业版3:

 

在/etc/modules.conf文件里面添加一行:

 



alias bond<N> bonding

 

使用网络接口号代替

<N>
,例如0。对于绑定的别名,除了bond0以外,还需要添加一行:

 



options bond<N> -o bonding<N>

 

对于每个bonding接口,必须在/etc/modules.conf里面有对应的配置。

 

配置完/etc/modules.conf文件,bonding接口和网络接口以后,可以使用ifup命令启动bonding接口,或者重新启动网络服务。

 

更多参考信息:

 

 

 

Feedback from users like yourself is a critical factor in helping us make the Red Hat Knowledgebase as useful as possible.

More Like This

  • Retrieving data ...