|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
明天就是2012了,从明年开始我也准备离开网吧这个岗位了,相信2012对我既是机遇也是挑战的一年!!!感谢论坛里朋友的热心回贴,帮我解决了很多问题,通过各种方法,我也对ros有了基本的了解,应该能够独立做一台比较好的ROS了!!!这是我两个月下来做的ROS,因为是网吧环境,电信,网通各10M光纤,重点放在了限速上,我不断调试,最终采用了这种"小包优先"的方法,电信是主线,在110台机器在线时,带宽跑满,DOTA在电信线有点卡,网通线不卡,其他游戏不卡,看电影等其他不卡,当然我的限速还存在很多问题,有些我还是不太明白,还请大家多提意见!!!
附件中代码为
# dec/31/2011 17:08:39 by routeros 3.30
# software id = SD2C-SUY2
#
/ip firewall mangle
add action=mark-routing chain=prerouting comment=cnc disabled=no \
dst-address-list=cnc new-routing-mark=cnc passthrough=no
add action=change-mss chain=forward comment="" disabled=no new-mss=1472 \
protocol=tcp tcp-flags=syn
add action=mark-connection chain=prerouting comment=p2p_conn disabled=no \
new-connection-mark=p2p_conn p2p=all-p2p passthrough=yes
add action=mark-packet chain=prerouting comment="" connection-mark=p2p_conn \
disabled=no new-packet-mark=p2p passthrough=no
add action=mark-packet chain=prerouting comment=!p2p_conn connection-mark=\
!p2p_conn disabled=no new-packet-mark=general passthrough=yes
add action=mark-packet chain=prerouting comment=big disabled=no \
new-packet-mark=big packet-size=512-1200 passthrough=yes
add action=mark-connection chain=prerouting comment="http_video in" disabled=\
no layer7-protocol=video new-connection-mark=video passthrough=yes \
protocol=tcp
add action=mark-packet chain=prerouting comment="" connection-mark=video \
disabled=no new-packet-mark=http_video_in passthrough=yes protocol=tcp
add action=mark-packet chain=prerouting comment=small disabled=no \
new-packet-mark=small packet-size=32-512 passthrough=yes
add action=mark-connection chain=prerouting comment=\
"\D3\C5\CF\C8\B6\CB\BF\DA" disabled=no dst-port=443 new-connection-mark=\
Port_Conn passthrough=yes protocol=tcp
add action=mark-connection chain=prerouting comment="" disabled=no dst-port=\
3724 new-connection-mark=Port_Conn passthrough=yes protocol=tcp
add action=mark-connection chain=prerouting comment=qq disabled=no dst-port=\
8000 new-connection-mark=Port_Conn passthrough=yes protocol=udp
add action=mark-packet chain=prerouting comment="" connection-mark=Port_Conn \
disabled=no new-packet-mark=Port_Packet passthrough=no
add action=mark-connection chain=prerouting comment=war3 disabled=no \
dst-port=\
2327,2040,2191,1845,1998,50801,2111,1590,4377,1925,1561,2191,9628 \
new-connection-mark=Port_Conn passthrough=yes protocol=udp
add action=mark-connection chain=prerouting comment=hf_war3 disabled=no \
dst-port=8861,1932,2287,14531,1897,2428,13735,1039,1100 \
new-connection-mark=Port_Conn passthrough=yes protocol=udp
add action=mark-connection chain=prerouting comment=hf_war3 disabled=no \
dst-port=1210,1381,1473,1509,1785,18979,1140,1371,1510,16434,9865 \
new-connection-mark=Port_Conn passthrough=yes protocol=udp
add action=mark-connection chain=prerouting comment=hf disabled=no dst-port=\
9000,1511,1203,1607 new-connection-mark=Port_Conn passthrough=yes \
protocol=udp
add action=mark-connection chain=prerouting comment=cf disabled=no dst-port=\
12000-12175,2349 new-connection-mark=Port_Conn passthrough=yes protocol=\
udp
add action=mark-connection chain=prerouting comment=cf disabled=no dst-port=\
7101-7103,10008,28012 new-connection-mark=Port_Conn passthrough=yes \
protocol=tcp
add action=mark-connection chain=prerouting comment=http disabled=no \
dst-address-list="" layer7-protocol=web new-connection-mark=web \
passthrough=yes protocol=tcp
add action=mark-packet chain=prerouting comment="" connection-mark=web \
disabled=no new-packet-mark=http_in passthrough=yes protocol=tcp
add action=mark-connection chain=prerouting comment="http_heavy in" disabled=\
no layer7-protocol=img1 new-connection-mark=img passthrough=yes protocol=\
tcp
add action=mark-packet chain=prerouting comment="" connection-mark=img \
disabled=no new-packet-mark=http_heavy_in passthrough=yes protocol=tcp
/queue type
add kind=pcq name=pcq-download pcq-classifier=dst-address pcq-limit=50 \
pcq-rate=0 pcq-total-limit=5000
add kind=pcq name=pcq-upload pcq-classifier=src-address pcq-limit=50 \
pcq-rate=0 pcq-total-limit=5000
/queue simple
:for chen from=0 to=253 do={/queue simple add name=("PC" . $chen) dst-address=("192.168.15." . $chen) limit-at=640000/640000 interface=all max-limit=16M/800k burst-limit=0/0 burst-threshold=0/0 burst-time=0/0 queue=pcq-upload/pcq-download}
(限制上传,关键可以对每台机器操作,均分带宽)
/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=800k \
max-limit=4M name=p2p packet-mark=p2p parent=host priority=8 queue=\
default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=20M name=ClassA parent=host priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=5M \
max-limit=20M name=Leaf1 packet-mark=general parent=ClassA priority=7 \
queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=5M \
max-limit=20M name=Leaf2 packet-mark=big parent=ClassA priority=6 queue=\
default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name=Leaf3 packet-mark=small parent=ClassA priority=5 queue=\
default |
|