ROS软路由论坛 ROSABC.com 网络方案网络工程交流

 找回密码
 会员注册

QQ登录

只需一步,快速开始

查看: 6906|回复: 0

[求助] 求助ROS小包优先

[复制链接]
发表于 2017-10-11 11:07:09 | 显示全部楼层 |阅读模式

马上注册成为ROSABC会员,随时发帖回复。

您需要 登录 才可以下载或查看,没有账号?会员注册

x
我在网上看了些小包优先的脚本,因为刚接触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

new-packet-mark=general passthrough=yes comment="" disabled=no

add chain=forward packet-size=32-512 action=mark-packet

passthrough=yes comment="" disabled=no

add chain=forward packet-size=512-1200

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

action=mark-packet new-packet-mark=small new-packet-mark=big action=mark-packet

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=small 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个部分,别的不需要的,绝对比什么智能动态限速好的多。


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

-------------------------------------------------------------------------------------------


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

本版积分规则

不良信息举报Q:2000617

软路由

不良信息举报Q:2000617|Archiver|ROS软路由论坛 ROSABC.com 网络方案网络工程交流

GMT+8, 2025-8-5 13:17 , Processed in 0.473851 second(s), 17 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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