 鲜花( 0)  鸡蛋( 0)
|
网吧用ROS的个人看法
5 t+ e+ A$ M: \, g/ d6 m ) h1 o4 |3 w7 v( L+ L% P
一直以来,都看论坛上的达人说ROS做软路由器效果是多么的强大,于是偶也搞一个试试看。找了一个2.9.27的完全 *** 版,用了2块D-LINK530的网卡,装完一用还真行。比我那1000的锐捷强多了,网吧120台机器,座满的时候那个锐捷的路由器登陆界面都打不开。用上以后问题就来了,我们30M的光纤,如果不限速,那些下载狂人把带宽全部给占用了,打游戏的顾客很有意见。于是我就做了个限速,每个机器下载最大2M.平均1M。但是群众还是不满意,都所卡。我又找资料,pps影音标准版2010下载,发现原来还有个叫智能动态限速的东西,好偶照做。做好以后,平时喊卡的人没有了,人多的时候一样都喊卡。
* |3 c" o3 S! Z偶傻眼了,难道只能不限速。还好天无绝人之路,还有个“小包优先”的高级货,于是照做。结果用简单队列限速后,“小包优先”也是白搭,难道天要忘我。终于经过N次测试以后,魔兽改键精灵4.5下载,我明白了。网吧用简单队列做限速完全是扯蛋。网吧限速最好的办法应该是带宽均分,然后在用简单队列来限制上传。在利用小包优先来处理游戏卡的问题。经过2个网吧,一个月的测试,完全摆脱了到处喊卡的噩梦,现在把经验发来大家分享一下。
' _' H4 x* o5 h6 l3 f* @ROS不要用简单队列来限速,什么智能动态限速也不要用。只需要用小包优先+带宽均分+简单队列限制上传速度,360安全卫士7.0下载。
9 z; W. f/ F- h* p8 H W小包优先的脚本如下:( u; ?7 F* M. F$ d* V7 W/ ]$ F
ip firewall mangle
6 {# i5 x3 u2 e1 T: ]+ Z Dadd chain=forward p2p=all-p2p action=mark-connection new-connection-mark=p2p_conn passthrough=yes comment="" disabled=no
: @$ m( Z5 F( madd chain=forward connection-mark=p2p_conn action=mark-packet new-packet-mark=p2p passthrough=yes comment="" disabled=no 6 N8 x x; H- M- ?. u( X
add chain=forward connection-mark=!p2p_conn action=mark-packet new-packet-mark=general passthrough=yes comment="" disabled=no
3 _5 g$ C6 Z: i k' cadd chain=forward packet-size=32-512 action=mark-packet new-packet-mark=small passthrough=yes comment="" disabled=no . y9 j& m% b3 D0 n* l$ j) W/ k" K# _0 X
add chain=forward packet-size=512-1200 action=mark-packet new-packet-mark=big passthrough=yes comment="" disabled=no( b7 Y0 [& F! M% x5 A a- r5 g
2 ^- o1 A; C: O" E/ queue tree
& z. C0 k* s5 c6 ]& ~/ Q6 U. I2 j" {1 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
5 o0 a% Z- s; y8 {( Xadd 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
1 ?8 o: v# \6 c- padd 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
3 D! U' S+ v0 L/ c0 xadd 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
( x- ~7 P7 ]( B0 |' Sadd 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
; V8 a" f: J8 n& z4 m" _( R c3 Xadd 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
$ T, E$ g! L, ?' r: kadd 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
5 ]% ?( d5 o. U0 |8 V9 R6 ~2 u然后是带宽均分:
& i7 A3 ~- O7 Q5 ~3 T/ip firewall mangle add chain=forward src-address=192.168.0.0/24 \
. h1 b8 ?$ e$ Z2 r$ b6 Qaction=mark-connection new-connection-mark=users-con
5 V$ l. I& H% O5 I1 O/ip firewall mangle add connection-mark=users-con action=mark-packet \
2 M; m/ Z! J, _new-packet-mark=users chain=forward
/ `' v! k+ d8 q7 R9 S; i8 A/queue type add name=pcq-download kind=pcq pcq-classifier=dst-address
/ Y* ~9 z3 Z* f: M3 e' U/queue type add name=pcq-upload kind=pcq pcq-classifier=src-address
6 a8 R" u% j. ~) \/queue tree add name=Download parent=lan max-limit=30M
+ |$ O& W. \- U+ j" q1 q) m/queue tree add parent=Download queue=pcq-download packet-mark=users: e" p3 T# q2 V! y: }$ }
/queue tree add name=Upload parent=wan max-limit=28M% g/ A8 B& g* P1 D; I
/queue tree add parent=Upload queue=pcq-upload packet-mark=users3 l' K# V$ q# k$ c. x( i, U
请根据直接实际修改IP地址段,下载最大速度,上传最大速度,lan为我连接内网的网卡,wan是我连接外网的网卡
; X$ @4 i e" O3 {0 `9 C* x" P* ~限制上传速度的脚本:
- H2 D( J# `) q ]6 W# z: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}
# k* o6 O8 `8 f5 a4 G6 T如果是3.2版本的,这个脚本自己要修改下,3 P. q& `$ @: w5 j% Q. Q% E
就用这3个部分,别的不需要的,绝对比什么智能动态限速好的多。 |
|