Rabu, 02 Februari 2011

blok FB lewat WebProxy

Dalam kasus ini yaitu melakukan block facebook atau sejenisnya dengan menggunakan Shell Script (versi mikrotik) yang dijalankan secara otomatis dengan menggunakan scheduler mikrotik v 2.9.27

firewall-nat rule webproxy
/ip firewall nat add chain=dstnat protocol=tcp dst-port=80 action=redirect to-ports=8080

enable webproxy
ip web-proxy set enabled=yes

block content

/ip web-proxy access add src-address=0.0.0.0/0 dst-address=0.0.0.0/0 url=facebook action=deny comment=blockfb
/ip web-proxy access add src-address=0.0.0.0/0 dst-address=0.0.0.0/0 url=twitter action=deny comment=blocktwi

/ip web-proxy access add src-address=0.0.0.0/0 dst-address=0.0.0.0/0 url=orkut action=deny comment=blockorkut
/ip web-proxy access add src-address=0.0.0.0/0 dst-address=0.0.0.0/0 url=friendster action=deny comment=blockfs

script for schedule
/ip web-proxy access enable [/ip web-proxy access find comment=blockfb]
/ip web-proxy access disable [/ip web-proxy access find comment=blockfb]
/ip web-proxy access enable [/ip web-proxy access find comment=blocktwi]

/ip web-proxy access disable [/ip web-proxy access find comment=blocktwi]
/ip web-proxy access enable [/ip web-proxy access find comment=blockorkut]
/ip web-proxy access disable [/ip web-proxy access find comment=blockorkut]

/ip web-proxy access enable [/ip web-proxy access find comment=blockfs]
/ip web-proxy access disable [/ip web-proxy access find comment=blockfs]

scheduler
/system scheduler add name=fb-08:00 start-date=Nov/25/2009 start-time=08:00:00 interval=1d on-event=fb-deny

/system scheduler add name=fb-11:00 start-date=Nov/25/2009 start-time=11:00:00 interval=1d on-event=fb-allow
/system scheduler add name=fb-13:00 start-date=Nov/25/2009 start-time=13:00:00 interval=1d on-event=fb-deny

/system scheduler add name=fb-16:00 start-date=Nov/25/2009 start-time=16:00:00 interval=1d on-event=fb-allow

Tidak ada komentar:

Posting Komentar