How to Block Websites & Stop Downloading Using Proxy

From MikroTik Wiki
Revision as of 15:48, 7 January 2010 by Kirshteins (talk | contribs)
Jump to: navigation, search

This example will explain you “How to Block Web Sites” & “How to Stop Downloading”.

First, Configure Proxy.

/ip proxy
set enabled: yes
set src-address: 0.0.0.0
set port: 8080
set parent-proxy: 0.0.0.0:0
set cache-drive: system
set cache-administrator: "webmaster"
set max-disk-cache-size: none
set max-ram-cache-size: none
set cache-only-on-disk: no
set maximal-client-connections: 1000
set maximal-server-connections: 1000
set max-object-size: 512KiB
set max-fresh-time: 3d

Now, Make it Transparent

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

Make sure that your proxy is NOT a Open Proxy

/ip firewall filter
add chain=input in-interface=<Your WAN Port> src-address=0.0.0.0/0 protocol=tcp dst-port=8080 action=drop

Now for Blocking Websites

/ip proxy access
add dst-host=www.vansol27.com action=deny 

It will block website http://www.vansol27.com, We can always block the same for different networks by giving src-address. It will block for particular source address.

We can also stop downloading files like.mp3, .exe, .dat, .avi,…etc.

/ip proxy access
add path=*.exe action=deny 
add path=*.mp3 action=deny 
add path=*.zip action=deny 
add path=*.rar action=deny.

Try with this also

/ip proxy access
add dst-host=:mail action=deny

This will block all the websites contain word “mail” in url.

Example: It will block www.hotmail.com, mail.yahoo.com, www.rediffmail.com

ENJOY BLOCKING…….