Next Previous Contents

2. Overview of Transparent Proxying

2.1 Motivation

In ``ordinary'' proxying, the client specifies the hostname and port number of a proxy in his web browsing software. The browser then makes requests to the proxy, and the proxy forwards them to the origin servers. This is all fine and good, but sometimes one of several situations arise. Either

This is where transparent proxying comes in. A web request can be intercepted by the proxy, transparently. That is, as far as the client software knows, it is talking to the origin server itself, when it is really talking to the proxy server.

Cisco routers support transparent proxying. So do many switches. But, (surprisingly enough) Linux can act as a router, and can perform transparent proxying by redirecting TCP connections to local ports. However, we also need to make our web proxy aware of the affect of the redirection, so that it can make connections to the proper origin servers. There are two general ways this works:

The first is when your web proxy is not transparent proxy aware. You can use a nifty little daemon called transproxy that sits in front of your web proxy and takes care of all the messy details for you. transproxy was written by John Saunders, and is available from

ftp://ftp.nlc.net.au/pub/linux/www/ or your local metalab mirror. transproxy will not be discussed further in this document.

A cleaner solution is to get a web proxy that is aware of transparent proxying itself. The one we are going to focus on here is squid. Squid is an Open Source caching proxy server for Unix systems. It is available from www.squid-cache.org

2.2 Scope of this document

This document will focus on squid version 2.3 and linux kernel version 2.4, the most current stable releases as of this writing (Jan 2001). It should also work with squids as early as 2.0, and most of the later 2.3 kernels. If you need information about earlier releases, you may find some earlier documents at www.unxsoft.com.

If you are using a development kernel or a development version of squid, you are on your own. This document may help you, but YMMV.

Note that this document focuses only on HTTP proxing. I get many emails asking about transparent FTP proxying. While it may not be theoretically impossible to proxy FTP transparently, it is MUCH harder than HTTP, and I do not know of any currently available tools that can do it. If you can figure it out, I suggest you write your own HOWTO...


Next Previous Contents