Squid installation

  • In Debian it is easy…run command

apt-get install squid

Squid configuration

  • open and edit following configuration file /etc/squid/squid.conf

set port on which squid will listen

http_port 3128 transparent

You can choose different port if you wish

define list of hosts allowed to use our proxy

acl lan src 192.168.1.0/24

Set rule to allow our list of hosts to use proxy

http_access allow lan

Sequence order is important!

Firewall configuration

  • Create rules to redirect http traffic to our proxy

iptables -A INPUT -s 192.168.1.0/24 -p tcp –dport 3128 -j ACCEPT

iptables -t nat -A PREROUTING -s 192.168.1.0/24 -p tcp –dport 80 -j DNAT –to 192.168.1.1:3128

Restart firewall and proxy.

 

dzbanek 2011-11-22