 鲜花( 0)  鸡蛋( 0)
|
网吧用ROS的个人看法+ z; y/ Y5 H" s1 T( X2 X/ w$ {4 K: n0 I f
! j) {2 v Q: e一直以来,都看论坛上的达人说ROS做软路由器效果是多么的强大,于是偶也搞一个试试看。找了一个2.9.27的完全 *** 版,用了2块D-LINK530的网卡,装完一用还真行。比我那1000的锐捷强多了,网吧120台机器,座满的时候那个锐捷的路由器登陆界面都打不开。用上以后问题就来了,我们30M的光纤,如果不限速,那些下载狂人把带宽全部给占用了,打游戏的顾客很有意见。于是我就做了个限速,每个机器下载最大2M.平均1M。但是群众还是不满意,都所卡。我又找资料,pps影音标准版2010下载,发现原来还有个叫智能动态限速的东西,好偶照做。做好以后,平时喊卡的人没有了,人多的时候一样都喊卡。" ^. h" q3 L: n% F$ c0 m
偶傻眼了,难道只能不限速。还好天无绝人之路,还有个“小包优先”的高级货,于是照做。结果用简单队列限速后,“小包优先”也是白搭,难道天要忘我。终于经过N次测试以后,魔兽改键精灵4.5下载,我明白了。网吧用简单队列做限速完全是扯蛋。网吧限速最好的办法应该是带宽均分,然后在用简单队列来限制上传。在利用小包优先来处理游戏卡的问题。经过2个网吧,一个月的测试,完全摆脱了到处喊卡的噩梦,现在把经验发来大家分享一下。' `9 Y" P/ C" ~
ROS不要用简单队列来限速,什么智能动态限速也不要用。只需要用小包优先+带宽均分+简单队列限制上传速度,360安全卫士7.0下载。
9 L- G% p, @4 T8 ~6 g" L9 c' u6 J' M- [小包优先的脚本如下:
) g: }6 I; ~5 u7 D# q7 e) Pip firewall mangle # N9 E& o( \( c8 a! H+ Z
add chain=forward p2p=all-p2p action=mark-connection new-connection-mark=p2p_conn passthrough=yes comment="" disabled=no
* L! u P9 s/ C0 Qadd chain=forward connection-mark=p2p_conn action=mark-packet new-packet-mark=p2p passthrough=yes comment="" disabled=no / r# F ]: J: O! l: j6 ^( m; Q4 ^7 w
add chain=forward connection-mark=!p2p_conn action=mark-packet new-packet-mark=general passthrough=yes comment="" disabled=no
6 {9 F4 m' @* B) o+ a) Wadd chain=forward packet-size=32-512 action=mark-packet new-packet-mark=small passthrough=yes comment="" disabled=no
s% O$ ^/ `% U) J7 Badd chain=forward packet-size=512-1200 action=mark-packet new-packet-mark=big passthrough=yes comment="" disabled=no
3 u# c4 U# [1 J5 F; M6 P 6 d( x9 k: I* e! N! @+ y
/ queue tree Z$ ?' F- F8 z# f6 \, ]
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 - K' \2 u6 j- h, D( A/ 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 ( O* o+ |0 W5 G2 [8 r7 Y( k
add 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
$ j8 r+ G/ c) kadd 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 . M9 @- M# t4 q3 Q9 Z5 x
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 . H# D, J& R7 D- P5 B" `' ~
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
l" A2 `) A1 [$ z2 z- 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
z* n; w H$ ]9 Y, [7 a然后是带宽均分:
; o b7 k4 N. O" V( D$ e2 s/ip firewall mangle add chain=forward src-address=192.168.0.0/24 \
, G' {# {6 Y; e6 L) naction=mark-connection new-connection-mark=users-con& g- w; A1 r9 ?3 k b \" H
/ip firewall mangle add connection-mark=users-con action=mark-packet \
5 a8 J% t2 U. [' J2 ?; J9 u* Gnew-packet-mark=users chain=forward ~3 T* |5 W0 u/ m7 P
/queue type add name=pcq-download kind=pcq pcq-classifier=dst-address2 z2 U' f/ U. R( f/ k4 N
/queue type add name=pcq-upload kind=pcq pcq-classifier=src-address
% s' W$ A4 g. S/queue tree add name=Download parent=lan max-limit=30M
. D/ g* ^' V7 [9 c6 Z9 E l7 h3 I/queue tree add parent=Download queue=pcq-download packet-mark=users
; m+ J* @2 f6 K: Q' F/queue tree add name=Upload parent=wan max-limit=28M. n3 j) a2 q" O h
/queue tree add parent=Upload queue=pcq-upload packet-mark=users9 ]9 O# E7 [' I7 h* X! _/ ]
请根据直接实际修改IP地址段,下载最大速度,上传最大速度,lan为我连接内网的网卡,wan是我连接外网的网卡9 |7 t8 }$ Z9 y/ t- y
限制上传速度的脚本:( [+ O7 J6 J: c; C5 M! 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}% \3 T, b k+ u& s( V1 n/ Q
如果是3.2版本的,这个脚本自己要修改下,4 h, [7 D0 e* S9 Z
就用这3个部分,别的不需要的,绝对比什么智能动态限速好的多。 |
|