 鲜花( 0)  鸡蛋( 0)
|
网吧用ROS的个人看法
0 M7 l6 c5 @+ l3 M
; d, p6 X" |7 d2 o. V; A! ]一直以来,都看论坛上的达人说ROS做软路由器效果是多么的强大,于是偶也搞一个试试看。找了一个2.9.27的完全 *** 版,用了2块D-LINK530的网卡,装完一用还真行。比我那1000的锐捷强多了,网吧120台机器,座满的时候那个锐捷的路由器登陆界面都打不开。用上以后问题就来了,我们30M的光纤,如果不限速,那些下载狂人把带宽全部给占用了,打游戏的顾客很有意见。于是我就做了个限速,每个机器下载最大2M.平均1M。但是群众还是不满意,都所卡。我又找资料,pps影音标准版2010下载,发现原来还有个叫智能动态限速的东西,好偶照做。做好以后,平时喊卡的人没有了,人多的时候一样都喊卡。
1 w5 M$ H) e o) W7 B偶傻眼了,难道只能不限速。还好天无绝人之路,还有个“小包优先”的高级货,于是照做。结果用简单队列限速后,“小包优先”也是白搭,难道天要忘我。终于经过N次测试以后,魔兽改键精灵4.5下载,我明白了。网吧用简单队列做限速完全是扯蛋。网吧限速最好的办法应该是带宽均分,然后在用简单队列来限制上传。在利用小包优先来处理游戏卡的问题。经过2个网吧,一个月的测试,完全摆脱了到处喊卡的噩梦,现在把经验发来大家分享一下。
W$ ~! I1 C- d& V; D+ q$ c; CROS不要用简单队列来限速,什么智能动态限速也不要用。只需要用小包优先+带宽均分+简单队列限制上传速度,360安全卫士7.0下载。
: R7 w6 z5 u% b$ x# E, p& t2 u小包优先的脚本如下:
) F# V( U3 ~7 ]ip firewall mangle . N" v/ C: w+ K. b4 ? L( S+ t/ T
add chain=forward p2p=all-p2p action=mark-connection new-connection-mark=p2p_conn passthrough=yes comment="" disabled=no
5 i* }! H1 \9 T. p, p# aadd chain=forward connection-mark=p2p_conn action=mark-packet new-packet-mark=p2p passthrough=yes comment="" disabled=no
e( [# D0 K& @ z! I A4 r" S$ eadd chain=forward connection-mark=!p2p_conn action=mark-packet new-packet-mark=general passthrough=yes comment="" disabled=no 6 |5 f. P$ ]7 D
add chain=forward packet-size=32-512 action=mark-packet new-packet-mark=small passthrough=yes comment="" disabled=no
. C ~1 X- Z# D: Radd chain=forward packet-size=512-1200 action=mark-packet new-packet-mark=big passthrough=yes comment="" disabled=no G7 N5 \/ q" z9 a- t F& U
; n% d* r" O& I0 s7 e8 l9 L) V/ queue tree : } ?7 L: {1 W$ s( q4 E9 n
add 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
4 X; |3 A Z& d9 padd 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
: N, R Q, R* d9 O* e9 {1 yadd 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
# a, A \! n2 [ L& d5 k9 Hadd 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
3 z! L- j! Q6 o. [% @# J* m+ _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
/ {# Y" _2 n. e2 R6 A6 \1 X2 zadd 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
) V+ J, Y$ G& e; U( H/ tadd 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# n& ]# S w, W, `# `4 v* G
然后是带宽均分:# M5 B l& Z2 |+ C. a/ l
/ip firewall mangle add chain=forward src-address=192.168.0.0/24 \
/ N/ h2 T4 C. V( H& Raction=mark-connection new-connection-mark=users-con( r& Q& ?' A5 ^1 p; b7 K2 C# t
/ip firewall mangle add connection-mark=users-con action=mark-packet \
4 D; O/ P7 L/ cnew-packet-mark=users chain=forward2 f7 F& W" K1 G5 k q6 k' t# d
/queue type add name=pcq-download kind=pcq pcq-classifier=dst-address
% @& g4 t8 u; N3 ~8 [7 y1 w* i/queue type add name=pcq-upload kind=pcq pcq-classifier=src-address
; R2 v- w( t. m9 B+ p5 z+ u/ Z/ x/queue tree add name=Download parent=lan max-limit=30M
# F& {- Z/ A2 V9 c/queue tree add parent=Download queue=pcq-download packet-mark=users0 L1 Y. B$ `* v. G+ i( G
/queue tree add name=Upload parent=wan max-limit=28M) J4 ~( }) O+ q7 Q+ g; g' F
/queue tree add parent=Upload queue=pcq-upload packet-mark=users. Z2 A R# I- s7 B+ B6 P) F1 H
请根据直接实际修改IP地址段,下载最大速度,上传最大速度,lan为我连接内网的网卡,wan是我连接外网的网卡
! L1 B& l" y( _4 o, I限制上传速度的脚本:
6 q6 S, {- ^, f4 w ]: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}4 O* ?- @" F" e7 o9 t
如果是3.2版本的,这个脚本自己要修改下,2 {) T. b: X3 \/ t8 \ @" k
就用这3个部分,别的不需要的,绝对比什么智能动态限速好的多。 |
|