注册 登录
自由的生活_软路由 返回首页

lai99999的个人空间 https://bbs.routerclub.com/?134023 [收藏] [复制] [分享] [RSS]

日志

小包优先+带宽均分+简单队列限制上传速度 这是复制论坛的文章

已有 1312 次阅读2011-4-20 22:59 |个人分类:ROS|

ROS不要用简单队列来限速,什么智能动态限速也不要用。只需要用小包优先+带宽均分+简单队列限制上传速度。
小包优先的脚本如下:
ip firewall mangle
add chain=forward p2p=all-p2p action=mark-connection    new-connection-mark=p2p_conn passthrough=yes comment="" disabled=no
add chain=forward connection-mark=p2p_conn action=mark-packet    new-packet-mark=p2p passthrough=yes comment="" disabled=no
add chain=forward connection-mark=!p2p_conn action=mark-packet    new-packet-mark=general passthrough=yes comment="" disabled=no
add chain=forward packet-size=32-512 action=mark-packet new-packet-mark=all    passthrough=yes comment="" disabled=no
add chain=forward packet-size=512-1200 action=mark-packet new-packet-mark=big    passthrough=yes comment="" disabled=no

/ queue tree
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
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
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
add 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
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
add name="Leaf2" parent=ClassB packet-mark=all limit-at=0 queue=default   priority=5 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s   disabled=no
add 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
然后是带宽均分:
/ip firewall mangle add chain=forward src-address=192.168.0.0/24 \
action=mark-connection new-connection-mark=users-con
/ip firewall mangle add connection-mark=users-con action=mark-packet \
new-packet-mark=users chain=forward
/queue type add name=pcq-download kind=pcq pcq-classifier=dst-address
/queue type add name=pcq-upload kind=pcq pcq-classifier=src-address
/queue tree add name=Download parent=lan max-limit=30M
/queue tree add parent=Download queue=pcq-download packet-mark=users

/queue tree add name=Upload parent=wan max-limit=28M
/queue tree add parent=Upload queue=pcq-upload packet-mark=users
请根据直接实际修改IP地址段,下载最大速度,上传最大速度,lan为我连接内网的网卡,wan是我连接外网的网卡

限制上传速度的脚本:
: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.2版本的,这个脚本自己要修改下,
就用这3个部分,别的不需要的,绝对比什么智能动态限速好的多

路过

雷人

握手

鲜花

鸡蛋

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 注册

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

GMT+8, 2024-11-22 00:43 , Processed in 0.069102 second(s), 6 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

返回顶部