Mikrotik Router redirect to transparent proxy
A customer with a new Mikrotik router needed to redirect all port 80 and 8080 web traffic to their existing DansGuardian/Squid proxy server. Here are the additional settings required on the Mikrotik router:
1 2 |
/ip firewall address-list add address=192.168.0.100-192.168.0.173 list=proxy_clients |
defines a list of IP addresses whose web requests should be proxied
1 2 3 |
/ip firewall mangle add action=mark-routing chain=prerouting dst-port=80,8080 new-routing-mark=\ to_proxy protocol=tcp src-address-list=proxy_clients |
tags web requests from the workstations for routing
1 |
/ip route add distance=1 gateway=192.168.0.8 routing-mark=to_proxy |
routes tagged traffic to the proxy server
I found the basis for this at: http://forum.mikrotik.com/viewtopic.php?t=77635#p402879