Ubuntu – squid transparent proxy on all ports

iptablessquidUbuntu

I have setup squid as a transparent proxy by redirecting port 80 to the native squid port 3128. I know there are issues with getting secure ports like ssl and imaps to go though the proxy but can I redirect all other ports through the proxy as well. I am trying to get a better idea of bandwidth usage. I have setup iptables to log usage and i am getting most traffic going into the related/established rule. I am trying to determine the origins of this traffic by sending traffic to squid for more detailed logging.

Best Answer

Redirecting traffic of all protocols to proxy server will not work especially for udp-based protocols.

If you want to implement traffic shapping to control bandwidth, you use 'tc'.

For logging, you can use iptables logging for simple things like initiating and terminating connection (matching specific rules). For more detailed logging, this requires speciallized software for packet inspection.