Configure Squid 3.x as Transparent Proxy on CentOS 7 / RHEL 7
There are several benefits of using a transparent proxy. First of all, for end users, a transparent proxy can enhance their web browsing performance by caching frequently accessed web content, while introducing minimal configuration overhead for them. For administrators, it can be used to enforce various administrative policies such as content/URL/IP filtering, rate limiting, etc.
A proxy server acts as an intermediary between a client and a destination server. The client sends requests to the proxy server which then evaluates the requests and takes necessary actions. In this tutorial, we will be setting up a web proxy server using Squid, which is a robust, customizable and stable proxy server. Personally, I had administered a Squid server with 400+ client workstations for about a year. Although I had to restart the service about once a month in average, CPU and storage utilization, throughput and client response time were all great.
Squid Installation and Configuration
Edit squid configuration file
Before you edit default configuration file it is highly recommended to keep backup.
Open configuration file and add below mentioned parameters
Add transparent proxy setting and add and allow our network
Save & Exit
Now start squid service and make sure it is added on startup.
Add necessary iptables rules to setup squid as transparent proxy.
Now you can save your iptable rules by following command:
That’s It, Now squid should work smoothly in transparent proxy mode.