Squid Proxy Basic Setup
Starting from a new Ubuntu VM:
sudo apt-get update
sudo apt install squid
Edit the Squid config file:
sudo nano /etc/squid/squid.conf
Look for the section with ACLs. Mine looks like this after allowing my local subnet, 10.10.4.0/24.
I also had to uncomment this line to allow localnet to communicate to any website. We will modify this later.
I left the default port Squid listens on as 3128, but this can be changed.
Save changes, restart squid, and then check the running status of Squid.
Configure the proxy settings on a device that will use Squid. I used a Windows VM.
Attempt to connect to the Internet. Once successful, the log located at /var/log/squid/access.log will look like this.
Useful commands:
1. Enable Squid to start automatically on boot
Get Jeff’s stories in your inbox
Join Medium for free to get updates from this writer.
sudo systemctl enable squid
2. Restart Squid
sudo systemctl restart squid
3. Stop Squid
sudo systemctl stop squid
4. Start Squid
sudo systemctl start squid
Whitelisting websites:
- Create a text file for the whitelisted websites. Adding “.” to the beginning of the is like a wildcard, (i.e. *.microsoft.com) so subdomains are included.
2. Edit /etc/squid/squid.conf
I added this line to the acl to define the whitelisted sites.
Then I commented the line that allows localnet to reach any website, and added a new line to allow localnet only to the sites in the allowed_list.
Testing confirmed I could reach https://microsoft.com, but I could not reach https://msn.com, so the whitlisting is working.









