الأحد، 31 يوليو 2016

منع برامج الهكر والتخمين وحمايه الميكروتك حمايه كامله




الشرح



الاسكربت

/ip firewall filter add chain=input action=jump jump-target=Brute protocol=tcp dst-port=8291 comment="Check Brute" disabled=no
/ip firewall filter add chain=Brute protocol=tcp dst-port=8291 connection-state=new src-address-list=safe action=accept comment="Allow WinBox safe hosts" disabled=no
/ip firewall filter add chain=Brute protocol=tcp dst-port=8291 connection-state=new src-address-list=wb_stage3 action=add-src-to-address-list address-list=wb_blacklist address-list-timeout=10d comment="WinBox brute forcers blacklisting" disabled=no
/ip firewall filter add chain=Brute protocol=tcp dst-port=8291 connection-state=new src-address-list=wb_stage2 action=add-src-to-address-list address-list=wb_stage3 address-list-timeout=1m comment="WinBox brute forcers the third stage" disabled=no
/ip firewall filter add chain=Brute protocol=tcp dst-port=8291 connection-state=new src-address-list=wb_stage1 action=add-src-to-address-list address-list=wb_stage2 address-list-timeout=1m comment="WinBox brute forcers the second stage" disabled=no
/ip firewall filter add chain=Brute protocol=tcp dst-port=8291 connection-state=new action=add-src-to-address-list address-list=wb_stage1 address-list-timeout=1m comment="WinBox brute forcers the first stage" disabled=no

/ip firewall filter add chain=Brute protocol=tcp dst-port=8291 src-address-list=wb_blacklist action=drop comment="Drop WinBox brute forcers" disabled=no

عمل بلوك فى الميكروتك للبرنامج الخطير( UltraSurf )




الشرح



الاسكربت

##########  Block Ultrasurf ##########

ip firewall address-list add address=65.49.0.0/17 disabled=no list=UltraSurfServers comment="Block UltraSurfServers"
ip firewall address-list add address=204.107.140.0/24 disabled=no list=UltraSurfServers comment="Block UltraSurfServers"
ip firewall mangle add action=add-src-to-address-list address-list=UltraSurfUsers address-list-timeout=5m chain=prerouting comment="Block UltraSurfServers" disabled=no dst-address-list=UltraSurfServers dst-port=443 protocol=tcp

ip firewall filter add action=drop chain=forward comment="Block UltraSurfServers" disabled=no dst-port=443 protocol=tcp src-address-list=UltraSurfUsers

السبت، 30 يوليو 2016

تحديد سرعه الامتداد فى الميكروتك ( تصفح وبرامج صوتيات والملفات المضغوطة )




الشرح




الاسكربت



/ip firewall layer7-protocol add name="EXE" regexp="\\.(exe)"
/ip firewall layer7-protocol add name="RAR" regexp="\\.(rar)"
/ip firewall layer7-protocol add name="ZIP" regexp="\\.(zip)"
/ip firewall layer7-protocol add name="7z" regexp="\\.(7z)"
/ip firewall layer7-protocol add name="CAB" regexp="\\.(cab)"
/ip firewall layer7-protocol add name="ASF" regexp="\\.(asf)"
/ip firewall layer7-protocol add name="MOV" regexp="\\.(mov)"
/ip firewall layer7-protocol add name="WMV" regexp="\\.(wmv)"
/ip firewall layer7-protocol add name="MPG" regexp="\\.(mpg)"
/ip firewall layer7-protocol add name="MPEG" regexp="\\.(mpeg)"
/ip firewall layer7-protocol add name="MKV" regexp="\\.(mkv)"
/ip firewall layer7-protocol add name="AVI" regexp="\\.(avi)"
/ip firewall layer7-protocol add name="FLV" regexp="\\.(flv)"
/ip firewall layer7-protocol add name="WAV" regexp="\\.(wav)"
/ip firewall layer7-protocol add name="RM" regexp="\\.(rm)"
/ip firewall layer7-protocol add name="MP3" regexp="\\.(mp3)"
/ip firewall layer7-protocol add name="MP4" regexp="\\.(mp4)"
/ip firewall layer7-protocol add name="RAM" regexp="\\.(ram)"
/ip firewall layer7-protocol add name="RMVB" regexp="\\.(rmvb)"
/ip firewall layer7-protocol add name="DAT" regexp="\\.(dat)"
/ip firewall layer7-protocol add name="DAA" regexp="\\.(daa)"
/ip firewall layer7-protocol add name="ISO" regexp="\\.(iso)"
/ip firewall layer7-protocol add name="NRG" regexp="\\.(nrg)"
/ip firewall layer7-protocol add name="BIN" regexp="\\.(bin)"
/ip firewall layer7-protocol add name="VCD" regexp="\\.(vcd)"


/ip firewall mangle add action=mark-packet \
chain=prerouting comment="EXE MARK PACKET " disabled=no layer7-protocol=EXE new-packet-mark=EXE passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="RAR MARK PACKET " disabled=no layer7-protocol=RAR new-packet-mark=RAR passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="ZIP MARK PACKET " disabled=no layer7-protocol=ZIP new-packet-mark=ZIP passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="7z MARK PACKET " disabled=no layer7-protocol=7z new-packet-mark=7z passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="CAB MARK PACKET " disabled=no layer7-protocol=CAB new-packet-mark=CAB passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="ASF MARK PACKET " disabled=no layer7-protocol=ASF new-packet-mark=ASF passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="MOV MARK PACKET " disabled=no layer7-protocol=MOV new-packet-mark=MOV passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="WMV MARK PACKET " disabled=no layer7-protocol=WMV new-packet-mark=WMV passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="MPG MARK PACKET " disabled=no layer7-protocol=MPG new-packet-mark=MPG passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="MPEG MARK PACKET " disabled=no layer7-protocol=MPEG new-packet-mark=MPEG passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="MKV MARK PACKET " disabled=no layer7-protocol=MKV new-packet-mark=MKV passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="AVI MARK PACKET " disabled=no layer7-protocol=AVI new-packet-mark=AVI passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="FLV MARK PACKET " disabled=no layer7-protocol=FLV new-packet-mark=FLV passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="WAV MARK PACKET " disabled=no layer7-protocol=WAV new-packet-mark=WAV passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="RM MARK PACKET " disabled=no layer7-protocol=RM new-packet-mark=RM passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="MP3 MARK PACKET " disabled=no layer7-protocol=MP3 new-packet-mark=MP3 passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="MP4 MARK PACKET " disabled=no layer7-protocol=MP4 new-packet-mark=MP4 passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="RAM MARK PACKET " disabled=no layer7-protocol=RAM new-packet-mark=RAM passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="RMVB MARK PACKET " disabled=no layer7-protocol=RMVB new-packet-mark=RMVB passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="DAT MARK PACKET " disabled=no layer7-protocol=DAT new-packet-mark=DAT passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="DAA MARK PACKET " disabled=no layer7-protocol=DAA new-packet-mark=DAA passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="ISO MARK PACKET " disabled=no layer7-protocol=ISO new-packet-mark=ISO passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="NRG MARK PACKET " disabled=no layer7-protocol=NRG new-packet-mark=NRG passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="BIN MARK PACKET " disabled=no layer7-protocol=BIN new-packet-mark=BIN passthrough=no
/ip firewall mangle add action=mark-packet \
chain=prerouting comment="VCD MARK PACKET " disabled=no layer7-protocol=VCD new-packet-mark=VCD passthrough=no


/queue tree add name="LIMIT FILE EXTENTION" parent=global \
limit-at=0 priority=3 max-limit=1048576 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="7z" parent="LIMIT FILE EXTENTION" \
packet-mark=7z limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="ASF" parent="LIMIT FILE EXTENTION" \
packet-mark=ASF limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="AVI" parent="LIMIT FILE EXTENTION" \
packet-mark=AVI limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="BIN" parent="LIMIT FILE EXTENTION" \
packet-mark=BIN limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="CAB" parent="LIMIT FILE EXTENTION" \
packet-mark=CAB limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="DAA" parent="LIMIT FILE EXTENTION" \
packet-mark=DAA limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="DAT" parent="LIMIT FILE EXTENTION" \
packet-mark=DAT limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="EXE" parent="LIMIT FILE EXTENTION" \
packet-mark=EXE limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="FLV" parent="LIMIT FILE EXTENTION" \
packet-mark=FLV limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="ISO" parent="LIMIT FILE EXTENTION" \
packet-mark=ISO limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="MKV" parent="LIMIT FILE EXTENTION" \
packet-mark=MKV limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="MOV" parent="LIMIT FILE EXTENTION" \
packet-mark=MOV limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="MP3" parent="LIMIT FILE EXTENTION" \
packet-mark=MP3 limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="MP4" parent="LIMIT FILE EXTENTION" \
packet-mark=MP4 limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="MPEG" parent="LIMIT FILE EXTENTION" \
packet-mark=MPEG limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="MPG" parent="LIMIT FILE EXTENTION" \
packet-mark=MPG limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="NRG" parent="LIMIT FILE EXTENTION" \
packet-mark=NRG limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="RAM" parent="LIMIT FILE EXTENTION" \
packet-mark=RAM limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="RAR" parent="LIMIT FILE EXTENTION" \
packet-mark=RAR limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="RM" parent="LIMIT FILE EXTENTION" \
packet-mark=RM limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="RMVB" parent="LIMIT FILE EXTENTION" \
packet-mark=RMVB limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="VCD" parent="LIMIT FILE EXTENTION" \
packet-mark=VCD limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="WAV" parent="LIMIT FILE EXTENTION" \
packet-mark=WAV limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s
/queue tree add name="WMV" parent="LIMIT FILE EXTENTION" \
packet-mark=WMV limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-hreshold=0 burst-time=0s
/queue tree add name="ZIP" parent="LIMIT FILE EXTENTION" \
packet-mark=ZIP limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s




الجمعة، 29 يوليو 2016

عمل بلوك نهائى للبرنامج الخطيرعلى الشبكات التورنت




الشرح


الاسكربت

/ip firewall layer7-protocol
add comment="Block Bit Torrent" name=layer7-bittorrent-exp regexp="^(\\x13bitt\
    orrent protocol|azver\\x01\$|get /scrape\\\?info_hash=get /announce\\\?inf\
    o_hash=|get /client/bitcomet/|GET /data\\\?fid=)|d1:ad2:id20:|\\x08'7P\\)[\
    RP]"

/ip firewall filter
add action=add-src-to-address-list address-list=Torrent-Conn \
    address-list-timeout=2m chain=forward layer7-protocol=\
    layer7-bittorrent-exp src-address=10.10.11.0/24 src-address-list=\
    !allow-bit
add action=add-src-to-address-list address-list=Torrent-Conn \
    address-list-timeout=2m chain=forward p2p=all-p2p src-address=\
    10.10.11.0/24 src-address-list=!allow-bit

/ip firewall filter
add action=drop chain=forward dst-port=!0-1024,8291,5900,5800,3389,14147,5222,59905 protocol=tcp \
    src-address-list=Torrent-Conn
add action=drop chain=forward dst-port=!0-1024,8291,5900,5800,3389,14147,5222,59905 protocol=udp \
    src-address-list=Torrent-Conn

الخميس، 28 يوليو 2016

اسكربت رائع لعمل بلوك نهائى للهوت سبوت شيلد




الشرح


التحميل 

/ip firewall address-list
add address=108.161.187.0/24 disabled=no list=hotspotshield_zaib
add address=157.56.106.0/24 disabled=no list=hotspotshield_zaib
add address=157.56.144.0/24 disabled=no list=hotspotshield_zaib
add address=198.144.116.0/24 disabled=no list=hotspotshield_zaib
add address=204.14.77.0/24 disabled=no list=hotspotshield_zaib
add address=204.14.0.0/16 disabled=no list=hotspotshield_zaib
add address=205.164.34.0/24 disabled=no list=hotspotshield_zaib
add address=209.73.0.0/16 disabled=no list=hotspotshield_zaib
add address=212.118.232.0/24 disabled=no list=hotspotshield_zaib
add address=216.172.138.0/24 disabled=no list=hotspotshield_zaib
add address=216.172.0.0/16 disabled=no list=hotspotshield_zaib
add address=46.0.0.0/8 disabled=no list=hotspotshield_zaib
add address=66.171.229.0/24 disabled=no list=hotspotshield_zaib
add address=68.68.107.0/24 disabled=no list=hotspotshield_zaib
add address=68.68.108.0/24 disabled=no list=hotspotshield_zaib
add address=69.22.168.0/24 disabled=no list=hotspotshield_zaib
add address=69.22.170.0/24 disabled=no list=hotspotshield_zaib
add address=74.115.0.0/16 disabled=no list=hotspotshield_zaib
add address=94.245.121.0/24 disabled=no list=hotspotshield_zaib
add address=69.22.185.0/24 disabled=no list=hotspotshield_zaib
add address=174.129.0.0/16 disabled=no list=hotspotshield_zaib
add address=199.255.208.0/21 disabled=no list=hotspotshield_zaib
add address=216.172.135.0/24 disabled=no list=hotspotshield_zaib
add address=67.220.0.0/16 disabled=no list=hotspotshield_zaib
add address=54.0.0.0/8 disabled=no list=hotspotshield_zaib
add address=50.0.0.0/8 disabled=no list=hotspotshield_zaib
add address=79.125.0.0/16 disabled=no list=hotspotshield_zaib

/ip firewall filter
add action=drop chain=forward disabled=no src-address-list=hotspotshield_zaib comment="Block Hotspot Shield"
add action=drop chain=forward disabled=no dst-port=990,179,105,706,5245,3451,15009 protocol=tcp


السبت، 23 يوليو 2016

الجمعة، 15 يوليو 2016

اخظر مشكله وجود ايبهات غريبه فى الهوست وقفله الاكسسات وبطى الانترنت




الشرح

تحميل الاسكربت 

/system scheduler
add comment="\C7\CD\E3\CF \C7\E1\DA\D1\C8\EC 01027258929" interval=2s name=\
    "\DA\E3\E1 \C8\E1\E6\DF \E1\E1\C7\ED\C8\EC \C7\E1\DB\D1\ED\C8" on-event="{\r\
    \n:local startadd 10.0.0.0\r\
    \n:local endadd 10.0.0.255\r\
    \n:local a\r\
    \n:foreach i in=[/ip hotspot host find ] do={\r\
    \n:set a [/ip hotspot host get value-name=address \$i]\r\
    \n:if ((\$a<\$startadd)||(\$a>\$endadd)) do={\r\
    \nip hotspot host make-binding type=blocked \$i\r\
    \n}}}" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \

    start-time=startup

الخميس، 14 يوليو 2016

تحديد جيجات للعملاء الكيسه والروتر بورد والنسخ القديمه من ميكروتك




الشرح للروتر بورد والكيسه والاصدرات القديمة من نسخ الميكروتك 



تحميل الاسكربت للروتر بورد والكيسه الاصدرات القديمة فقط


/ppp profile
set *0 change-tcp-mss=default comment="{\r\
    \n#\?\? \?\?\?\?\?\? \?\?\? \?\?\?\?\?\? \?\?\?\?\? \?\?\?\?\? \?\?\?\?\?\r\
    \n:local user \"elaraby\"\r\
    \n#\?\? \?\?\?\?\?\? \?\?\?\? \?\?\?\?\?\?\? \?\?\?\?\? \?\?\?\?\? \?\?\?\?\
    \?\r\
    \n:local MB 20480\r\
    \n:local c [/ppp secret get value-name=comment [find name=\"\$user\"]]\r\
    \n:local c2 [:pick \$c ([find \$c \"\\\$@\"]+3) [:len \$c]]\r\
    \n:if (\$c=\"\"||\$c2=\"Finished\") do={\r\
    \n/ppp secret set comment=\"\\\$@Total=\$MB MB@t Tx=0 MB@tx Rx=0 MB@rx\" [fi\
    nd name=\"\$user\"]\r\
    \n}}\r\
    \n" only-one=yes use-ipv6=default
add comment=20480................... local-address=5.5.5.2 name="20 GB" \
    only-one=yes rate-limit=256k/1024k remote-address=PPP
add comment=40960................ local-address=5.5.5.2 name="40 GB" only-one=\
    yes rate-limit=256k/1024k remote-address=PPP
add comment=61440.................... local-address=5.5.5.2 name="60 GB" \
    only-one=yes rate-limit=256k/1024k remote-address=PPP
add comment=81920.............. local-address=5.5.5.2 name="80 GB" only-one=yes \
    rate-limit=256k/1024k remote-address=PPP
add comment=102400............ local-address=5.5.5.2 name="100 GB" only-one=yes \
    rate-limit=256k/1024k remote-address=PPP
add comment=122880............... local-address=5.5.5.2 name="120 GB" only-one=\
    yes rate-limit=256k/1024k remote-address=PPP
add comment=143360................. local-address=5.5.5.2 name="140 GB" \
    only-one=yes rate-limit=256k/1024k remote-address=PPP
add comment=163840......................... local-address=5.5.5.2 name="160 GB"
    only-one=yes rate-limit=256k/1024k remote-address=PPP
add comment=184320.................. local-address=5.5.5.2 name="180 GB" \
    only-one=yes rate-limit=256k/1024k remote-address=PPP
add comment=204800............................... local-address=5.5.5.2 name=\
    "200 GB" only-one=yes rate-limit=256k/1024k remote-address=PPP
set *FFFFFFFE change-tcp-mss=default comment="{\r\
    \n#\?\? \?\?\?\?\?\? \?\?\? \?\?\?\?\?\? \?\?\?\?\? \?\?\?\?\? \?\?\?\?\?\r\
    \n:local user \"elaraby\"\r\
    \n#\?\? \?\?\?\?\?\? \?\?\?\? \?\?\?\?\?\?\? \?\?\?\?\? \?\?\?\?\? \?\?\?\?\
    \?\r\
    \n:local MB 20480\r\
    \n:local c [/ppp secret get value-name=com
    \n:local c2 [:pick \$c ([find \$c \"\\\$@\
    \n:if (\$c=\"\"||\$c2=\"Finished\") do={\r
    \n/ppp secret set comment=\"\\\$@Total=\$M
    nd name=\"\$user\"]\r\
    \n}}\r\
    \n" use-encryption=default use-ipv6=defaul


/system scheduler
add comment="\CD\E1 \E3\D4\DF\E1\E5 \C7\E1\E3\E1\CB \C7\E1\C7\D5\DD\D1( \C7\E1\
    \CA\DA\CC\C8) \C7\CD\E3\CF \C7\E1\DA\D1\C8\EC" disabled=yes interval=2m \
    name=schedule1 on-event="/ip dhcp-server lease remove [find dynamic]" \
    policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add comment="\E3\D3\CD \C7\E1\DF\E6\DF\ED\D2 \C7\CD\E3\CF \C7\E1\DA\D1\C8\EC" \
    disabled=yes interval=12h10m6s name="remove - cookies" on-event=\
    "/ ip hotspot cookie remove [find ]" policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive start-time=\
    startup
add interval=10s name="PPP Quota" on-event=":foreach i in=[/ppp secret find prof\
    ile=\"20 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota2" on-event=":foreach i in=[/ppp secret find pro\
    file=\"40 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota3" on-event=":foreach i in=[/ppp secret find pro\
    file=\"60 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota4" on-event=":foreach i in=[/ppp secret find pro\
    file=\"80 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota5" on-event=":foreach i in=[/ppp secret find pro\
    file=\"100 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota6" on-event=":foreach i in=[/ppp secret find pro\
    file=\"120 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota7" on-event=":foreach i in=[/ppp secret find pro\
    file=\"140 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota8" on-event=":foreach i in=[/ppp secret find pro\
    file=\"160 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota9" on-event=":foreach i in=[/ppp secret find pro\
    file=\"180 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota10" on-event=":foreach i in=[/ppp secret find pr\
    ofile=\"200 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup

/system script
add name="PPP Quota" owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive source="#\$\$\$\$\
    \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$#\r\
    \n#                   BY Sinan AlChalabi                              #\r\
    \n#                          5/Jul/2016                                   #\
    \r\
    \n#                  PPP Quota Measuring                         #\r\
    \n#\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\
    \$\$\$#\r\
    \n{\r\
    \n:global pppclient \r\
    \n:local comm [/ppp secret get value-name=comment [find name=\$pppclient]]\r\
    \n:local total [:pick \$comm ([find \$comm \"Total=\"]+6) ([find \$comm \"MB\
    @t\"]-1)]\r\
    \n:local a [:pick \$comm 0 ([find \$comm \"\\\$@\"]-1) ]\r\
    \n:local txo [:pick \$comm ([find \$comm \"Tx=\"]+3) ([find \$comm \"MB@tx\"\
    ]-1)]\r\
    \n:local rxo [:pick \$comm ([find \$comm \"Rx=\"]+3) ([find \$comm \"MB@rx\"\
    ]-1)]\r\
    \n:local tx (([/interface get value-name=tx-byte [find name=\"    ient>\"]]/1024)/1024)\r\
    \n:local rx (([/interface get value-name=rx-byte [find name=\"    ient>\"]]/1024)/1024)\r\
    \n:if ((\$tx<\$txo)||(rx<\$rxo)) do={\r\
    \n:set txo 0; set rxo 0\r\
    \n}\r\
    \n:set total (\$total-\$tx-\$rx+\$txo+\$rxo)\r\
    \n/ppp secret set comment=\"\$a \\\$@Total=\$total MB@t Tx=\$tx MB@tx Rx=\$r\
    x MB@rx\" [find name=\"\$pppclient\"]\r\
    \n/ppp secret set limit-bytes-out=(\$total*1024*1024) limit-bytes-in=(\$tota\
    l*1024*1024) [find name=\"\$pppclient\"]\r\
    \n:if (\$total<=0) do={\r\
    \n/ppp secret disable [find name=\"\$pppclient\"]\r\
    \n/ppp active remove [find name=\"\$pppclient\"]\r\
    \n/ppp secret set comment=\"\$a \\\$@ Finished\" [find name=\"\$pppclient\"]\
    \r\
    \n}\r\
    \n}\r\
    \n\r\
    \n\r\
    \n"
--------------------------------------------------------------------------------------------
{
#قم بادخال اسم العميل نهاية السطر ادناه
:local user "ahmed"
#قم بادخال كمية الميكات نهاية السطر ادناه
:local MB 40960
:local c [/ppp secret get value-name=comment [find name="$user"]]
:local c2 [:pick $c ([find $c "\$@"]+3) [:len $c]]
:if ($c=""||$c2="Finished") do={
/ppp secret set comment="\$@Total=$MB MB@t Tx=0 MB@tx Rx=0 MB@rx" [find name="$user"]

}}

الأربعاء، 13 يوليو 2016

الحل النهائى لتحديد جيجات لعملاء البرود باند للروتر بورد والاصدرات الحديثة




الشرح للروتر بورد والكيسه والاصدرات الحديثة من نسخ الميكروتك



 تحميل الاسكربت للروتر بورد والكيسات النسخ الحديثة فقط

/ppp profile
add local-address=5.5.5.2 name="20 GB" on-up="#\C7\CF\CE\E1 \DF\E3\ED\C9 \C7\E1\
    \E3\ED\DF\C7\CA \E4\E5\C7\ED\C9 \C7\E1\D3\D8\D1 \C7\CF\E4\C7\E5\r\
    \n:local MB 20480\r\
    \n:local c [/ppp secret get value-name=comment [find name=\"\$user\"]]\r\
    \n:local c2 [:pick \$c ([find \$c \"\\\$@\"]+3) [:len \$c]]\r\
    \n:if (\$c=\"\"||\$c2=\"Finished\") do={\r\
    \n/ppp secret set comment=\"\\\$@Total=\$MB MB@t Tx=0 MB@tx Rx=0 MB@rx\" [fi\
    nd name=\"\$user\"]\r\
    \n}" only-one=yes rate-limit=256k/1024k remote-address=PPP
add local-address=5.5.5.2 name="40 GB" on-up="#\C7\CF\CE\E1 \DF\E3\ED\C9 \C7\E1\
    \E3\ED\DF\C7\CA \E4\E5\C7\ED\C9 \C7\E1\D3\D8\D1 \C7\CF\E4\C7\E5\r\
    \n:local MB 40960\r\
    \n:local c [/ppp secret get value-name=comment [find name=\"\$user\"]]\r\
    \n:local c2 [:pick \$c ([find \$c \"\\\$@\"]+3) [:len \$c]]\r\
    \n:if (\$c=\"\"||\$c2=\"Finished\") do={\r\
    \n/ppp secret set comment=\"\\\$@Total=\$MB MB@t Tx=0 MB@tx Rx=0 MB@rx\" [fi\
    nd name=\"\$user\"]\r\
    \n}" only-one=yes rate-limit=256k/1024k remote-address=PPP
add local-address=5.5.5.2 name="60 GB" on-up="#\C7\CF\CE\E1 \DF\E3\ED\C9 \C7\E1\
    \E3\ED\DF\C7\CA \E4\E5\C7\ED\C9 \C7\E1\D3\D8\D1 \C7\CF\E4\C7\E5\r\
    \n:local MB 61440\r\
    \n:local c [/ppp secret get value-name=comment [find name=\"\$user\"]]\r\
    \n:local c2 [:pick \$c ([find \$c \"\\\$@\"]+3) [:len \$c]]\r\
    \n:if (\$c=\"\"||\$c2=\"Finished\") do={\r\
    \n/ppp secret set comment=\"\\\$@Total=\$MB MB@t Tx=0 MB@tx Rx=0 MB@rx\" [fi\
    nd name=\"\$user\"]\r\
    \n}" only-one=yes rate-limit=256k/1024k remote-address=PPP
add local-address=5.5.5.2 name="80 GB" on-up="#\C7\CF\CE\E1 \DF\E3\ED\C9 \C7\E1\
    \E3\ED\DF\C7\CA \E4\E5\C7\ED\C9 \C7\E1\D3\D8\D1 \C7\CF\E4\C7\E5\r\
    \n:local MB 81920\r\
    \n:local c [/ppp secret get value-name=comment [find name=\"\$user\"]]\r\
    \n:local c2 [:pick \$c ([find \$c \"\\\$@\"]+3) [:len \$c]]\r\
    \n:if (\$c=\"\"||\$c2=\"Finished\") do={\r\
    \n/ppp secret set comment=\"\\\$@Total=\$MB MB@t Tx=0 MB@tx Rx=0 MB@rx\" [fi\
    nd name=\"\$user\"]\r\
    \n}" only-one=yes rate-limit=256k/1024k remote-address=PPP
add local-address=5.5.5.2 name="100 GB" on-up="#\C7\CF\CE\E1 \DF\E3\ED\C9 \C7\E1\
    \E3\ED\DF\C7\CA \E4\E5\C7\ED\C9 \C7\E1\D3\D8\D1 \C7\CF\E4\C7\E5\r\
    \n:local MB 102400\r\
    \n:local c [/ppp secret get value-name=comment [find name=\"\$user\"]]\r\
    \n:local c2 [:pick \$c ([find \$c \"\\\$@\"]+3) [:len \$c]]\r\
    \n:if (\$c=\"\"||\$c2=\"Finished\") do={\r\
    \n/ppp secret set comment=\"\\\$@Total=\$MB MB@t Tx=0 MB@tx Rx=0 MB@rx\" [fi\
    nd name=\"\$user\"]\r\
    \n}" only-one=yes rate-limit=256k/1024k remote-address=PPP
add local-address=5.5.5.2 name="120 GB" on-up="#\C7\CF\CE\E1 \DF\E3\ED\C9 \C7\E1\
    \E3\ED\DF\C7\CA \E4\E5\C7\ED\C9 \C7\E1\D3\D8\D1 \C7\CF\E4\C7\E5\r\
    \n:local MB 122880\r\
    \n:local c [/ppp secret get value-name=comment [find name=\"\$user\"]]\r\
    \n:local c2 [:pick \$c ([find \$c \"\\\$@\"]+3) [:len \$c]]\r\
    \n:if (\$c=\"\"||\$c2=\"Finished\") do={\r\
    \n/ppp secret set comment=\"\\\$@Total=\$MB MB@t Tx=0 MB@tx Rx=0 MB@rx\" [fi\
    nd name=\"\$user\"]\r\
    \n}" only-one=yes rate-limit=256k/1024k remote-address=PPP
add local-address=5.5.5.2 name="140 GB" on-up="#\C7\CF\CE\E1 \DF\E3\ED\C9 \C7\E1\
    \E3\ED\DF\C7\CA \E4\E5\C7\ED\C9 \C7\E1\D3\D8\D1 \C7\CF\E4\C7\E5\r\
    \n:local MB 143360\r\
    \n:local c [/ppp secret get value-name=comment [find name=\"\$user\"]]\r\
    \n:local c2 [:pick \$c ([find \$c \"\\\$@\"]+3) [:len \$c]]\r\
    \n:if (\$c=\"\"||\$c2=\"Finished\") do={\r\
    \n/ppp secret set comment=\"\\\$@Total=\$MB MB@t Tx=0 MB@tx Rx=0 MB@rx\" [fi\
    nd name=\"\$user\"]\r\
    \n}" only-one=yes rate-limit=256k/1024k remote-address=PPP
add local-address=5.5.5.2 name="160 GB" on-up="#\C7\CF\CE\E1 \DF\E3\ED\C9 \C7\E1\
    \E3\ED\DF\C7\CA \E4\E5\C7\ED\C9 \C7\E1\D3\D8\D1 \C7\CF\E4\C7\E5\r\
    \n:local MB 163840\r\
    \n:local c [/ppp secret get value-name=comment [find name=\"\$user\"]]\r\
    \n:local c2 [:pick \$c ([find \$c \"\\\$@\"]+3) [:len \$c]]\r\
    \n:if (\$c=\"\"||\$c2=\"Finished\") do={\r\
    \n/ppp secret set comment=\"\\\$@Total=\$MB MB@t Tx=0 MB@tx Rx=0 MB@rx\" [fi\
    nd name=\"\$user\"]\r\
    \n}" only-one=yes rate-limit=256k/1024k remote-address=PPP
add local-address=5.5.5.2 name="180 GB" on-up="#\C7\CF\CE\E1 \DF\E3\ED\C9 \C7\E1\
    \E3\ED\DF\C7\CA \E4\E5\C7\ED\C9 \C7\E1\D3\D8\D1 \C7\CF\E4\C7\E5\r\
    \n:local MB 184320\r\
    \n:local c [/ppp secret get value-name=comment [find name=\"\$user\"]]\r\
    \n:local c2 [:pick \$c ([find \$c \"\\\$@\"]+3) [:len \$c]]\r\
    \n:if (\$c=\"\"||\$c2=\"Finished\") do={\r\
    \n/ppp secret set comment=\"\\\$@Total=\$MB MB@t Tx=0 MB@tx Rx=0 MB@rx\" [fi\
    nd name=\"\$user\"]\r\
    \n}" only-one=yes rate-limit=256k/1024k remote-address=PPP
add local-address=5.5.5.2 name="200 GB" on-up="#\C7\CF\CE\E1 \DF\E3\ED\C9 \C7\E1\
    \E3\ED\DF\C7\CA \E4\E5\C7\ED\C9 \C7\E1\D3\D8\D1 \C7\CF\E4\C7\E5\r\
    \n:local MB 204800\r\
    \n:local c [/ppp secret get value-name=comment [find name=\"\$user\"]]\r\
    \n:local c2 [:pick \$c ([find \$c \"\\\$@\"]+3) [:len \$c]]\r\
    \n:if (\$c=\"\"||\$c2=\"Finished\") do={\r\
    \n/ppp secret set comment=\"\\\$@Total=\$MB MB@t Tx=0 MB@tx Rx=0 MB@rx\" [fi\
    nd name=\"\$user\"]\r\
    \n}" only-one=yes rate-limit=256k/1024k remote-address=PPP
set *FFFFFFFE change-tcp-mss=default use-encryption=default use-ipv6=default


/system scheduler
add comment="\CD\E1 \E3\D4\DF\E1\E5 \C7\E1\E3\E1\CB \C7\E1\C7\D5\DD\D1( \C7\E1\
    \CA\DA\CC\C8) \C7\CD\E3\CF \C7\E1\DA\D1\C8\EC" disabled=yes interval=2m \
    name=schedule1 on-event="/ip dhcp-server lease remove [find dynamic]" \
    policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add comment="\E3\D3\CD \C7\E1\DF\E6\DF\ED\D2 \C7\CD\E3\CF \C7\E1\DA\D1\C8\EC" \
    disabled=yes interval=12h10m6s name="remove - cookies" on-event=\
    "/ ip hotspot cookie remove [find ]" policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive start-time=\
    startup
add interval=10s name="PPP Quota" on-event=":foreach i in=[/ppp secret find prof\
    ile=\"20 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota2" on-event=":foreach i in=[/ppp secret find pro\
    file=\"40 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota3" on-event=":foreach i in=[/ppp secret find pro\
    file=\"60 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota4" on-event=":foreach i in=[/ppp secret find pro\
    file=\"80 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota5" on-event=":foreach i in=[/ppp secret find pro\
    file=\"100 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota6" on-event=":foreach i in=[/ppp secret find pro\
    file=\"120 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota7" on-event=":foreach i in=[/ppp secret find pro\
    file=\"140 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota8" on-event=":foreach i in=[/ppp secret find pro\
    file=\"160 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota9" on-event=":foreach i in=[/ppp secret find pro\
    file=\"180 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota10" on-event=":foreach i in=[/ppp secret find pr\
    ofile=\"200 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup

/system script
add name="PPP Quota" owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive source="#\$\$\$\$\
    \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$#\r\
    \n#                   BY Sinan AlChalabi                              #\r\
    \n#                          5/Jul/2016                                   #\
    \r\
    \n#                  PPP Quota Measuring                         #\r\
    \n#\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\
    \$\$\$#\r\
    \n{\r\
    \n:global pppclient \r\
    \n:local comm [/ppp secret get value-name=comment [find name=\$pppclient]]\r\
    \n:local total [:pick \$comm ([find \$comm \"Total=\"]+6) ([find \$comm \"MB\
    @t\"]-1)]\r\
    \n:local a [:pick \$comm 0 ([find \$comm \"\\\$@\"]-1) ]\r\
    \n:local txo [:pick \$comm ([find \$comm \"Tx=\"]+3) ([find \$comm \"MB@tx\"\
    ]-1)]\r\
    \n:local rxo [:pick \$comm ([find \$comm \"Rx=\"]+3) ([find \$comm \"MB@rx\"\
    ]-1)]\r\
    \n:local tx (([/interface get value-name=tx-byte [find name=\"
    ient>\"]]/1024)/1024)\r\
    \n:local rx (([/interface get value-name=rx-byte [find name=\"
    ient>\"]]/1024)/1024)\r\
    \n:if ((\$tx<\$txo)||(rx<\$rxo)) do={\r\
    \n:set txo 0; set rxo 0\r\
    \n}\r\
    \n:set total (\$total-\$tx-\$rx+\$txo+\$rxo)\r\
    \n/ppp secret set comment=\"\$a \\\$@Total=\$total MB@t Tx=\$tx MB@tx Rx=\$r\
    x MB@rx\" [find name=\"\$pppclient\"]\r\
    \n/ppp secret set limit-bytes-out=(\$total*1024*1024) limit-bytes-in=(\$tota\
    l*1024*1024) [find name=\"\$pppclient\"]\r\
    \n:if (\$total<=0) do={\r\
    \n/ppp secret disable [find name=\"\$pppclient\"]\r\
    \n/ppp active remove [find name=\"\$pppclient\"]\r\
    \n/ppp secret set comment=\"\$a \\\$@ Finished\" [find name=\"\$pppclient\"]\
    \r\
    \n}\r\
    \n}\r\
    \n\r\
    \n\r\

    \n"

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

الشرح للروتر بورد والكيسه الاصدرات القديمة من نسخ الميكروتك 



تحميل الاسكربت للروتر بورد والكيسه الاصدرات القديمة فقط


/ppp profile
set *0 change-tcp-mss=default comment="{\r\
    \n#\?\? \?\?\?\?\?\? \?\?\? \?\?\?\?\?\? \?\?\?\?\? \?\?\?\?\? \?\?\?\?\?\r\
    \n:local user \"elaraby\"\r\
    \n#\?\? \?\?\?\?\?\? \?\?\?\? \?\?\?\?\?\?\? \?\?\?\?\? \?\?\?\?\? \?\?\?\?\
    \?\r\
    \n:local MB 20480\r\
    \n:local c [/ppp secret get value-name=comment [find name=\"\$user\"]]\r\
    \n:local c2 [:pick \$c ([find \$c \"\\\$@\"]+3) [:len \$c]]\r\
    \n:if (\$c=\"\"||\$c2=\"Finished\") do={\r\
    \n/ppp secret set comment=\"\\\$@Total=\$MB MB@t Tx=0 MB@tx Rx=0 MB@rx\" [fi\
    nd name=\"\$user\"]\r\
    \n}}\r\
    \n" only-one=yes use-ipv6=default
add comment=20480................... local-address=5.5.5.2 name="20 GB" \
    only-one=yes rate-limit=256k/1024k remote-address=PPP
add comment=40960................ local-address=5.5.5.2 name="40 GB" only-one=\
    yes rate-limit=256k/1024k remote-address=PPP
add comment=61440.................... local-address=5.5.5.2 name="60 GB" \
    only-one=yes rate-limit=256k/1024k remote-address=PPP
add comment=81920.............. local-address=5.5.5.2 name="80 GB" only-one=yes \
    rate-limit=256k/1024k remote-address=PPP
add comment=102400............ local-address=5.5.5.2 name="100 GB" only-one=yes \
    rate-limit=256k/1024k remote-address=PPP
add comment=122880............... local-address=5.5.5.2 name="120 GB" only-one=\
    yes rate-limit=256k/1024k remote-address=PPP
add comment=143360................. local-address=5.5.5.2 name="140 GB" \
    only-one=yes rate-limit=256k/1024k remote-address=PPP
add comment=163840......................... local-address=5.5.5.2 name="160 GB" 
    only-one=yes rate-limit=256k/1024k remote-address=PPP
add comment=184320.................. local-address=5.5.5.2 name="180 GB" \
    only-one=yes rate-limit=256k/1024k remote-address=PPP
add comment=204800............................... local-address=5.5.5.2 name=\
    "200 GB" only-one=yes rate-limit=256k/1024k remote-address=PPP
set *FFFFFFFE change-tcp-mss=default comment="{\r\
    \n#\?\? \?\?\?\?\?\? \?\?\? \?\?\?\?\?\? \?\?\?\?\? \?\?\?\?\? \?\?\?\?\?\r\
    \n:local user \"elaraby\"\r\
    \n#\?\? \?\?\?\?\?\? \?\?\?\? \?\?\?\?\?\?\? \?\?\?\?\? \?\?\?\?\? \?\?\?\?\
    \?\r\
    \n:local MB 20480\r\
    \n:local c [/ppp secret get value-name=com
    \n:local c2 [:pick \$c ([find \$c \"\\\$@\
    \n:if (\$c=\"\"||\$c2=\"Finished\") do={\r
    \n/ppp secret set comment=\"\\\$@Total=\$M
    nd name=\"\$user\"]\r\
    \n}}\r\
    \n" use-encryption=default use-ipv6=defaul


/system scheduler
add comment="\CD\E1 \E3\D4\DF\E1\E5 \C7\E1\E3\E1\CB \C7\E1\C7\D5\DD\D1( \C7\E1\
    \CA\DA\CC\C8) \C7\CD\E3\CF \C7\E1\DA\D1\C8\EC" disabled=yes interval=2m \
    name=schedule1 on-event="/ip dhcp-server lease remove [find dynamic]" \
    policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add comment="\E3\D3\CD \C7\E1\DF\E6\DF\ED\D2 \C7\CD\E3\CF \C7\E1\DA\D1\C8\EC" \
    disabled=yes interval=12h10m6s name="remove - cookies" on-event=\
    "/ ip hotspot cookie remove [find ]" policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive start-time=\
    startup
add interval=10s name="PPP Quota" on-event=":foreach i in=[/ppp secret find prof\
    ile=\"20 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota2" on-event=":foreach i in=[/ppp secret find pro\
    file=\"40 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota3" on-event=":foreach i in=[/ppp secret find pro\
    file=\"60 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota4" on-event=":foreach i in=[/ppp secret find pro\
    file=\"80 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota5" on-event=":foreach i in=[/ppp secret find pro\
    file=\"100 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota6" on-event=":foreach i in=[/ppp secret find pro\
    file=\"120 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota7" on-event=":foreach i in=[/ppp secret find pro\
    file=\"140 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota8" on-event=":foreach i in=[/ppp secret find pro\
    file=\"160 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota9" on-event=":foreach i in=[/ppp secret find pro\
    file=\"180 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup
add interval=10s name="PPP Quota10" on-event=":foreach i in=[/ppp secret find pr\
    ofile=\"200 GB\"] do={\r\
    \n/local n [/ppp secret get value-name=name \$i]\r\
    \n:if ([:len [/ppp active find name=\$n]]!=0) do={\r\
    \n:global pppclient \"\$n\"\r\
    \n/system script run \"PPP Quota\"\r\
    \n}}\r\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
    start-time=startup

/system script
add name="PPP Quota" owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive source="#\$\$\$\$\
    \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$#\r\
    \n#                   BY Sinan AlChalabi                              #\r\
    \n#                          5/Jul/2016                                   #\
    \r\
    \n#                  PPP Quota Measuring                         #\r\
    \n#\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\
    \$\$\$#\r\
    \n{\r\
    \n:global pppclient \r\
    \n:local comm [/ppp secret get value-name=comment [find name=\$pppclient]]\r\
    \n:local total [:pick \$comm ([find \$comm \"Total=\"]+6) ([find \$comm \"MB\
    @t\"]-1)]\r\
    \n:local a [:pick \$comm 0 ([find \$comm \"\\\$@\"]-1) ]\r\
    \n:local txo [:pick \$comm ([find \$comm \"Tx=\"]+3) ([find \$comm \"MB@tx\"\
    ]-1)]\r\
    \n:local rxo [:pick \$comm ([find \$comm \"Rx=\"]+3) ([find \$comm \"MB@rx\"\
    ]-1)]\r\
    \n:local tx (([/interface get value-name=tx-byte [find name=\"
    ient>\"]]/1024)/1024)\r\
    \n:local rx (([/interface get value-name=rx-byte [find name=\"
    ient>\"]]/1024)/1024)\r\
    \n:if ((\$tx<\$txo)||(rx<\$rxo)) do={\r\
    \n:set txo 0; set rxo 0\r\
    \n}\r\
    \n:set total (\$total-\$tx-\$rx+\$txo+\$rxo)\r\
    \n/ppp secret set comment=\"\$a \\\$@Total=\$total MB@t Tx=\$tx MB@tx Rx=\$r\
    x MB@rx\" [find name=\"\$pppclient\"]\r\
    \n/ppp secret set limit-bytes-out=(\$total*1024*1024) limit-bytes-in=(\$tota\
    l*1024*1024) [find name=\"\$pppclient\"]\r\
    \n:if (\$total<=0) do={\r\
    \n/ppp secret disable [find name=\"\$pppclient\"]\r\
    \n/ppp active remove [find name=\"\$pppclient\"]\r\
    \n/ppp secret set comment=\"\$a \\\$@ Finished\" [find name=\"\$pppclient\"]\
    \r\
    \n}\r\
    \n}\r\
    \n\r\
    \n\r\
    \n"
--------------------------------------------------------------------------------------------
{
#قم بادخال اسم العميل نهاية السطر ادناه
:local user "ahmed"
#قم بادخال كمية الميكات نهاية السطر ادناه
:local MB 40960
:local c [/ppp secret get value-name=comment [find name="$user"]]
:local c2 [:pick $c ([find $c "\$@"]+3) [:len $c]]
:if ($c=""||$c2="Finished") do={
/ppp secret set comment="\$@Total=$MB MB@t Tx=0 MB@tx Rx=0 MB@rx" [find name="$user"]

}}