介绍:
为了使系统的I/O性能能够提升,可以采用bonding技术。bond也就是将多个网卡绑定成一个网卡来提高网络传输速度.Bonding在Linux2.4以上内核中已经包含了,并且利用Bonding技术配置双网卡绑定的前提条件是两块网卡芯片组型号相同,并且都具备独立的BIOS芯片。
详细可以看/usr/src/linux/Documentation/networking/bonding.txt 有详细的步骤.
其配置方法很简单:
1、首先安装ifenslave
# aptitude install ifenslave
2.修改网卡配置(/etc/network/interfaces)
可以参考着修改,网上相关资料很多的
auto lo
iface lo inet loopback
auto bond0
iface bond0 inet static
address 192.168.1.72
netmask 255.255.255.0
gateway 192.168.1.1
pre-up ifconfig bond0 hw ether 00:03:19:18:21:d3
pre-up ifconfig eth0 up && ifconfig eth1 up
up ifenslave bond0 eth0 eth1
down ifenslave bond0 eth0 eth1
post-down ifconfig eth0 down && ifconfig eth1 down
#auto eth0
iface eth0 inet static
address 192.168.1.51
netmask 255.255.255.0
#auto eth1
iface eth1 inet static
address 192.168.1.73
netmask 255.255.255.0
3.在 /etc/modules里面,加入如下内容,以使系统在启动时加载Bonding模块:
alias bond0 bonding
options bond0 mode=0 miimon=100
说明:miimon是用来进行链路监测的。比如:miimon=100,那么系统每100ms监测一次链路连接状态,如果有一条线路不通就转入另一条线路;mode的值表示工作模式,他共有0, 1,2,3四种模式,常用的为0,1两种。mode=0表示load balancing (round-robin)为负载均衡方式,两块网卡都工作。mode=1表示fault-tolerance (active-backup)提供冗余功能,工作方式是主备的工作方式,也就是说默认情况下只有一块网卡工作,另一块做备份。
然后重启网络便可。
# /etc/init.d/networking restart
作者:lxq007
阅读(1470) | 评论(0) | 转发(0) |