 鲜花( 0)  鸡蛋( 0)
|
网吧用ROS的个人看法3 t: `" Y( x, Y, M, C$ ^ s
+ V* z: k" V, e5 O
一直以来,都看论坛上的达人说ROS做软路由器效果是多么的强大,于是偶也搞一个试试看。找了一个2.9.27的完全 *** 版,用了2块D-LINK530的网卡,装完一用还真行。比我那1000的锐捷强多了,网吧120台机器,座满的时候那个锐捷的路由器登陆界面都打不开。用上以后问题就来了,我们30M的光纤,如果不限速,那些下载狂人把带宽全部给占用了,打游戏的顾客很有意见。于是我就做了个限速,每个机器下载最大2M.平均1M。但是群众还是不满意,都所卡。我又找资料,pps影音标准版2010下载,发现原来还有个叫智能动态限速的东西,好偶照做。做好以后,平时喊卡的人没有了,人多的时候一样都喊卡。' l B& u9 |' W
偶傻眼了,难道只能不限速。还好天无绝人之路,还有个“小包优先”的高级货,于是照做。结果用简单队列限速后,“小包优先”也是白搭,难道天要忘我。终于经过N次测试以后,魔兽改键精灵4.5下载,我明白了。网吧用简单队列做限速完全是扯蛋。网吧限速最好的办法应该是带宽均分,然后在用简单队列来限制上传。在利用小包优先来处理游戏卡的问题。经过2个网吧,一个月的测试,完全摆脱了到处喊卡的噩梦,现在把经验发来大家分享一下。% S6 o) j5 [* U# a6 h9 Z7 W
ROS不要用简单队列来限速,什么智能动态限速也不要用。只需要用小包优先+带宽均分+简单队列限制上传速度,360安全卫士7.0下载。
+ d8 F# a/ L9 P* B- V" [6 e8 c7 o小包优先的脚本如下:
" a; w! I( M1 D' d6 t7 fip firewall mangle ; n' @/ n& [% k8 ?4 }
add chain=forward p2p=all-p2p action=mark-connection new-connection-mark=p2p_conn passthrough=yes comment="" disabled=no 8 I$ l% o! u8 u! d9 x/ Z8 Q$ V
add chain=forward connection-mark=p2p_conn action=mark-packet new-packet-mark=p2p passthrough=yes comment="" disabled=no 5 Q2 a C9 }0 r ]- Z. F1 D6 Q5 |* A
add chain=forward connection-mark=!p2p_conn action=mark-packet new-packet-mark=general passthrough=yes comment="" disabled=no 5 Y3 }. b3 A! _
add chain=forward packet-size=32-512 action=mark-packet new-packet-mark=small passthrough=yes comment="" disabled=no
9 b5 U9 p3 d( @3 J) W) badd chain=forward packet-size=512-1200 action=mark-packet new-packet-mark=big passthrough=yes comment="" disabled=no$ d% ]2 c/ x$ @+ k2 H, H
~, A% l m: v. P/ queue tree
; T8 [- N/ w* t5 q& b. h# fadd name="p2p1" parent=wan packet-mark=p2p limit-at=2000000 queue=default priority=8 max-limit=6000000 burst-limit=0 burst-threshold=0 burst-time=0s disabled=no : m n2 j q7 m4 @
add name="p2p2" parent=lan packet-mark=p2p limit-at=2000000 queue=default priority=8 max-limit=6000000 burst-limit=0 burst-threshold=0 burst-time=0s disabled=no
; Z8 c% i1 M4 Radd name="ClassA" parent=lan packet-mark="" limit-at=0 queue=default priority=8 max-limit=100000000 burst-limit=0 burst-threshold=0 burst-time=0s disabled=no
% N4 W) e5 e7 l% Y# ^9 Q: Y+ ]5 Tadd name="ClassB" parent=ClassA packet-mark="" limit-at=0 queue=default priority=8 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s disabled=no ) B7 a1 }* V, J( E: [
add name="Leaf1" parent=ClassA packet-mark=general limit-at=0 queue=default priority=7 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s disabled=no
! d6 ~$ p! l# j4 B" E# ]4 G: Jadd name="Leaf2" parent=ClassB packet-mark=small limit-at=0 queue=default priority=5 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s disabled=no / x5 o7 x' o( k
add name="Leaf3" parent=ClassB packet-mark=big limit-at=0 queue=default priority=6 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s disabled=no# r6 }4 D$ ?: `7 E
然后是带宽均分:
5 G& J$ @9 I Y* B4 ~9 {/ip firewall mangle add chain=forward src-address=192.168.0.0/24 \
8 l) h+ ^! b+ `; naction=mark-connection new-connection-mark=users-con
- B+ p9 {0 Z& i7 W1 F- P/ip firewall mangle add connection-mark=users-con action=mark-packet \
1 B3 K0 j8 d- ~! u$ l) ?! |, T8 E. onew-packet-mark=users chain=forward/ a3 V2 ^) b, O
/queue type add name=pcq-download kind=pcq pcq-classifier=dst-address( ?. j+ H9 p* H; A$ ]5 \
/queue type add name=pcq-upload kind=pcq pcq-classifier=src-address
6 D4 C1 _# w7 W1 \/queue tree add name=Download parent=lan max-limit=30M
4 ^7 d9 c' f; u/queue tree add parent=Download queue=pcq-download packet-mark=users
* K1 g3 T+ q- I4 e! E- \/queue tree add name=Upload parent=wan max-limit=28M
- q) b5 c* P9 K9 _6 t2 \/queue tree add parent=Upload queue=pcq-upload packet-mark=users
6 \, ?: c) b T- d. e请根据直接实际修改IP地址段,下载最大速度,上传最大速度,lan为我连接内网的网卡,wan是我连接外网的网卡
/ a7 Z+ X6 v y# _8 w限制上传速度的脚本:$ r1 b- O8 E+ ^! p
:for aaa from 2 to 180 do={/queue simple add name=(PC . $aaa) dst-address=(192.168.0. . $aaa) limit-at=10000000/3000000 max-limit=30000000/3000000}7 S/ N2 h, f$ I/ i8 w
如果是3.2版本的,这个脚本自己要修改下,) K0 v9 b9 B! w
就用这3个部分,别的不需要的,绝对比什么智能动态限速好的多。 |
|