Conclusion
We have successfully set up policy based routing of HTTP and HTTPS traffic from our Mikrotik router to a separate proxy box. Both HTTP and HTTPS traffic can now be filtered for adult language and unwanted sites.
References
- Mikrotik Policy Based Routing. Although it is not directly applicable it still gives a good picture of how policy based routing is configured in Mikrotik.
- SquidWiki policy based routing article.
- Explanation how iptables firewall processes packets.
- iptables manual for Ubuntu (partially applicable, especially how to store/load iptables rules).
Danger
If you are using Google chrome, you are advised to block QUIC protocol on your router, otherwise Chrome will be able to bypass the transparently redirected proxy when going to QUIC enabled sites, like google.com, youtube.com, etc. Adding REJECT rules for UDP protocol on outgoing port 80 and port 443 should be enough.