找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 5794|回复: 3

[限速] ROS的PPPOE全自动智能限速为什么不起作用?

[复制链接]
发表于 2010-11-15 08:55:32 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

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

×
我在网上找了个脚本,说功能是根据在线人数计算每个人的速宽,如下:
#客户数量
:local count1 0
#上传速率,这里是2条ADSL
:local UpRate (2*500000)
#下载速率
:local DownRate (2*3000000)
#平均上传速率
:local UpAverage 90000
#平均下载速率
:local DownAverage 1000000
#得到客户数量
:set count1 [:len [/ppp act find]]
#得到平均上传速率
:set UpAverage ($UpRate/$count1)
#得到平均下载速率
:set DownAverage ($DownRate/$count1)
#最低上传下载速率
:if ($UpAverage < 90000) do={:set UpAverage 90000}
:if ($DownAverage < 1000000) do={:set DownAverage 1000000}
#得到限速值
:local LimitAt (($UpAverage*70/100/1000*1000) . "/" . ($DownAverage*70/100/1000*1000))
#得到最大限速
:local MaxLimit ($UpAverage . "/" . $DownAverage)
#突发极限
:local BurstLimit (($UpAverage*185/100/1000*1000) . "/" . ($DownAverage*185/100/1000*1000))
#突发的平均值
:local BurstThr (($UpAverage*60/100/1000*1000) . "/" . ($DownAverage*60/100/1000*1000))
#突发时间
:local BurstTime "3s/3s"
/que sim
set [find dynamic=true] queue=default/default limit-at=$LimitAt max-limit=$MaxLimit burst-limit=$BurstLimit burst-threshold=$BurstThr burst-time=$BurstTime


我的ros为3.30,复制进去执行,为什么不起作用!哪位大大给说一下。
routeros
发表于 2010-11-17 01:29:03 | 显示全部楼层
这些都是定制的脚本,你肯定不会用
routeros
回复

使用道具 举报

 楼主| 发表于 2010-11-17 11:54:45 | 显示全部楼层
更改成功,在ROS3.30下运行正常!根据在线人数限制带宽!
#客户数量
:global count1
#上传速率,20M
:global UpRate 10000000
#下载速率,50M
:global DownRate 10000000
#平均上传速率
:global UpAverage 100000
#平均下载速率
:global DownAverage 250000
#得到客户数量
:set count1 [:len [/ppp act find]]
#得到平均上传速率
:set UpAverage ($UpRate / $count1)
#得到平均下载速率
:set DownAverage ($DownRate / $count1)
#最低上传下载速率
:if ($UpAverage < 100000) do={:set UpAverage 100000}
:if ($DownAverage < 250000) do={:set DownAverage 250000}
#得到限速值
:global LimitAt ($UpAverage . "/" . $DownAverage)
#得到最大限速
:global MaxLimit (($UpAverage) . "/" . ($DownAverage))
/que sim
set [find dynamic=yes] limit-at=$LimitAt max-limit=$MaxLimit
routeros
回复

使用道具 举报

发表于 2010-11-18 21:26:25 | 显示全部楼层
好用吗?
routeros
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-2 04:22 , Processed in 0.046357 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

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