 鲜花( 0)  鸡蛋( 0)
|
网吧用ROS的个人看法
$ e' P6 ?( ~5 j4 \, ~ $ m6 l0 _3 D: L. A* P" m
一直以来,都看论坛上的达人说ROS做软路由器效果是多么的强大,于是偶也搞一个试试看。找了一个2.9.27的完全 *** 版,用了2块D-LINK530的网卡,装完一用还真行。比我那1000的锐捷强多了,网吧120台机器,座满的时候那个锐捷的路由器登陆界面都打不开。用上以后问题就来了,我们30M的光纤,如果不限速,那些下载狂人把带宽全部给占用了,打游戏的顾客很有意见。于是我就做了个限速,每个机器下载最大2M.平均1M。但是群众还是不满意,都所卡。我又找资料,pps影音标准版2010下载,发现原来还有个叫智能动态限速的东西,好偶照做。做好以后,平时喊卡的人没有了,人多的时候一样都喊卡。8 W! R+ p- ]' U" ^; g8 C* Y* D
偶傻眼了,难道只能不限速。还好天无绝人之路,还有个“小包优先”的高级货,于是照做。结果用简单队列限速后,“小包优先”也是白搭,难道天要忘我。终于经过N次测试以后,魔兽改键精灵4.5下载,我明白了。网吧用简单队列做限速完全是扯蛋。网吧限速最好的办法应该是带宽均分,然后在用简单队列来限制上传。在利用小包优先来处理游戏卡的问题。经过2个网吧,一个月的测试,完全摆脱了到处喊卡的噩梦,现在把经验发来大家分享一下。6 D. j9 [8 N/ Q4 `* Q
ROS不要用简单队列来限速,什么智能动态限速也不要用。只需要用小包优先+带宽均分+简单队列限制上传速度,360安全卫士7.0下载。
4 s* b1 K d3 y1 t( I小包优先的脚本如下:
! f! H% h% f" O. ^2 P% h2 G. ?, aip firewall mangle
8 X8 N) G; s& {* C/ }) Dadd chain=forward p2p=all-p2p action=mark-connection new-connection-mark=p2p_conn passthrough=yes comment="" disabled=no
: B- W5 Q! @3 f7 @' I( \add chain=forward connection-mark=p2p_conn action=mark-packet new-packet-mark=p2p passthrough=yes comment="" disabled=no
8 T. U( e6 m: y! J! H y7 p. m# Aadd chain=forward connection-mark=!p2p_conn action=mark-packet new-packet-mark=general passthrough=yes comment="" disabled=no
8 {9 x/ x$ h. ^, N Fadd chain=forward packet-size=32-512 action=mark-packet new-packet-mark=small passthrough=yes comment="" disabled=no
$ I5 | W8 b, I7 tadd chain=forward packet-size=512-1200 action=mark-packet new-packet-mark=big passthrough=yes comment="" disabled=no* i2 c. ]6 H3 P* z3 f) Z0 I
. V0 W7 t& V* ?+ U& f. C N: r
/ queue tree . D7 f& T& l* S% M3 E" 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
5 x6 E2 D. `$ H6 {9 o9 Aadd 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
: s. L; _4 Y( U4 h* g$ ?5 Dadd 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
8 i! m/ Y9 Q4 r3 S! I& n; 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
) e+ \: s- d$ L& r) f4 m ladd 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 $ L/ R4 S5 }/ x K% h, Q
add 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& @- i$ d' W* Q( p6 W' N# z5 wadd 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
9 I. _ X0 b% ?3 ~然后是带宽均分:
% z% F, p# `- w: i+ J/ip firewall mangle add chain=forward src-address=192.168.0.0/24 \' \2 ?; E+ \ I4 v, K# a
action=mark-connection new-connection-mark=users-con
7 p7 r! \6 B* a% d/ip firewall mangle add connection-mark=users-con action=mark-packet \
6 `% I: Q2 k. o: o |% Ynew-packet-mark=users chain=forward
( o' N: p, E) C9 ^$ ^, q& A/queue type add name=pcq-download kind=pcq pcq-classifier=dst-address
5 ?- z1 G3 T, W/ S- T* ~, b9 b/queue type add name=pcq-upload kind=pcq pcq-classifier=src-address
& P" ~% J7 y+ \& r9 @$ I; H/queue tree add name=Download parent=lan max-limit=30M9 O4 K1 q3 y& T. U6 I" o
/queue tree add parent=Download queue=pcq-download packet-mark=users
$ r$ w3 O* }4 ^! J/queue tree add name=Upload parent=wan max-limit=28M
. H5 c2 `( j. u8 n+ Y& A/queue tree add parent=Upload queue=pcq-upload packet-mark=users4 Z) t8 `5 @ G3 G$ m" G6 f+ z+ |+ U
请根据直接实际修改IP地址段,下载最大速度,上传最大速度,lan为我连接内网的网卡,wan是我连接外网的网卡' h8 G$ @# U6 S! @. h, R; N0 b
限制上传速度的脚本:$ s; l' D) }# G& t( _+ X* R
: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}& M3 G' \& p) F9 `. ~3 V
如果是3.2版本的,这个脚本自己要修改下,
6 f3 c# H2 a( p# z就用这3个部分,别的不需要的,绝对比什么智能动态限速好的多。 |
|