How to configure ACL rule for Browser by Squid proxy server in Ubuntu 16.04

To configure ACL rule for Browser by Squid proxy server in Ubuntu 16.04   

A proxy server is acts as an intermediary between a end user and the internet and allows a end user to make an indirect connection to network servers and services. A proxy server can help you take control of how users reach the internet.  Squid Proxy is mainly used for caching frequently requested web content in order to speed up response time and also save network bandwidth. It supports many different protocols such as HTTP, FTP, TLS, SSL, Internet Gopher and HTTPS. This tutorial covers the configuration procedure of ACL rule for Browser by Squid proxy server in Ubuntu 16.04. 

 

Configuration procedure

To proceed with the installation procedure, install the squid application by running the following command and press y to continue with the installation procedure. 

root@linuxhelp11:~# apt-get install squid -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gnome-software-common libgtkspell3-3-0
Use 'sudo apt autoremove' to remove them.
Suggested packages:
  squidclient squid-cgi squid-purge smbclient winbind
.
.
Processing triggers for man-db (2.7.5-1) ...
Setting up squid (3.5.12-1ubuntu7.4) ...
Skipping profile in /etc/apparmor.d/disable: usr.sbin.squid

The Squid application has been installed successfully. Next update the target machine by running the apt-get update command

root@linuxhelp11:~# apt-get update
Hit:1 http://in.archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:4 http://in.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Get:5 http://security.ubuntu.com/ubuntu xenial-security/main amd64 DEP-11 Metadata [60.4 kB]
.
.
Get:19 http://in.archive.ubuntu.com/ubuntu xenial-backports/universe amd64 DEP-11 Metadata [4,584 B]
Fetched 3,778 kB in 14s (258 kB/s)                                                     
Reading package lists... Done

Start the squid service by executing the following command. 

root@linuxhelp11:~# systemctl start squid

Next open the squid.conf configuration file and edit the squid configuration file using vim editor and enter the following changes in the file. Save and exit the file. 

root@linuxhelp11:~# vim /etc/squid/squid.conf
acl test src 192.168.7.104
acl browser_block browser Firefox
http_access deny test browser_block
http_access allow test

Restart the squid proxy server by running the following command. 

root@linuxhelp11:~# systemctl restart squid

The configuration process in terminal has been completed. Next open a client machine and set proxy for the machine by opening the internet properties window and select the connection tab menu. 
internet properties

Click the LAN settings on the connections menu. 
LAN settings

Set the proxy address and port details and click ok. 
LAN settings

To check the internet connections, select the Chrome browser and search for any website. The connections will work properly. 
chrome browser

Now check for the same in Firefox browser and the site cannot be accessed in the Firefox due to the proxy connections set by the user. 
not accessed


proxy server refused

The configuration procedure of setting ACL rule for browser using Squid Proxy on Ubuntu 16.04 is done successfully. 


Thank you! for using Linux Help.

You find this tutorial helpful? Share with your friends to keep it alive.
For more help topics browse our website www.linuxhelp.com
Be the first to comment, we value your suggestions. For further queries please comment below.

Tags: Squid ACL Proxy server Browser Ubuntu
user image Author :  Gabriel