找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: zooyo

[其它] [原创]发一个简单的小包优先规则,希望有200台以上网吧的朋友运用试试效果!

[复制链接]
发表于 2006-12-10 23:04:51 | 显示全部楼层

回复 #9 zooyo 的帖子

把常用游戏的目标连接端口来做一个标记,然后优先,这个办法不错,经过测试效果也可以,不过 chain是 forward比prerouting效果差很多,如果加在forward里还不如不优化,不知道为什么,只是实践的结果。
routeros
回复

使用道具 举报

发表于 2006-12-11 00:01:25 | 显示全部楼层
PREROUTING 是首先到达 ROS 的数据包
FORWARD 是穿过 ROS 的数据包
routeros
回复

使用道具 举报

 楼主| 发表于 2006-12-11 09:27:10 | 显示全部楼层
原帖由 anian 于 2006-12-10 23:04 发表
把常用游戏的目标连接端口来做一个标记,然后优先,这个办法不错,经过测试效果也可以,不过 chain是 forward比prerouting效果差很多,如果加在forward里还不如不优化,不知道为什么,只是实践的结果。


发发脚本来看看!
routeros
回复

使用道具 举报

发表于 2006-12-11 22:42:08 | 显示全部楼层
游戏端口只设置了几个

/ ip firewall mangle
add chain=forward protocol=tcp tcp-flags=syn action=change-mss new-mss=1452 \
    comment="改变MSS" disabled=no
add chain=prerouting src-address=192.168.0.0/23 tos=min-delay \
    action=mark-packet new-packet-mark=LEVEL-1 passthrough=yes \
    comment="上行数据标记" disabled=no
add chain=prerouting src-address=192.168.0.0/23 tos=max-reliability \
    action=mark-packet new-packet-mark=LEVEL-2 passthrough=yes comment="" \
    disabled=no
add chain=prerouting src-address=192.168.0.0/23 tos=normal action=mark-packet \
    new-packet-mark=LEVEL-3 passthrough=yes comment="" disabled=no
add chain=prerouting src-address=192.168.0.0/23 packet-size=0-768 \
    action=mark-packet new-packet-mark=LEVEL-2 passthrough=yes \
    comment="上行中小包数据" disabled=no
add chain=prerouting src-address=192.168.0.0/23 protocol=tcp dst-port=3724 \
    action=mark-packet new-packet-mark=LEVEL-1 passthrough=yes \
    comment="魔兽世界" disabled=no
add chain=prerouting src-address=192.168.0.0/23 protocol=tcp \
    dst-port=8086-8087 action=mark-packet new-packet-mark=LEVEL-1 \
    passthrough=yes comment="" disabled=no
add chain=prerouting src-address=192.168.0.0/23 protocol=tcp \
    dst-port=9090-9091 action=mark-packet new-packet-mark=LEVEL-1 \
    passthrough=yes comment="" disabled=no
add chain=prerouting src-address=192.168.0.0/23 protocol=tcp dst-port=9100 \
    action=mark-packet new-packet-mark=LEVEL-1 passthrough=yes comment="" \
    disabled=no
add chain=prerouting src-address=192.168.0.0/23 protocol=udp dst-port=8000 \
    action=mark-packet new-packet-mark=LEVEL-1 passthrough=yes comment="QQ" \
    disabled=no
add chain=prerouting src-address=192.168.0.0/23 protocol=tcp dst-port=8000 \
    action=mark-packet new-packet-mark=LEVEL-1 passthrough=yes comment="" \
    disabled=no
add chain=prerouting src-address=192.168.0.0/23 protocol=tcp dst-port=39311 \
    action=mark-packet new-packet-mark=LEVEL-1 passthrough=yes \
    comment="跑跑卡丁车" disabled=no
add chain=prerouting src-address=192.168.0.0/23 protocol=udp dst-port=39311 \
    action=mark-packet new-packet-mark=LEVEL-1 passthrough=yes comment="" \
    disabled=no
add chain=prerouting src-address=192.168.0.0/23 protocol=tcp dst-port=36567 \
    action=mark-packet new-packet-mark=LEVEL-1 passthrough=yes comment="" \
    disabled=no
add chain=prerouting src-address=192.168.0.0/23 protocol=udp dst-port=36567 \
    action=mark-packet new-packet-mark=LEVEL-1 passthrough=yes comment="" \
    disabled=no
add chain=prerouting src-address=192.168.0.0/23 protocol=tcp dst-port=11527 \
    action=mark-packet new-packet-mark=LEVEL-1 passthrough=yes comment="" \
    disabled=no
add chain=prerouting src-address=192.168.0.0/23 protocol=udp dst-port=11527 \
    action=mark-packet new-packet-mark=LEVEL-1 passthrough=yes comment="" \
    disabled=no
add chain=prerouting src-address=192.168.0.0/23 protocol=tcp dst-port=11107 \
    action=mark-packet new-packet-mark=LEVEL-1 passthrough=yes comment="" \
    disabled=no
add chain=prerouting src-address=192.168.0.0/23 protocol=udp dst-port=11107 \
    action=mark-packet new-packet-mark=LEVEL-1 passthrough=yes comment="" \
    disabled=no
add chain=prerouting src-address=192.168.0.0/23 protocol=tcp \
    dst-port=9066-9070 action=mark-packet new-packet-mark=LEVEL-1 \
    passthrough=yes comment="大航海时代" disabled=no



/ queue tree
add name="优先级-上行" parent=global-out packet-mark="" limit-at=0 \
    queue=default priority=3 max-limit=0 burst-limit=0 burst-threshold=0 \
    burst-time=0s disabled=no
add name="优先通过的数据包" parent=优先级-上行 packet-mark="" limit-at=0 \
    queue=default priority=3 max-limit=0 burst-limit=0 burst-threshold=0 \
    burst-time=0s disabled=no
add name="第一级别" parent=优先通过的数据包 packet-mark=LEVEL-1 limit-at=0 \
    queue=default priority=3 max-limit=0 burst-limit=0 burst-threshold=0 \
    burst-time=0s disabled=no
add name="中等优先通过的数据包" parent=优先级-上行 packet-mark="" limit-at=0 \
    queue=default priority=6 max-limit=0 burst-limit=0 burst-threshold=0 \
    burst-time=0s disabled=no
add name="第二级别" parent=中等优先通过的数据包 packet-mark=LEVEL-2 limit-at=0 \
    queue=default priority=6 max-limit=0 burst-limit=0 burst-threshold=0 \
    burst-time=0s disabled=no
add name="最后通过的数据包" parent=优先级-上行 packet-mark="" limit-at=0 \
    queue=default priority=8 max-limit=0 burst-limit=0 burst-threshold=0 \
    burst-time=0s disabled=no
add name="第三级别" parent=最后通过的数据包 packet-mark=LEVEL-3 limit-at=0 \
    queue=default priority=8 max-limit=0 burst-limit=0 burst-threshold=0 \
    burst-time=0s disabled=no
routeros
回复

使用道具 举报

发表于 2006-12-21 17:43:37 | 显示全部楼层
好好学习一下
routeros
回复

使用道具 举报

发表于 2006-12-29 22:06:27 | 显示全部楼层
为什么说最小延迟包为上行数据包呢?
routeros
回复

使用道具 举报

发表于 2007-1-5 11:11:44 | 显示全部楼层
一直在用小包优先!没发现什么问题!
routeros
回复

使用道具 举报

发表于 2007-6-26 12:04:17 | 显示全部楼层
顶下看过了
routeros
回复

使用道具 举报

发表于 2007-6-27 18:08:13 | 显示全部楼层
只给0-256的优先会不会更好?分三个不是处理更麻烦吗?
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-9-29 07:31 , Processed in 0.096695 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表