How to Make Web Proxy in MikroTik



What is Web Proxy?
Web Proxy is an application that mediates between the client and the server, so the client will not deal directly with the servers that exist on the Internet. Mikrotik have a web proxy features that can be
used as a proxy server which will become an intermediary between a user's browser to the web server on the Internet.


How Web Proxy Works?
When a user opens a website, the browser will send an HTTP request to the server, but since the computer users using a web proxy then the proxy will receive an HTTP request from the browser and then create a new HTTP request on its behalf. The new HTTP request will be received by server then replied it with an HTTP Server Response and received by the proxy. Then it forwarded to the user's browser.

Web Proxy Requires Large Amount of CPU Resource
If you enable the Mikrotik web proxy feature you have to pay attention at it's memory capacity and CPU usage. Because Mikrotik will create a new HTTP Request on behalf of itself, thus requiring the use of memory and CPU Resource which bigger than just using NAT.

The advantages of using Web Proxy
The following are the Advantages / Benefits of Web Proxy Mikrotik :

Caching
Mikrotik Web Proxy can perform content caching which is storing some web content to the memory. The content will be reused if there is a request on the same content. For example when you open Facebook.com then the files on the web such as images, scripts, etc. will be stored by web proxy. So the next time you open Facebook, the router will retrieve files from the proxy cache instead of connecting to the Internet. This can save bandwidth and speed up Internet connection.

Filtering
By using the Web Proxy you can restrict access to certain content which is requested by the client. You can restrict access to certain sites, specific file extensions, redirect to other sites, as well as restrictions on HTTP access method.

Connection Sharing
Web Proxy enhance the security level of your network, because computer users are not interacting directly with the web server on the Internet .



How to Make a Transparent Proxy Mikrotik - Transparent proxy is a proxy configuration which intercepts normal communication at the network layer without requiring any special client configuration. It means that clients need not be aware of the existence of the proxy. Transparent proxy is located between the client and the Internet, with the proxy performing some of the functions of a gateway or router.

If we use Transparent proxy, we don't have to set up proxy configuration on clients browser. It's more simple and won't waste your time :). Ok, let's do it.

Please open the Winbox and follow these steps :
1 . Go to the menu IP - > Web Proxy

2 . To enable Web Proxy check " Enabled "

3 . Fill in the port to be used by the proxy. In this case we use port 8080

4 . You can replace Cache Administrator with your own email

5 . Max  Cache Size determines how large the allocation of memory to store its cache proxy. Please fill in as needed or you may choose unlimited.

6 . Check the "Cache On Disk" option to store the web proxy cache on Mikrotik's hard disk not on it's RAM.

7 . Click Apply - > OK

Now, your Mikrotik Web proxy is activated. But it's not configured as transparent proxy yet.
Transparent Proxy works with redirecting HTTP traffic data (destination port 80) to proxy's port 8080. This can be done with configuring the NAT Firewall on Mikrotik. You can use this command line on terminal.

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

Or you can do it manually using Winbox, go to menu IP --> Firewall --> NAT

In the General tab
Chain : dstnat
Protocol : tcp
Dst. Port : 80

In the Action Tab
Action : redirect
To Ports : 8080
Done! Your Mikrotik Web Proxy is now become transparent. You can test it on your web browser, try to open an address which doesn't exist. So, you'll get the error page generated by web proxy, just like the picture below :
 

No comments:

Post a Comment