 鲜花( 0)  鸡蛋( 0)
|
网吧用ROS的个人看法
$ ~1 N2 i8 T, i( Z- N' q' m 0 S" B6 R. Q# A" U% a
一直以来,都看论坛上的达人说ROS做软路由器效果是多么的强大,于是偶也搞一个试试看。找了一个2.9.27的完全 *** 版,用了2块D-LINK530的网卡,装完一用还真行。比我那1000的锐捷强多了,网吧120台机器,座满的时候那个锐捷的路由器登陆界面都打不开。用上以后问题就来了,我们30M的光纤,如果不限速,那些下载狂人把带宽全部给占用了,打游戏的顾客很有意见。于是我就做了个限速,每个机器下载最大2M.平均1M。但是群众还是不满意,都所卡。我又找资料,pps影音标准版2010下载,发现原来还有个叫智能动态限速的东西,好偶照做。做好以后,平时喊卡的人没有了,人多的时候一样都喊卡。
0 W$ w9 U) q% }. x7 W* B2 k偶傻眼了,难道只能不限速。还好天无绝人之路,还有个“小包优先”的高级货,于是照做。结果用简单队列限速后,“小包优先”也是白搭,难道天要忘我。终于经过N次测试以后,魔兽改键精灵4.5下载,我明白了。网吧用简单队列做限速完全是扯蛋。网吧限速最好的办法应该是带宽均分,然后在用简单队列来限制上传。在利用小包优先来处理游戏卡的问题。经过2个网吧,一个月的测试,完全摆脱了到处喊卡的噩梦,现在把经验发来大家分享一下。
1 C0 ]$ h& w. h( E- Z0 |5 HROS不要用简单队列来限速,什么智能动态限速也不要用。只需要用小包优先+带宽均分+简单队列限制上传速度,360安全卫士7.0下载。+ x+ r' e* ]* v0 a
小包优先的脚本如下:) }' x6 d) S2 S3 s- s
ip firewall mangle
5 O5 ~; {4 P( ~5 \% Z3 o8 Aadd chain=forward p2p=all-p2p action=mark-connection new-connection-mark=p2p_conn passthrough=yes comment="" disabled=no 7 f' u$ V( m C& N; s, i
add chain=forward connection-mark=p2p_conn action=mark-packet new-packet-mark=p2p passthrough=yes comment="" disabled=no 6 b) r6 ~5 Y' o8 J/ Z$ e n
add chain=forward connection-mark=!p2p_conn action=mark-packet new-packet-mark=general passthrough=yes comment="" disabled=no
. F7 a1 Z' ]/ Oadd chain=forward packet-size=32-512 action=mark-packet new-packet-mark=small passthrough=yes comment="" disabled=no
5 ?( ]; P* R4 p2 E; G+ d* e# Madd chain=forward packet-size=512-1200 action=mark-packet new-packet-mark=big passthrough=yes comment="" disabled=no% V/ W( z5 l5 z6 y7 r& {, [ b
2 {, Q7 b" z3 V7 K7 H8 x$ T6 {( `
/ queue tree
0 N& I8 ]& w X2 g" 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 " r$ _" V w3 s1 l7 f1 L2 V }
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
; g5 _& P" e ^6 l+ ^' Y$ d% n; 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 , L4 ]2 L$ K8 G- Z, ~% D/ e0 Q
add 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 2 D2 Y' k; j9 I7 A) s& L1 c
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
2 u% F( }7 B0 j- J: |$ A. Oadd 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
- c0 z9 Y8 | _3 i3 E- dadd 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=no1 J+ r# i: U7 i$ T4 V. a8 e
然后是带宽均分:
' K0 A9 g! K4 w4 T/ip firewall mangle add chain=forward src-address=192.168.0.0/24 \
/ [& @ ]4 _( ~) W$ `% Caction=mark-connection new-connection-mark=users-con
+ c( E3 o x; j2 r# C, B/ u/ip firewall mangle add connection-mark=users-con action=mark-packet \
7 S' |7 F; \) D- lnew-packet-mark=users chain=forward: t8 ?! p5 ~0 W' V7 H) s7 q
/queue type add name=pcq-download kind=pcq pcq-classifier=dst-address* M" c' i# k5 v6 |4 p3 X" o! `
/queue type add name=pcq-upload kind=pcq pcq-classifier=src-address
* X) J% @# b9 [7 O; ~3 V" g( P/queue tree add name=Download parent=lan max-limit=30M
8 ?, o7 n" F& |+ p6 h/queue tree add parent=Download queue=pcq-download packet-mark=users$ }& I; \ }6 H* C1 S( M. m) T
/queue tree add name=Upload parent=wan max-limit=28M9 o4 \- t1 V4 A' B f: p
/queue tree add parent=Upload queue=pcq-upload packet-mark=users" q) l$ h# D1 o9 I$ H' `$ k& `
请根据直接实际修改IP地址段,下载最大速度,上传最大速度,lan为我连接内网的网卡,wan是我连接外网的网卡; R2 W+ i2 p# _# R) `- Q
限制上传速度的脚本:, Z" Q( f" {0 a7 y- r, s
: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 o, B3 u. @, L' O5 m) }如果是3.2版本的,这个脚本自己要修改下,
& t" V* `+ x" N9 l+ v9 W就用这3个部分,别的不需要的,绝对比什么智能动态限速好的多。 |
|