Installing and Configuring Squid

1.5 hours
  • 5 Learning Objectives

About this Hands-on Lab

In this learning activity, you will need to install and configure squid so that it only permits web access to **.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Install Squid

You will need to install Squid on Server1 (

yum install squid

Enable and Start Squid

You will need to enable Squid:

systemctl enable squid

And start it:

systemctl start squid

Permit Squid Client Access through the Firewall

You will need to permit clients to connect to the Squid service through the firewall:

firewall-cmd --permanent --add-service=squid

And reload the firewall configuration to pick up the change:

firewall-cmd --reload

Configure Squid

You’ll want to create an ACL that only allows clients to access These go in /etc/squid/squid.conf after the line that says # INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS.


acl whitelist dstdomain
http_access allow whitelist

You’ll also need to comment out or remove the line:

#http_access allow localnet

And restart Squid:

systemctl restart squid

Test from a Client

You’ll need to export the http_proxy value to use Server1:

export http_proxy=""

And try curling the header of

curl -I

This should work. Verify this is the only site that works by curling a different address:

curl -I

This should come back as forbidden.

Additional Resources

A business unit needs you to provide a solution to their problem. They want to limit (non-SSL) web access for some client hosts to just You will need to provide a proxy server for them to use.

You'll do this by installing a Squid proxy server, and configuring it so that it only permits traffic to You won't need to restrict SSL traffic.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?