How to Allow Specific IP in Squid Proxy

Some time we require to allow specific ip address to be exempted from all the restriction, such as boss and system administrators. So this guide will show you step by step instruction to Allow Specific IP in Squid Proxy Server.


In your squid configuration file, located at /etc/squid/squid.conf you would write something like this to Allow Specific IP in Squid Proxy:

Example- 1: Allow Single IP:

acl Boss_IP src
http_access allow Boss_IP

After adding those lines save and exit squid configuration file and restart squid proxy server service using following command:

systemctl restart squid.service

Squid implement ACL’s line by line if first ACL’s will match so it will apply and ignore rest all, so make sure you add this allowed ip ACL’s above to restricted ACL’s.

Example-2: Allow list of IP’s

For instance, you need to allow more than one ip address, in this case you will create list of ip address in a file then point this file in squid configuration file acl section by giving path.

Create IP Address List:

# vi /etc/squid/Allowed_IPs.txt

Paste below ip list ( you can modify ip list as per your network requirements)

Now Add ACL to Block This IPs List

acl Allowed_IPs  src "/etc/squid/Allowed_IPs.txt"
http_access allow Allowed_IPs

Note:- Make sure to add this ACL above to any restricted Access List.

Restart Squid Service

systemctl restart squid.service

If you like this Post, please give us your valuable feedback by pressing Vote Up / Vote Down Button. Thanks.


Similar Posts