wt020 发表于 2008-2-4 18:57:28

模拟6WAN口的汇聚、分流方案

看了很多做汇聚、分流的方法,各说说有理,没一个完好的方案,全汇聚的游戏掉线,分流的又起不到WAN流量叠加。想了半天,我搞了个折中方案,用Nth+random,单线程应用的就一个WAN,多线程的应用才多WAN汇聚,下面我只把实现这功能的测试脚本发上来,大家试试看,直接导入运行,不会影响你原来的ROS工作,你只需到ip firewall address-list中看运行结果,有IP_01到IP_06的地址列表,这些列表内容相互没有重复的,能做到这样,剩下的只是加路由标记,建几个路由就行了,如果还想进一步流量匀衡,我想只需做个检测脚本,哪个WAN口超出限制流量,就减少对应的那条路由标记的 random值,反之增加。我没条件试,只给大家一个思路,大家试试看是还可行。

/ip firewall mangle
#dst-address=!10.0.0.0/8是我的内网IP段,改成你的就行了
add chain=prerouting dst-address=!10.0.0.0/8 connection-state=new nth=5,6,0 action=mark-connection new-connection-mark=IP-01 passthrough=yes

add chain=preroutingrandom=16 dst-address-list=!IP_00 connection-mark=IP-01 action=add-dst-to-address-list address-list=IP_01 address-list-timeout=1m

add chain=prerouting connection-mark=IP-01 dst-address-list=IP_01 action=add-dst-to-address-list address-list=IP_00 address-list-timeout=1m

add chain=prerouting nth=5,6,1 action=mark-connection new-connection-mark=IP-02 passthrough=yes

add chain=preroutingrandom=16 dst-address-list=!IP_00 connection-mark=IP-02 action=add-dst-to-address-list address-list=IP_02 address-list-timeout=1m

add chain=prerouting connection-mark=IP-02 dst-address-list=IP_02 action=add-dst-to-address-list address-list=IP_00 address-list-timeout=1m

add chain=prerouting nth=5,6,2 action=mark-connection new-connection-mark=IP-03 passthrough=yes

add chain=preroutingrandom=16 dst-address-list=!IP_00 connection-mark=IP-03 action=add-dst-to-address-list address-list=IP_03 address-list-timeout=1m

add chain=prerouting connection-mark=IP-03 dst-address-list=IP_03 action=add-dst-to-address-list address-list=IP_00 address-list-timeout=1m

add chain=prerouting nth=5,6,3 action=mark-connection new-connection-mark=IP-04 passthrough=yes

add chain=preroutingrandom=16 dst-address-list=!IP_00 connection-mark=IP-04 action=add-dst-to-address-list address-list=IP_04 address-list-timeout=1m

add chain=prerouting connection-mark=IP-04 dst-address-list=IP_04 action=add-dst-to-address-list address-list=IP_00 address-list-timeout=1m

add chain=prerouting nth=5,6,4 action=mark-connection new-connection-mark=IP-05 passthrough=yes

add chain=preroutingrandom=16 dst-address-list=!IP_00 connection-mark=IP-05 action=add-dst-to-address-list address-list=IP_05 address-list-timeout=1m

add chain=prerouting connection-mark=IP-05 dst-address-list=IP_05 action=add-dst-to-address-list address-list=IP_00 address-list-timeout=1m

add chain=prerouting nth=5,6,5 action=mark-connection new-connection-mark=IP-06 passthrough=yes

add chain=preroutingrandom=20 dst-address-list=!IP_00 connection-mark=IP-06 action=add-dst-to-address-list address-list=IP_06 address-list-timeout=1m

add chain=prerouting connection-mark=IP-06 dst-address-list=IP_06 action=add-dst-to-address-list address-list=IP_00 address-list-timeout=1m

chen597 发表于 2008-2-5 14:36:07

:o :o 我用NTH 用负载和分流切换都不错,游戏也不会掉线.

wwjun 发表于 2008-2-7 01:48:29

Nth+random能判断出应用的线程是多少吗?
做负载不需要NTH也不需要RANDOM。
按网关逗号的做法再加些连接的控制就行了,一条线路两条语句就搞掂了。

ee007 发表于 2008-2-7 02:02:01

原帖由 wwjun 于 2008-2-7 01:48 发表 http://bbs.routerclub.com/images/common/back.gif
Nth+random能判断出应用的线程是多少吗?
做负载不需要NTH也不需要RANDOM。
按网关逗号的做法再加些连接的控制就行了,一条线路两条语句就搞掂了。

具体一点的方法???

golxk 发表于 2008-2-10 04:45:00

记号

日后再读

nnmtan 发表于 2008-2-11 23:22:02

我是南宁的,真正的20wan口负载均衡一直正常使用,真正感兴趣的朋友可现场观摩。QQ:236053168   nnmtan@163.com

artrcl 发表于 2008-2-18 01:11:06

原帖由 nnmtan 于 2008-2-11 23:22 发表 http://bbs.routerclub.com/images/common/back.gif
我是南宁的,真正的20wan口负载均衡一直正常使用,真正感兴趣的朋友可现场观摩。QQ:236053168   nnmtan@163.com

这位老兄能否详细说明。多谢了

LUYOKY 发表于 2008-2-18 02:51:07

就100wan的没试过.

luzai 发表于 2008-4-22 21:18:45

:Q :Q :Q :Q :Q

heroufo 发表于 2008-4-22 21:36:12

多条动态ADSL如何做到负载均衡?

qinlulu3 发表于 2008-4-22 23:36:09

原帖由 nnmtan 于 2008-2-11 23:22 发表 http://bbs.routerclub.com/images/common/back.gif
我是南宁的,真正的20wan口负载均衡一直正常使用,真正感兴趣的朋友可现场观摩。QQ:236053168   nnmtan@163.com
你有扯20 个AD的钱也够搞个光纤了吧:L :L

tpy372 发表于 2008-4-23 10:35:54

原帖由 qinlulu3 于 2008-4-22 23:36 发表 http://bbs.routerclub.com/images/common/back.gif

你有扯20 个AD的钱也够搞个光纤了吧:L :L
价钱可差老远了....

bensonhb 发表于 2008-4-23 11:58:40

学习一下,收藏咯!!!!

jykgcx 发表于 2008-5-7 16:16:25

:)

nnmtan 发表于 2008-5-21 09:23:21

已成功商用多WAN口线路聚合方案,详细介绍:http://router.cn.blog.163.com/
页: [1] 2
查看完整版本: 模拟6WAN口的汇聚、分流方案