By default, the web-proxy is listening on port 8082.
Therefore we first need to
redirect all traffic on
port 80 to port 8082 with a DST-NAT firewall rule and ensure that the
web-proxy service is enabled and listening to port 8082.
To enable a transparent web proxy on Mikrotik, perform the following:
ip firewall nat add in-interface=ether1 ISP dst-port=80 protocol=tcp
action=redirect to-ports=8082 chain=dstnat
ip proxy set enabled=yes port=8082
Pay particular attention to locking down the security of the web-proxy. Read about
the /ip proxy access command!
It is also important to consider the size of the cache and all the various other
parameters you can change
on the web-proxy, however this is outside the scope of this article.
Customizing error pages
To customize the page web proxy shows on error:
[admin@MikroTik] > /ip proxy reset-html
Current html pages will be lost! Reset anyway? [y/N]
Answer 'y'. Now HTML files are accessible for editing. (Currently there is only one
file: [Link],
that contains the error message.)
[admin@MikroTik] > /file print
# NAME TYPE SIZE CREATION-TIME
0 webproxy directory jul/28/2009
12:07:51
1 webproxy/[Link] .html file 529 jan/02/1970
00:03:4
[admin@MikroTik] > /file edit webproxy/[Link] contents
...
You can also simply replace the file with your own. The syntax used in the file is
similar to to that used
in hotspot HTML files. Predefined variables (such as $error, $url, $admin), as
well as $(if ...) statements
can be used.