Set up transparent proxy with Squid
Mar 22, 2009 by mohamed hanoosh
Proxy server is as an intermediate for a machine(client) to connect to another machine or network. All outside connections of the client can be done by the proxy server. Proxy server can be used for setting firewall in a network.
Other than just forwarding requests from client, proxy servers can cache some data(web pages,DNS,network lookups) it has already retrieved. Such proxies are called caching proxy. The proxies which does not change the packets other than just forwarding it is called transparent proxy.
Squid is a free and open source web proxy server. Quick steps for setting up a transparent proxy server is given below.
Other than just forwarding requests from client, proxy servers can cache some data(web pages,DNS,network lookups) it has already retrieved. Such proxies are called caching proxy. The proxies which does not change the packets other than just forwarding it is called transparent proxy.
Squid is a free and open source web proxy server. Quick steps for setting up a transparent proxy server is given below.
- Install squid
- Configure /etc/squid/squid.conf Squid configurations uses acl. To allow local machines to connect to it you have to add access right to localnet The file contain an acl called localnet representing the local network..
- Restart squid
hash@ssl50:~$ sudo apt-get install squid squid-common
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
# http_access allow localnet
Note down the http_port given in config file. Usually it is set to 3128. You may change it. This is the port number to which clients has to connect to for using the proxy server.
hash@ssl50:~$ /etc/init.d/squid restart