双网卡bonding配置,实现负载均衡

仅供存放个人的配置文件,不要在本版发问。
头像
sinoyster
帖子: 958
注册时间: 2005-10-16 13:24
来自: 四川成都
联系:

双网卡bonding配置,实现负载均衡

#1

帖子 sinoyster » 2006-11-07 17:23

/etc/network/interfaces
auto lo
iface lo inet loopback

iface eth0 inet dhcp
iface eth1 inet dhcp

auto bond0
iface bond0 inet static
address 64.0.177.20
netmask 255.255.255.0
gateway 64.0.177.254
up ifenslave bond0 eth0 eth1
down ifenslave -d bond0 eth0 eth1

/etc/modules中添加
bonding
Thank you Ubuntu Team!!!!
I still can't belive this is free...
雕啸长空
帖子: 1897
注册时间: 2006-09-12 14:09

#2

帖子 雕啸长空 » 2007-01-28 0:01

当年在windows下搞过三网卡阵列 ,性能所有提 升,不过实在是麻烦,那时就听说linux下多网卡阵列很简便,今天终于得见 :D
Fair winds and following seas !
mrsteven
帖子: 3
注册时间: 2007-02-02 14:21

Re: 双网卡bonding配置,实现负载均衡

#3

帖子 mrsteven » 2007-02-02 20:28

sinoyster 写了:/etc/network/interfaces
auto lo
iface lo inet loopback

iface eth0 inet dhcp
iface eth1 inet dhcp

auto bond0
iface bond0 inet static
address 64.0.177.20
netmask 255.255.255.0
gateway 64.0.177.254
up ifenslave bond0 eth0 eth1
down ifenslave -d bond0 eth0 eth1

/etc/modules中添加
bonding
新建立ubuntu系统,请问

/etc/modules中添加
bonding

这句是要写一个bonding文本文档的意思吗?我的ubuntu系统没有发现/etc/modules这个目录,是否要在/etc/目录建一个modules目录,然后把
auto lo
iface lo inet loopback

iface eth0 inet dhcp
iface eth1 inet dhcp

auto bond0
iface bond0 inet static
address 64.0.177.20
netmask 255.255.255.0
gateway 64.0.177.254
up ifenslave bond0 eth0 eth1
down ifenslave -d bond0 eth0 eth1

这段代码写入bonding?bonding应存档为什么格式?另外在ubuntu系统下,网卡能象windows xp系统那样编辑传送接收缓存及连网速率、MTU等参数吗?请指教一下ubuntu系统下网卡可以做些什么优化加速的设置,比如象cfosspeed
http://www.cfos.de/beta/


谢谢。
mrsteven
帖子: 3
注册时间: 2007-02-02 14:21

Re: 双网卡bonding配置,实现负载均衡

#4

帖子 mrsteven » 2007-02-05 23:05

sinoyster 写了:/etc/network/interfaces
auto lo
iface lo inet loopback

iface eth0 inet dhcp
iface eth1 inet dhcp

auto bond0
iface bond0 inet static
address 64.0.177.20
netmask 255.255.255.0
gateway 64.0.177.254
up ifenslave bond0 eth0 eth1
down ifenslave -d bond0 eth0 eth1

/etc/modules中添加
bonding
在modules文档末添加bonding,重新启动电脑,不能上互联网,删除bonding则可上互联网,请问应如何配置才能开启双网卡bonding实现负载均衡?如果是三块以上的网卡配置有否不同?谢谢。
icyleaf1026
帖子: 86
注册时间: 2007-02-03 4:04
来自: 四川

#5

帖子 icyleaf1026 » 2007-02-09 0:30

没人回这个贴吗??
头像
sinoyster
帖子: 958
注册时间: 2005-10-16 13:24
来自: 四川成都
联系:

#6

帖子 sinoyster » 2007-03-15 15:04

/etc/modules是文件,里面加个bonding就可以了

/etc/network/interfaces
auto lo
iface lo inet loopback

iface eth0 inet dhcp
iface eth1 inet dhcp

auto bond0
iface bond0 inet static
address 64.0.177.20
netmask 255.255.255.0
gateway 64.0.177.254
up ifenslave bond0 eth0 eth1
down ifenslave -d bond0 eth0 eth1
上面这一段是在/etc/network/interfaces里面做修改的
Thank you Ubuntu Team!!!!
I still can't belive this is free...
Jennal
帖子: 57
注册时间: 2006-09-27 9:07
联系:

#7

帖子 Jennal » 2007-05-09 13:14

重点是这段吧?
auto bond0
iface bond0 inet static
address 64.0.177.20
netmask 255.255.255.0
gateway 64.0.177.254
up ifenslave bond0 eth0 eth1
down ifenslave -d bond0 eth0 eth1
不过不是很明白,能不能解释一下每一句的意思?是通用的吗?
Wanna work without windows...
Jennal
帖子: 57
注册时间: 2006-09-27 9:07
联系:

#8

帖子 Jennal » 2007-05-09 13:55

按照楼主的设置不行阿。。。
Failed to bring up bond0.
发现是没有装ifenslave
sudo apt-get install ifenslave-2.6
然后出现跟楼上兄弟一样的情况。。。不能上网。。。去掉bonding就行了
Wanna work without windows...
loesprite
帖子: 23
注册时间: 2006-05-11 9:19

#9

帖子 loesprite » 2007-07-16 14:57

这个技术很有吸引力,关注中!
头像
蓝蓝
帖子: 953
注册时间: 2007-06-09 9:19
来自: 上海

#10

帖子 蓝蓝 » 2007-07-28 18:46

速度很快么?
太阳好毒…….
gzprof
帖子: 5
注册时间: 2007-08-06 10:56

解决DNS

#11

帖子 gzprof » 2007-08-06 11:01

不能上网是没有解决DNS问题

auto lo
iface lo inet loopback

iface eth0 inet dhcp
iface eth1 inet dhcp
iface bond0 inet dhcp
#iface bond0 inet static
#address 64.0.177.20
#netmask 255.255.255.0
#gateway 64.0.177.254
#nameserver …… ……

auto bond0
up ifenslave bond0 eth0 eth1
down ifenslave -d bond0 eth0 eth1
在DHCP情况下不用设置DNS,静态IP地址就必须设置nameserver,例如
nameserver 202.96.128.68 202.96.134.133
gzprof
帖子: 5
注册时间: 2007-08-06 10:56

静态IP地址情况下设置

#12

帖子 gzprof » 2007-08-06 11:03

auto lo
iface lo inet loopback

iface eth0 inet static
address 172.16.1.149
netmask 255.255.255.0
gateway 172.16.1.11
iface eth1 inet static
address 172.16.1.146
netmask 255.255.255.0
gateway 172.16.1.11

iface bond0 inet static
address 172.16.1.149
netmask 255.255.255.0
gateway 172.16.1.11
nameserver 202.96.128.68 202.96.134.133

auto bond0
up ifenslave bond0 eth0 eth1
down ifenslave -d bond0 eth0 eth1
gzprof
帖子: 5
注册时间: 2007-08-06 10:56

如果DNS没有问题就是路由问题

#13

帖子 gzprof » 2007-08-07 13:24

route add default gw 172.16.1.11 -dev bond0
这样内外网络应该可以访问了。
头像
euking
帖子: 74
注册时间: 2005-08-23 0:42

#14

帖子 euking » 2007-08-19 9:39

关注一下!
狼牧
帖子: 4
注册时间: 2007-09-01 14:57

#15

帖子 狼牧 » 2007-09-09 13:47

lz应该说一下为什么要这么做,让我等新手也能明白这样做的好处。
回复