Community discussions

MikroTik App
 
Myron
Member Candidate
Member Candidate
Topic Author
Posts: 253
Joined: Sat Sep 05, 2009 3:17 am
Location: Boracay, Philippines

proxying specific time

Mon Oct 11, 2010 4:54 am

Hello people

I have my web-proxy and it works fine, it posible set a specific time? example 8AM to 5PM proxy is close.

thanks
 
dssmiktik
Forum Veteran
Forum Veteran
Posts: 732
Joined: Fri Aug 17, 2007 8:42 am

Re: proxying specific time

Mon Oct 11, 2010 5:44 am

You could use a NAT rule to redirect to proxy at specific times.

In your case, you could try something like this:
/ip firewall nat add chain=dstnat protocol=tcp dst-port=80 time=08:00:00-17:00:00,fri,mon,sat,sun,thu,tue,wed action=accept
/ip firewall nat add chain=dstnat protocol=tcp dst-port=80 action=redirect to-ports=8080
This does not redirect traffic between 5am - 8pm, but redirects everything else all other times.

If you're looking to just enable/disable the web-proxy at specific times, you could schedule a script to run that enables and another to disable the web proxy via system scheduler.

Hope this helps. If you need more assistance, feel free to ask.
 
Myron
Member Candidate
Member Candidate
Topic Author
Posts: 253
Joined: Sat Sep 05, 2009 3:17 am
Location: Boracay, Philippines

Re: proxying specific time

Mon Oct 11, 2010 6:12 am

You could use a NAT rule to redirect to proxy at specific times.

In your case, you could try something like this:
/ip firewall nat add chain=dstnat protocol=tcp dst-port=80 time=08:00:00-17:00:00,fri,mon,sat,sun,thu,tue,wed action=accept
/ip firewall nat add chain=dstnat protocol=tcp dst-port=80 action=redirect to-ports=8080
This does not redirect traffic between 5am - 8pm, but redirects everything else all other times.

If you're looking to just enable/disable the web-proxy at specific times, you could schedule a script to run that enables and another to disable the web proxy via system scheduler.

Hope this helps. If you need more assistance, feel free to ask.
Wow ok thats was im thinking lately but im want to be sure, ahhhh if you mind you can you share a sample script, thanks a lot dssmitik
 
dssmiktik
Forum Veteran
Forum Veteran
Posts: 732
Joined: Fri Aug 17, 2007 8:42 am

Re: proxying specific time

Mon Oct 11, 2010 9:10 am

You could create two scripts, one to disable, and one to enable.
/system script add name="EnableWebProxy" source="/ip proxy set enabled=yes"
/system script add name="DisableWebProxy" source="/ip proxy set enabled=no"
Then you could schedule these scripts to run at specific times:
This will disable the web-proxy every day at 8am, then enable it at 5pm
/system scheduler add name=DisableWebProxy start-time=08:00:00 interval=1d on-event="DisableWebProxy" policy=write,read
/system scheduler add name=EnableWebProxy start-time=17:00:00 interval=1d on-event="EnableWebProxy" policy=write,read
 
Myron
Member Candidate
Member Candidate
Topic Author
Posts: 253
Joined: Sat Sep 05, 2009 3:17 am
Location: Boracay, Philippines

Re: proxying specific time

Mon Oct 11, 2010 5:42 pm

You could create two scripts, one to disable, and one to enable.
/system script add name="EnableWebProxy" source="/ip proxy set enabled=yes"
/system script add name="DisableWebProxy" source="/ip proxy set enabled=no"
Then you could schedule these scripts to run at specific times:
This will disable the web-proxy every day at 8am, then enable it at 5pm
/system scheduler add name=DisableWebProxy start-time=08:00:00 interval=1d on-event="DisableWebProxy" policy=write,read
/system scheduler add name=EnableWebProxy start-time=17:00:00 interval=1d on-event="EnableWebProxy" policy=write,read
Hello miktik thank you very much for your assitance im glad it works wehehe

Regards
Myron

Who is online

Users browsing this forum: No registered users and 69 guests