Tags

, ,

Squid serves as a proxy in the network.

To install Squid on the Debian machine.

apt-get install squid

 

After installing the package, open up the config file with a text editor.

nano /etc/squid/squid.conf

 

Use ctrl+w and search for the keyword “TAG: http_port = 3182”.

Edit that line to a port that you’re going to have the squid server listen to. For this case, 8080.

http_port = 8080

 

After that, add the following acl rule under the acl section.

acl localnet src = 10.10.0.0/16

 

Scroll down and uncomment the the following line.

http_access allow localnet

 

Exit the localRestart the Squid service and the http proxy should now be working.

service squid restart

 

If your environment is under another proxy server, we will have to configure the Squid server to direct the traffic to the parent proxy server or else the client will still not be able to access the internet.

To do so, open up /etc/squid/squid.conf with a text editor.

nano /etc/squid/squid.conf

 

Next, we’ll need to browse to “TAG: cache_peer” and add the following line below the section. This connects to proxy server proxy.tp.edu.sg:80/.

cache_peer proxy.tp.edu.sg parent 80 80 proxy-only default

 

We’ll also need to add the following line under the “TAG:never_direct:” section. This will configure all the traffic from the acl localnet to be redirected to the parent proxy server.

never_direct allow localnet

 

If we’re configuring this behind a router, we have to set the router to only allow the parent proxy server by applying the appropriate acl rules.

Advertisements