How to install and configure squid proxy in Redhat 7 / Centos 7

SQUID is the most popular Proxy server for Linux systems. It also used for the web filtering. Its widely used for increasing web server speed by caching repeated data.

This article will help you to Install and Configure SQUID Proxy Server on CentOS, Redhat and Fedora Linux systems.

Squid Installation and Configuration

 yum install squid -y

Edit squid configuration file

Before you edit default configuration file it is highly recommended to keep backup.

 cp /etc/squid/squid.conf /etc/squid/squid.conf.backup

Open configuration file and add below mentioned parameters

Add transparent proxy setting and add and allow our network

 vim /etc/squid/squid.conf

 Allow LAN Network
acl our_network src 192.168.2.0/24
# Allow Network ACL Allow/Deny Section#
http_access allow our_network
# Transparent Proxy Parameters 
http_port 3128 intercept
visible_hostname pxy.broexperts.com

Save & Exit from vim editor

Now start squid service and make sure it is added on startup.

 systemctl start squid
 systemctl enable squid

Add port redirection and masquerading rules in RHEL7/CentOS7 firewall using firewall-cmd tool.

firewall-cmd –permanent –zone=public –add-forward-port=port=80:proto=tcp:toport=3128:toaddr=192.168.2.100
firewall-cmd –permanent –zone=public –add-port=3128/tcp
firewall-cmd –permanent –add-masquerade
firewall-cmd –reload

How to install and configure squid proxy in Redhat 7 / Centos 7

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top