Professional Documents
Culture Documents
افضل تقسيم
افضل تقسيم
افضل تقسيم
{
:foreach i in=[/queue simple find] do={/queue simple remove $i;}
:local addr;
:local uname;
:foreach i in=[/ip hotspot active find] do={
:set addr [/ip hotspot active get $i address];
:set uname [/ip hotspot active get $i user];
:if ($uname="xzex6060" || $uname="jalalali" || $uname="zexxx89" || $uname="779thp"
|| $uname="zeexx4444" || $uname="4935830" || $uname="zexx1735" || $uname="noorh" ||
$uname="184904" || $uname="aa7968" || $uname="moad" || $uname="zexx188") do={
/queue simple add name=$uname target=$addr packet-marks=client_download max-
limit="50k/256k";
}
}
}
{
:local i;
:local j 9144000;
:set i [ :len [/ip hotspot active find] ];
:if ($i=0) do={:set i 1;}
:local x ($j/$i);
:local y ($x/4);
:foreach i in=[/queue simple find] do={/queue simple remove $i;}
:local addr;
:local uname;
:foreach i in=[/ip hotspot active find] do={
:set addr [/ip hotspot active get $i address];
:set uname [/ip hotspot active get $i address];
/queue simple add name=$uname target=$addr packet-marks=maxupgrade
max-limit="$y/$x" queue=ethernet-default/ethernet-default;
:local macby;
:local addrby;
:foreach m in=[/ip hotspot ip-binding find where bypassed] do={
:set addrby [/ip hotspot ip-binding get $m to-address];
:set macby [/ip hotspot ip-binding get $m mac-address];
/queue simple add name=$macby target=$addrby max-limit="$y/$x" queue=ethernet-
default/ethernet-default;
}
}
}
���� ��� ����
v6
{
:local i;
:local j 6144000;
:set i [ :len [/ip hotspot active find] ];
:if ($i=0) do={:set i 1;}
:local x ($j/$i);
:local y ($x/4);
:local macby;
:local addrby;
:foreach m in=[/ip hotspot ip-binding find] do={
:set addrby [/ip hotspot ip-binding get $m to-address];
:set macby [/ip hotspot ip-binding get $m mac-address];
/queue simple add name=$macby target=$addrby max-limit="$y/$x" q ueue=ethernet-
default/ethernet-default;
}
}
������ ���� ����� ���� ��� " ���� �� ������� " ���� ����� ��� ��� ��������
/queue simple set [ find name=odaiyd20202 ] max-limit=464k/1000k;
/ip hotspot user set [ find email=8@0_250.ptd ] email=8@0_500.ptd
hk88wa
----------
����� ���
v5
{:local i;
:local j 6144000;
:set i [ :len [/ip hotspot active find] ];
:if ($i=0) do={:set i 1;}
:local x ($j/$i);
:local y ($x/4);
:foreach i in=[/queue simple find] do={/queue simple remove $i;}
:local addr;
:local uname;
:foreach i in=[/ip hotspot active find] do={
:set addr [/ip hotspot active get $i address];
:set uname [/ip hotspot active get $i user];
}
}
-------------
======================
-binding
{
:local i;
:local j 12144000;
:set i [ :len [/ip hotspot active find] ];
:if ($i=0) do={:set i 1;}
:local x ($j/$i);
:local y ($x/4);
:local macby;
:local addrby;
:foreach m in=[/ip hotspot ip-binding find] do={
:set addrby [/ip hotspot ip-binding get $m to-address];
:set macby [/ip hotspot ip-binding get $m mac-address];
/queue simple add name=$macby target=$addrby max-limit="$y/$x" queue=ethernet-
default/ethernet-default;
}
}
{
:local i;
:local j 14144000;
:set i [ :len [/ip hotspot active find] ];
:if ($i=0) do={:set i 1;}
:local x ($j/$i);
:local y ($x/4);
:local b 90000;
:local a ($x+$b);
:foreach i in=[/queue simple find] do={/queue simple remove $i;}
:local addr;
:local uname;
:foreach i in=[/ip hotspot active find] do={
:set addr [/ip hotspot active get $i address];
:set uname [/ip hotspot active get $i user];
/queue simple add name=$uname target=$addr max-limit="$y/$x" burst-limit="$y/$a"
burst-threshold="$y/$a" burst-time="4/4" packet-marks=from_web;
}
}
/queue simple set [find name=oyd19912] max-limit=264k/3M;
=============================
{
:l{:local i;
:local j 8144000;
:set i [ :len [/ip hotspot active find] ];
:if ($i=0) do={:set i 1;}
:local x ($j/$i);
:local y ($x/4);
:foreach i in=[/queue simple find] do={/queue simple remove $i;}
:local addr;
:local uname;
:foreach i in=[/ip hotspot active find] do={
:set addr [/ip hotspot active get $i address];
:set uname [/ip hotspot active get $i user];
/queue simple add name=$uname target=$addr packet-mark=from_web max-limit="$y/$x";
:local macby;
:local addrby;
:foreach m in=[/ip hotspot ip-binding find where bypassed] do={
:set addrby [/ip hotspot ip-binding get $m to-address];
:set macby [/ip hotspot ip-binding get $m mac-address];
/queue simple add name=$macby target=$addrby max-limit="$y/$x" queue=ethernet-
default/ethernet-default;
}
}
}
=============
/ip firewall mangle add chain=prerouting action=mark-packet new-packet-mark=all
passthrough=no
/queue type add name="PCQ_download" kind=pcq pcq-rate=64000 pcq-classifier=dst-
address
/queue type add name="PCQ_upload" kind=pcq pcq-rate=32000 pcq-classifier=src-
address
===========================
/ip firewall mangle
add action=mark-packet chain=prerouting comment=pcq-max-limited dst-
address=10.55.24.1 new-packet-mark=from_web
=================finish=================
"\r\
\n{\r\
\n :global date [ /system clock get date ]\r\
\n :global array ( \"jan\",\"feb\",\"mar\",\"apr\",\"may\",\"jun\",\"jul\",\
\"aug\",\"sep\",\"oct\",\"nov\",\"dec\" )\r\
\n :global numday ( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 )\r\
\n :global days [ :pick \$date 4 6 ]\r\
\n :global tax [ :pick \$date 0 3 ]\r\
\n :global happy [ :pick \$date 7 11 ]\r\
\n :global months ([ :find \$array \$tax] )\r\
\n :for nodays from=0 to=\$months do={\r\
\n :set days ( \$days + [ :pick \$numday \$nodays ] )\r\
\n }\r\
\n :global daynow (\$days + (\$happy * 365))\r\
\n/ip hotspot active\r\
\n:foreach user in=[find] do={\r\
\n:global active [get \$user user]\r\
\n/ip ho user\r\
\n:foreach use in=[find name=\$active] do={\r\
\n:global comm [get \$use comment]\r\
\n:global byte ([get \$use bytes-out]/1074000000)\r\
\n :local mail [:tostr [get \$use email]];\r\
\n :global limit [:pick \$mail -1 [:find \$mail \"@\"]];\r\
\n:if ( \$comm < 5000 ) do={[set \$use comment=(\$comm + \$daynow) ]} else={\
\r\
\n:if ( ( \$daynow - \$comm) >= \"1\" ) do={[remove \$use ]}\r\
\n:if ( \$byte >= \$limit ) do={[set \$use profile=\"low\" ]\r\
\n/ip ho active remove [find user=\$active]} \r\
\n:if ( \$comm <= \$daynow ) do={[set \$use profile=\"finish\" ]\r\
\n/ip ho active remove [find user=\$active]}\r\
\n/ppp active\r\
\n:foreach ppuser in=[find] do={\r\
\n:global ppactive [get \$ppuser name]\r\
\n/ppp secret\r\
\n:foreach ppuse in=[find name=\$ppactive] do={\r\
\n:global ppcomm [get \$ppuse comment]\r\
\n:if ( \$ppcomm < 5000 ) do={[set \$ppuse comment=(\$ppcomm + \$daynow) ]} \
\r\
\n:if ( ( \$daynow - \$ppcomm) >= \"1\" ) do={[remove \$ppuse ]} \r\
\n:if ( \$ppcomm <= \$daynow ) do={[set \$ppuse profile=\"finish\" ]\r\
\n/ppp active remove [find name=\$ppactive]\r\
\n}}}}}}}"
==============================================
===================
{
:local i;
:local j 9144000;
:set i [ :len [/ip hotspot active find] ];
:if ($i=0) do={:set i 1;}
:local x ($j/$i);
:local y ($x/4);
:foreach i in=[/queue simple find] do={/queue simple remove $i;}
:local addr;
:local uname;
:foreach i in=[/ip hotspot active find] do={
:set addr [/ip hotspot active get $i address];
:set uname [/ip hotspot active get $i user];
}
}
{
:local i;
:local content;
:local j 9144000;
:set i [ :len [/ip hotspot active find] ];
:if ($i=0) do={:set i 1;}
:local x ($j/$i);
:local y ($x/4);
:foreach i in=[/queue simple find] do={
:set content [/queue simple get $i comment];
if ($content != "*") do={
/queue simple remove $i;
}
}
:local addr;
:local uname;
:foreach i in=[/ip hotspot active find] do={
:set addr [/ip hotspot active get $i address];
:set uname [/ip hotspot active get $i user];
}
}
{
:local i;
:local j 8144000;
:local x ($j/$i);
:local y ($x/4);
:local addr;
:local uname;
}
}
/ip address
add address=192.168.1.4/24 interface=ether1 network=192.168.1.0
add address=192.168.22.1/24 interface=wlan1 network=192.168.22.0
add address=192.168.40.1/22 interface=ether2 network=192.168.40.0
add address=10.66.77.1/22 interface=ether3 network=10.66.76.0
add address=10.98.122.1/22 interface=ether4 network=10.98.120.0
add address=192.168.222.1/22 interface=ether5 network=192.168.220.0
add address=10.177.11.1/22 interface=ether7 network=10.177.8.0
add address=172.20.177.1/22 interface=ether8 network=172.20.176.0
add address=192.168.114.1/22 interface=ether9 network=192.168.112.0
add address=10.180.23.1/22 interface=ether10 network=10.180.20.0
add address=222.55.22.1/22 interface=ether6 network=222.55.20.0
=======================HotspotGhost==========================
# define variables
:local addr
:local toaddr
:log info "Start Ghost Hotspot Script"
===================================================
===================================================
{:local i;
:local j 8144000;
:set i [ :len [/ip hotspot active find] ];
:if ($i=0) do={:set i 1;}
:local x ($j/$i);
:local y ($x/4);
:foreach i in=[/queue simple find] do={/queue simple remove $i;}
:local addr;
:local uname;
:foreach i in=[/ip hotspot active find] do={
:set addr [/ip hotspot active get $i address];
:set uname [/ip hotspot active get $i user];
}
}
=========================
/ip firewall mangle
add action=mark-packet chain=prerouting comment=pcq-max-limited dst-address=\
!10.22.5.1 new-packet-mark=from_web
=========
{:local i;
:local j 9144000;
:set i [ :len [/ip hotspot active find] ];
:if ($i=0) do={:set i 1;}
:local x ($j/$i);
:local y ($x/3);
:foreach i in=[/queue simple find] do={/queue simple remove $i;}
:local addr;
:local uname;
:foreach i in=[/ip hotspot active find] do={
:set addr [/ip hotspot active get $i address];
:set uname [/ip hotspot active get $i user];
:if ($uname = "oyd19912") do={
/queue simple add name=$uname target=$addr packet-mark=from_web max-
limit="100k/256k";
}else={
:if ($uname ="odai20162") do={
/queue simple add name=$uname target=$addr packet-mark=from_web max-
limit="100k/256k";
}else={
:if ($uname ="nab2016") do={
/queue simple add name=$uname target=$addr packet-mark=from_web max-
limit="100k/256k";
} else={
/queue simple add name=$uname target=$addr packet-marks=from_web
max-limit="$y/$x";
}
}
}
}
}
:foreach i in=[/queue simple find ] do={
:set content [/queue simple get \$i comment;]
:set mainqueue [/queue simple get \$i name;]
:if (\$content != "*") do={
}
tool user-manager user set caller-id="bind"
==================
123 14��
132 13��
143 12��
156 11��
173 10��
193 9��
215 8��
=========================
/ip route
add dst-address=0.0.0.0/0 gateway=192.168.1.1 routing-mark=wan1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.2.1 routing-mark=wan2 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.1.1 distance=1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.2.1 distance=2 check-gateway=ping
/ip route
add check-gateway=ping distance=1 gateway=192.168.1.1 routing-mark=to_WAN1
add check-gateway=ping distance=2 gateway=192.168.2.1 routing-mark=to_WAN1
add check-gateway=ping distance=3 gateway=192.168.3.1 routing-mark=to_WAN1
add check-gateway=ping distance=1 gateway=192.168.2.1 routing-mark=to_WAN2
add check-gateway=ping distance=2 gateway=192.168.3.1 routing-mark=to_WAN2
add check-gateway=ping distance=3 gateway=192.168.4.1 routing-mark=to_WAN2
add check-gateway=ping distance=1 gateway=192.168.3.1 routing-mark=to_WAN3
add check-gateway=ping distance=2 gateway=192.168.4.1 routing-mark=to_WAN3
add check-gateway=ping distance=3 gateway=192.168.2.1 routing-mark=to_WAN3
add check-gateway=ping distance=1 gateway=192.168.4.1 routing-mark=to_WAN4
add check-gateway=ping distance=2 gateway=192.168.1.1 routing-mark=to_WAN4
add check-gateway=ping distance=3 gateway=192.168.1.1 routing-mark=to_WAN4
add check-gateway=ping distance=1 gateway=192.168.1.1
add check-gateway=ping distance=2 gateway=192.168.2.1
add check-gateway=ping distance=3 gateway=192.168.4.1
add check-gateway=ping distance=3 gateway=192.168.3.1
local a $user;
/queue simple add name=$a target=$address packet-marks=from_web;
/queue simple move [find name=$a] [:pick [find] 0];
/system script run scriptakram;
local a $user;
/queue simple remove [ find name=$a ];
/system script run scriptakram;
/system scheduler
add name=scriptakram on-event=":foreach usersdelete in=[/queue simple find
dynamic=no] do={/queue simple remove \$usersdelete;}" policy=read,write start-
time=startup
{
:local countusers;
:local down 9144000;
:set countusers [ :len [/ip hotspot active find] ];
:if ($countusers=0) do={:set countusers 1;}
:local downuser ($down/$countusers);
:local upuser ($downuser/4);
:foreach usersdelete in=[/queue simple find dynamic=yes (!(queue="hotspot-
default/hotspot-default"))] do={/queue simple remove $usersdelete;}
:local useraddress;
:local username;
:foreach usersactive in=[/ip hotspot active find] do={
:set useraddress [/ip hotspot active get $usersactive address];
:set username [/ip hotspot active get $usersactive user];
/queue simple set [ find name=$username ] max-limit="$upuser/$downuser";
}
}
{
:local i;
:local j 9144000;
:set i [ :len [/ip hotspot active find] ];
:if ($i=0) do={:set i 1;}
:local x ($j/$i);
:local y ($x/4);
:local addr;
:local uname;
:foreach i in=[/ip hotspot active find] do={
:set addr [/ip hotspot active get $i address];
:set uname [/ip hotspot active get $i user];
/queue simple set [ find name=$uname] max-limit="$y/$x";
}
}
{
:local countusers;
:local down 9144000;
:set countusers [ :len [/ip hotspot active find] ];
:if ($countusers=0) do={:set countusers 1;}
:local downuser ($down/$countusers);
:local upuser ($downuser/4);
:foreach usersdelete in=[/queue simple find dynamic=yes (!(queue="hotspot-
default/hotspot-default"))] do={/queue simple remove $usersdelete;}
:local useraddress;
:local username;
:foreach usersactive in=[/ip hotspot active find] do={
:set useraddress [/ip hotspot active get $usersactive target-addres];
:set username [/ip hotspot active get $usersactive user];
/queue simple set [ find name=$username ] max-limit="$upuser/$downuser";
}
}
{
:local i;
:local j 8144000;
:set i [ :len [/ip hotspot active find] ];
:if ($i=0) do={:set i 1;}
:local x ($j/$i);
:local y ($x/3);
:foreach i in=[/queue simple find] do={/queue simple remove $i;}
:local addr;
:local uname;
:foreach i in=[/ip hotspot active find] do={
:set addr [/ip hotspot active get $i address];
:set uname [/ip hotspot active get $i user];
}
}
/queue simple set [ find name=nab2017] max-limit=45k/256k;
{
:local i;
:local j 8144000;
:set i [ :len [/ip hotspot active find] ];
:if ($i=0) do={:set i 1;}
:local x ($j/$i);
:local y ($x/4);
:local b 200000;
:local a ($x+$b);
:foreach i in=[/queue simple find] do={/queue simple remove $i;}
:local addr;
:local uname;
:foreach i in=[/ip hotspot active find] do={
:set addr [/ip hotspot active get $i address];
:set uname [/ip hotspot active get $i user];
/queue simple add name=$uname target=$addr max-limit="$y/$x"
burst-limit="$upuser/$a" burst-threshold="$upuser/$a" burst-time="4/4" packet-
marks=from_odai ;
}
}
/system scheduler
add name=odai on-event=":foreach usersdelete in=[/queue simple find dynamic=no]
do={/queue simple remove \$usersdelete;}" policy=read,write start-time=startup
/system script
add name=odai owner=admin policy=read,write source="{\r\
\n:local countusers; \r\
\n:local down 12288000;\r\
\n:set countusers [ :len [/ip hotspot active find] ];\r\
\n:if (\$countusers=0) do={:set countusers 1;}\r\
\n:local downuser (\$down/\$countusers);\r\
\n:local upuser (\$downuser/4);\r\
\n:foreach usersdelete in=[/queue simple find dynamic=yes (!(queue=\"hotspot-
default/hotspot-default\"))] do={/queue simple remove \$usersdelete;}\r\
\n:local useraddress;\r\
\n:local username;\r\
\n:foreach usersactive in=[/ip hotspot active find] do={\r\
\n:set useraddress [/ip hotspot active get \$usersactive address];\r\
\n:set username [/ip hotspot active get \$usersactive user];\r\
\n/queue simple set [ find name=\$username ] max-limit=\"\$upuser/\$downuser\";\r\
\n}\r\
\n}"
rng765765
{
:local i;
:local j 310777216;
:set i [ :len [/ip hotspot active find] ];
:if ($i=0) do={:set i 1;}
:local x ($j/$i);
:local y ($x/4);
:local b 200000;
:local a ($x+$b);
:foreach i in=[/queue simple find] do={/queue simple remove $i;}
:local addr;
:local uname;
:foreach i in=[/ip hotspot active find] do={
:set addr [/ip hotspot active get $i address];
:set uname [/ip hotspot active get $i user];
/queue simple add name=$uname target=$addr max-limit="$y/$x" burst-limit="$y/$a"
burst-threshold="$y/$a" burst-time="4/4" packet-marks=max;
}
}
:local b 100000;
:local a ($x+$b);
burst-limit="$y/$a"
/queue tree
add name=speed-down packet-mark=client_download parent=global queue=PCQ_download
add name=speed-up packet-mark=client_upload parent=global queue=PCQ_upload
/queue type
add kind=pcq name=PCQ_download pcq-burst-rate=762666 pcq-burst-time=30s pcq-
classifier=dst-address pcq-rate=562666
add kind=pcq name=PCQ_upload pcq-burst-time=30s pcq-classifier=src-address pcq-
rate=187555
{
:local i;
:local c 64144000;
:local y ($x+200000);
/queue type set [find name=PCQ_download] pcq-rate=$x pcq-burst-rate=$y;
/queue type set [find name=PCQ_upload] pcq-rate=$up}
:foreach i in=[/queue simple find where dynamic] do={/queue simple remove $i ;}