Xin trình bày vài cách block website với thiết bị router Mikrotik (RouterOs) một thiết bị network còn tương đối mới lạ, không được sử dụng rộng rãi như Cisco hay Juniper nhưng đang dần dần thể hiện là một trong những thiết bị network rẻ, hiệu năng cực kì tốt, nhiều tính năng hay, bảo mật.
![](http://unifi.vn/upload/public/648ed3f07b8910dd26dc7cc91e28361a.jpg)
![](http://unifi.vn/upload/public/2dd2b85dd87d97893ae91aff4bedffac.jpg)
![](http://unifi.vn/upload/public/9c216a094cd24ee3a378a9bcf0a716a8.png)
![](http://unifi.vn/upload/public/ab47ead444c82d1e1ce94e07773b7fd8.png)
![](http://unifi.vn/upload/public/082f1e020790bcd86a7e3ebb9da9e982.png)
![](http://unifi.vn/upload/public/d5fb5a007f11ffc385362f8d33a6d347.png)
![](http://unifi.vn/upload/public/3aa1cdac7acaf01eff69e78f81791bde.png)
![](http://unifi.vn/upload/public/8488120e1b8b4bdee5b5f7a3ba96b786.png)
![](http://unifi.vn/upload/public/40e617f1b818c7d942f46c4acf2db329.png)
![](http://unifi.vn/upload/public/acf6a3d7d6f8eec46e4cf35bab1bef11.png)
![](http://unifi.vn/upload/public/6c30d43233ac2e12e43506657b074872.png)
Cấu hình chặn facebook với router Mikrotik
Router Mikrotik là dòng router đa chức năng, trong đó nổi bật nhất hay được sử dụng trong doanh nghiệp đó là
– Cân bằng tải Multi WAN
– Wifi hotspot
– VPN
Tuy nhiên chức năng Firewall của Mikrotik cũng rất mạnh mẽ, đặc biệt là webfilter.
Sau đây VNE demo tính năng block facebook trên Mikrotik CCR1036-12G-4S, OS v6.28
Các cấu hình cơ bản khác: gán IP interface, NAT, defaut route… các bạn có thể xem thêm trên http://wiki.mikrotik.com/wiki/Manual:Initial_Configuration
Phần config block facebook chỉ đơn giản như sau
Và đây là kết quả: Facebook bị chặn còn Google, Youtube vẫn OK
How to Block Websites & Stop Downloading Using Proxy
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 set parent-proxy-port=0 set cache-administrator="webmaster" set max-cache-size=none set cache-on-disk=no set max-client-connections=600 set max-server-connections=600 set max-fresh-time=3d set always-from-cache=no set cache-hit-dscp=4 set serialize-connections=no
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> 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