Diverting HTTP traffic to Squid
We learned in previous sections that we need to divert all HTTP traffic from our clients to our proxy server. Later, we'll have a look at the ways in which we can divert HTTP traffic to our Squid proxy server.
Using a router's policy routing to divert requests
If we have an arrangement where all our client requests are passing through a router, we can utilize the router's ability to divert the packets, to redirect them to our Squid proxy server. Therefore if we set our router's policy to redirect all the packets with port 80 to the Squid server and all other traffic is sent to the internet directly, it will look like the following diagram:
In the previous diagram, we can see that the router is passing all the HTTP requests to the Squid proxy server and all the non-HTTP traffic is going to the internet directly. A router can only modify the IP address of a packet. So, we must configure an IP packet filtering tool (iptables
, ipfw
) to redirect traffic on port 80...