| |
| 多网卡bonding一个IP |
|
| 来源:
ChinaUnix博客 日期:
2008.03.31 16:01 (共有条评论) 我要评论 |
| |
首先是你要内核支持,如果不支持,请你自己重新编译,在编译的时候把网络设备选项中的Bonding driver support选中就可以了。
modprobe bonding
ifconfig eth0 down
ifconfig eth1 down
#ifconfig bond0 ipaddress
ifconfig bond0 ip地址 netmask 子网掩码> broadcast 广播地址>
ifenslave bond0 eth0
ifenslave bond0 eth1
现在两块网卡已经象一块一样工作了.这样可以提高集群节点间的数据传输.
其中,可以指定绑定的模式,比如:
modprobe bonding mode=balance-rr miimon=100
其中,mode=balance-rr为负载均衡;mode=active-backup为互备份模式,如果还要使用互备模式,需要加上参数primary=ethx,比如:
modprobe bonding mode=active-backup miimon=100 primary=eth0
其中eth0,eth1是两块物理网卡。
停止bonding
ifenslave -d bond0 eth0
ifenslave -d bond0 eth1
ifconfig bond0 down
modprobe -r bonding
绑定多个bonding
如果系统存在多块网卡,eth0,eth1,eth2,eth3,我们现在希望估两两做备份,如果以前的方法加载bonding模块,这样在系统就可以配置
多个bonding了,需要在加载bonding的时候加载一个参数,max_bonds,比如:
modprobe bonding max_bonds=2
在SUSE中,可以将bonding模块做个别名设置多个bond设备,编辑/etc/modprobe.conf.local文件,加入如下内容:
alias bond0 bonding
options bonding mod=blance-rr miimon=100 max_bonds=2
alias bond1 bonding
options bonding mod=active-backup miimon=100 primary=eth2 max_bonds=2
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/47765/showart_512844.html
|
| 发表评论
查看评论(共有条评论)
我要提问
|
| |
|
|
|