prince90s 发表于 2012-1-5 00:59:21

按在线数自动改队列限速脚本

http://blog.chanki.net/content/uploadfile/201112/thum-a20e6b12324069d168bebfd21c96b2d320111228052126.jpg

total upload=1M
total download =8M

script:

:global count1 11

:global count2 21

:global count3 31

:global count4 41

:global count5 51

:global up0 200000

:global up1 160000

:global up2 128000

:global up3 100000

:global up4 64000

:global down0 0

:global down1 4000000

:global down2 3000000

:global down3 2000000

:global down4 1000000

:global upname "pcq-all-up"

:global downname "pcq-web-down"

:global online [:len ]

:if ($online < $count1) do={

:if (( pcq-rate]!=$up0) || ( pcq-rate]!=$down0)) do={

/queue type set pcq-rate=$up0;/queue type set pcq-rate=$down0}}

:if ($online >= $count1 && $online < $count2) do={

:if (( pcq-rate]!=$up1) || ( pcq-rate]!=$down1)) do={

/queue type set pcq-rate=$up1;/queue type set pcq-rate=$down1}}

:if ($online >= $count2 && $online < $count3) do={

:if (( pcq-rate]!=$up2) || ( pcq-rate]!=$down2)) do={

/queue type set pcq-rate=$up2;/queue type set pcq-rate=$down2}}

:if ($online >= $count3 && $online < $count4) do={

:if (( pcq-rate]!=$up3) || ( pcq-rate]!=$down3)) do={

/queue type set pcq-rate=$up3;/queue type set pcq-rate=$down3}}

:if ($online >= $count5) do={

:if (( pcq-rate]!=$up4) || ( pcq-rate]!=$down4)) do={

/queue type set pcq-rate=$up4;/queue type set pcq-rate=$down4}}

sjl3621 发表于 2012-1-11 21:50:06

这个脚本好
:global online [:len ]
获取在线客户机数这里是不是应该有相应的规则
/ip firewall filter add chain=forward src-address=192.168.0.0/24
connection-state=established action=add-src-to-address-list address-list=list
页: [1]
查看完整版本: 按在线数自动改队列限速脚本