Community discussions

MikroTik App
 
mohamed
newbie
Topic Author
Posts: 33
Joined: Sat Apr 25, 2009 11:52 am

small question ؟؟؟

Sun Jun 07, 2009 11:41 pm

I found the Following script to disable downloading when the number of users in reg -table are 20 and above and enable it at less than.




/ip proxy access
add action=deny comment=1 disabled=no path=*.exe
add action=deny comment=1 disabled=no path=*.rar
add action=deny comment=1 disabled=no path=*.zip
add action=deny comment=1 disabled=no path=*.mp3
add action=deny comment="" disabled=no path=*.wav
/system scheduler
add comment="" disabled=no interval=5m name="disable download" on-event=":if ([\
:len [/interface wireless reg find]] >=20) do={/ip proxy access enable [/ip\
proxy access find comment=1]\r\
\n}" start-time=startup
add comment="" disabled=no interval=5m2s name="enable download" on-event=":if (\
[:len [/interface wireless reg find]]<=19) do={/ip proxy access disable [/i\
p proxy access find comment=1]\r\
\n}" start-time=startup




But I want to use it in Lan network
can any body edit this script to used in lan network
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: small question ؟؟؟

Mon Jun 08, 2009 12:11 am

this script is for web proxy - it can block http only
 
mohamed
newbie
Topic Author
Posts: 33
Joined: Sat Apr 25, 2009 11:52 am

Re: small question ؟؟؟

Mon Jun 08, 2009 12:47 pm

this script is for web proxy - it can block http only
i tray to add this script

/ip proxy access
add action=deny comment=1 disabled=no path=*.exe
add action=deny comment=1 disabled=no path=*.rar
add action=deny comment=1 disabled=no path=*.zip
add action=deny comment=1 disabled=no path=*.mp3
add action=deny comment="" disabled=no path=*.wav

its deny to download any file Consists of (.exe .rar .zip .wave .mp3)
but the http working normaly
but this script


/ip proxy access
add action=deny comment=1 disabled=no path=*.exe
add action=deny comment=1 disabled=no path=*.rar
add action=deny comment=1 disabled=no path=*.zip
add action=deny comment=1 disabled=no path=*.mp3
add action=deny comment="" disabled=no path=*.wav
/system scheduler
add comment="" disabled=no interval=5m name="disable download" on-event=":if ([\
:len [/interface wireless reg find]] >=20) do={/ip proxy access enable [/ip\
proxy access find comment=1]\r\
\n}" start-time=startup
add comment="" disabled=no interval=5m2s name="enable download" on-event=":if (\
[:len [/interface wireless reg find]]<=19) do={/ip proxy access disable [/i\
p proxy access find comment=1]\r\
\n}" start-time=startup


is valid only with wirless network
plz can any body make this script work with lan network


iwant to use it plz help me ?????
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: small question ؟؟؟

Mon Jun 08, 2009 7:25 pm

what do you mean 'only in wireless'? O_o there's no difference between wireless and wired concerning the Internet. didn't you forgot to add redirect rule for transparent proxy? http://www.mikrotik.com/testdocs/ros/3. ... nt.php#.12
 
mohamed
newbie
Topic Author
Posts: 33
Joined: Sat Apr 25, 2009 11:52 am

Re: small question ؟؟؟

Mon Jun 08, 2009 11:17 pm

what do you mean 'only in wireless'? O_o there's no difference between wireless and wired concerning the Internet. didn't you forgot to add redirect rule for transparent proxy? http://www.mikrotik.com/testdocs/ros/3. ... nt.php#.12

i mean look at the red word


/ip proxy access
add action=deny comment=1 disabled=no path=*.exe
add action=deny comment=1 disabled=no path=*.rar
add action=deny comment=1 disabled=no path=*.zip
add action=deny comment=1 disabled=no path=*.mp3
add action=deny comment="" disabled=no path=*.wav
/system scheduler
add comment="" disabled=no interval=5m name="disable download" on-event=":if ([\
:len [/interface wireless reg find]] >=20) do={/ip proxy access enable [/ip\
proxy access find comment=1]\r\
\n}" start-time=startup
add comment="" disabled=no interval=5m2s name="enable download" on-event=":if (\
[:len [/interface wireless reg find]]<=19) do={/ip proxy access disable [/i\
p proxy access find comment=1]\r\
\n}" start-time=startup


this script mean if the router find the client >=20 online client enable the rule.
deny any request to download any file Consists of (.exe .rar .zip .wave .mp3)
from the internet
but the http is working normal

Image


and if the client <=19 disable the rule

Image



the rule is

/ip proxy access
add action=deny comment=1 disabled=no path=*.exe
add action=deny comment=1 disabled=no path=*.rar
add action=deny comment=1 disabled=no path=*.zip
add action=deny comment=1 disabled=no path=*.mp3
add action=deny comment="" disabled=no path=*.wav



if you dont understand me

i need script if the router find the client over 20 client enable the rule
its make deny to path exe rar zip mp3 wav

Image

/ip proxy access
add action=deny comment=1 disabled=no path=*.exe
add action=deny comment=1 disabled=no path=*.rar
add action=deny comment=1 disabled=no path=*.zip
add action=deny comment=1 disabled=no path=*.mp3
add action=deny comment="" disabled=no path=*.wav


and if the client lees than 19 online client disable the proxy rule

Image


i work at 3.13 and i have Lan network
2 interface

number 1 the name of it Lan its for switch
number 2 the name of it Wan its for internet

in the end i hope you can help me !!!

and very very very very thanks! mr Chupaka
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: small question ؟؟؟

Mon Jun 08, 2009 11:26 pm

oh, I see. do you have some authorization to count clients? like PPPoE, PPTP, Hotspot... then just replace
:len [/interface wireless reg find]
with
:len [/ppp active find]
or
[/ppp active print count-only]
 
mohamed
newbie
Topic Author
Posts: 33
Joined: Sat Apr 25, 2009 11:52 am

Re: small question ؟؟؟

Tue Jun 09, 2009 12:42 am

oh, I see. do you have some authorization to count clients? like PPPoE, PPTP, Hotspot... then just replace
:len [/interface wireless reg find]
with
:len [/ppp active find]
or
[/ppp active print count-only]
im sory

its still not working

i have hotspot on pc i install mikrotik v 3.13

i add thes script after you edit it to my

/ip proxy access
add action=deny comment=1 disabled=no path=*.exe
add action=deny comment=1 disabled=no path=*.rar
add action=deny comment=1 disabled=no path=*.zip
add action=deny comment=1 disabled=no path=*.mp3
add action=deny comment="" disabled=no path=*.wav

/system scheduler
add comment="" disabled=no interval=5m name="disable download" on-event=":if ([len [/ppp active find]] >=20) do={/ip proxy access enable [/ipproxy access find comment=1]
\n}" start-time=startup
add comment="" disabled=no interval=5m2s name="enable download" on-event=":if ([:len [/ppp active find]]<=19) do={/ip proxy access disable [/ip proxy access find comment=1]
\n}" start-time=startup

but its still not working

and i change it to
/system scheduler
add comment="" disabled=no interval=5m name="disable download" on-event=":if ([len ppp active print count-only]] >=20) do={/ip proxy access enable [/ipproxy access find comment=1]
\n}" start-time=startup
add comment="" disabled=no interval=5m2s name="enable download" on-event=":if ([:len [/ppp active print count-only]]<=19) do={/ip proxy access disable [/ip proxy access find comment=1]
\n}" start-time=startup



and very very very very thanks! mr Chupaka :( :( :( :( :( :( :( :( :( :(
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: small question ؟؟؟

Tue Jun 09, 2009 12:54 am

omg... /ppp is for PPP =) if you use Hotspot, then write something like "/ip hotspot active" instead of "/ppp active"
 
mohamed
newbie
Topic Author
Posts: 33
Joined: Sat Apr 25, 2009 11:52 am

Re: small question ؟؟؟

Tue Jun 09, 2009 7:34 pm

omg... /ppp is for PPP =) if you use Hotspot, then write something like "/ip hotspot active" instead of "/ppp active"
:shock:

i tray

:if [/ip hotspot active find ]] >=10)
do ip proxy access enable [/ip proxy access find comment=1]

and

:if [/ip hotspot active user ]] >=10)
do ip proxy access enable [/ip proxy access find comment=1]

the answer is

conditional is not boolean


Image

:( :( :(
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: small question ؟؟؟

Tue Jun 09, 2009 11:02 pm

well, let's see you first message...
/system scheduler
add comment="" disabled=no interval=5m name="disable download" on-event=":if ([\
:len [/interface wireless reg find]] >=20) do={/ip proxy access enable [/ip\
proxy access find comment=1]\r\
\n}" start-time=startup
add comment="" disabled=no interval=5m2s name="enable download" on-event=":if (\
[:len [/interface wireless reg find]]<=19) do={/ip proxy access disable [/i\
p proxy access find comment=1]\r\
\n}" start-time=startup
and now let's replace "/interface wireless reg" with "/ip hotspot active":
/system scheduler
add comment="" disabled=no interval=5m name="disable download" on-event=":if ([\
:len [/ip hotspot active find]] >=20) do={/ip proxy access enable [/ip\
proxy access find comment=1]\r\
\n}" start-time=startup
add comment="" disabled=no interval=5m2s name="enable download" on-event=":if (\
[:len [/ip hotspot active find]]<=19) do={/ip proxy access disable [/i\
p proxy access find comment=1]\r\
\n}" start-time=startup
should work =-)

Who is online

Users browsing this forum: KarolSz and 7 guests