|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
本帖最后由 WGHBOY 于 2010-4-28 02:25 编辑
DSCP是优先数据中最简单的一种,是HTB的改进型,可配合网维大师或者交换机使用
dscp分为64级,0最小63最大,建议大家使用16级就行了,级别多数据缓慢,cpu高耗
#如下脚本在3.x下只接运行
#标记优先数据包
:for x from 0 to 63 do={/ip firewall mangle add action=mark-packet chain=postrouting \
comment=("dscp_" . $x) disabled=no dscp=$x new-packet-mark=("dscp_" . $x) passthrough=no}
#标记限速
/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=5000000 name=down \
parent=lan queue=default
#prio8
:for z from 0 to 7 do={/queue tree add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 \
name=("routine_" . $z . "_down") packet-mark=("dscp_" . $z) parent=down priority=8 queue=dscp_pcq}
#prio7
:for z from 8 to 15 do={/queue tree add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 \
name=("priority_" . $z . "_down") packet-mark=("dscp_" . $z) parent=down priority=7 queue=dscp_pcq}
#prio 6
:for z from 16 to 23 do={/queue tree add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 \
name=("immediate_" . $z . "_down") packet-mark=("dscp_" . $z) parent=down priority=6 queue=dscp_pcq}
#prio 5
:for z from 24 to 31 do={/queue tree add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 \
name=("flash_" . $z . "_down") packet-mark=("dscp_" . $z) parent=down priority=5 queue=dscp_pcq}
#prio 4
:for z from 32 to 39 do={/queue tree add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 \
name=("flash_override_" . $z . "_down") packet-mark=("dscp_" . $z) parent=down priority=4 queue=dscp_pcq}
#prio 3
:for z from 40 to 47 do={/queue tree add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 \
name=("critical_" . $z . "_down") packet-mark=("dscp_" . $z) parent=down priority=3 queue=dscp_pcq}
#prio 2
:for z from 48 to 55 do={/queue tree add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 \
name=("intercon_" . $z . "_down") packet-mark=("dscp_" . $z) parent=down priority=2 queue=dscp_pcq}
#prio 1
:for z from 56 to 63 do={/queue tree add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 \
name=("netcon_" . $z . "_down") packet-mark=("dscp_" . $z) parent=down priority=1 queue=dscp_pcq} |
|