{"id":10786,"date":"2021-10-20T12:09:23","date_gmt":"2021-10-20T09:09:23","guid":{"rendered":"https:\/\/kifarunix.com\/?p=10786"},"modified":"2024-03-18T13:29:01","modified_gmt":"2024-03-18T10:29:01","slug":"install-and-configure-squid-proxy-on-rocky-linux-8","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-and-configure-squid-proxy-on-rocky-linux-8\/","title":{"rendered":"Install and Configure Squid Proxy on Rocky Linux 8"},"content":{"rendered":"\n<p>In this guide, we are going to learn how to install and configure Squid proxy on Rocky Linux 8.<\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"http:\/\/www.squid-cache.org\/\" target=\"_blank\">Squid<\/a>&nbsp;is a full-featured web proxy cache server application which provides proxy and cache services for HTTP, FTP, SSL requests and DNS lookups. It also performs transparent caching that reduces bandwidth and improves response time by caching and reusing frequently requested web pages.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing Squid Proxy on Rocky Linux 8<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Run system update<\/h3>\n\n\n\n<p>Update your system package cache:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf update<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install Squid Proxy on Rocky Linux 8<\/h3>\n\n\n\n<p>Squid proxy is available on the default Rocky Linux 8 repositories and can be installed by running the command;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf install squid<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>Dependencies resolved.\n============================================================================================================================================================================\n Package                                 Architecture                 Version                                                         Repository                       Size\n============================================================================================================================================================================\nInstalling:\n squid                                   x86_64                       7:4.11-4.module+el8.4.0+404+316a0dc5.2                          appstream                       3.6 M\nInstalling dependencies:\n libecap                                 x86_64                       1.0.1-2.module+el8.4.0+404+316a0dc5                             appstream                        28 k\n perl-DBI                                x86_64                       1.641-3.module+el8.4.0+509+59a8d9b3                             appstream                       739 k\n perl-Digest-SHA                         x86_64                       1:6.02-1.el8                                                    appstream                        65 k\n perl-Math-BigInt                        noarch                       1:1.9998.11-7.el8                                               baseos                          194 k\n perl-Math-Complex                       noarch                       1.59-419.el8_4.1                                                baseos                          108 k\nEnabling module streams:\n perl-DBI                                                             1.641                                                                                                \n squid                                                                4                                                                                                    \n\nTransaction Summary\n============================================================================================================================================================================\nInstall  6 Packages\n\nTotal download size: 4.7 M\nInstalled size: 14 M\nIs this ok [y\/N]: y\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Running Squid on Rocky Linux 8<\/h3>\n\n\n\n<p>Once the installation is done, start and enable Squid to run on system boot.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl enable --now squid<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Configuring Squid Proxy on Rocky Linux 8<\/h3>\n\n\n\n<p><code>\/etc\/squid\/squid.conf<\/code>&nbsp;is the default Squid Proxy configuration file.<\/p>\n\n\n\n<p>It ships with recommended minimum configuration settings.<\/p>\n\n\n\n<p>Below is the content of this file, with comment lines removed;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep -vE \"^#|^$\" \/etc\/squid\/squid.conf<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>acl localnet src 0.0.0.1-0.255.255.255\t# RFC 1122 \"this\" network (LAN)\nacl localnet src 10.0.0.0\/8\t\t# RFC 1918 local private network (LAN)\nacl localnet src 100.64.0.0\/10\t\t# RFC 6598 shared address space (CGN)\nacl localnet src 169.254.0.0\/16 \t# RFC 3927 link-local (directly plugged) machines\nacl localnet src 172.16.0.0\/12\t\t# RFC 1918 local private network (LAN)\nacl localnet src 192.168.0.0\/16\t\t# RFC 1918 local private network (LAN)\nacl localnet src fc00::\/7       \t# RFC 4193 local private network range\nacl localnet src fe80::\/10      \t# RFC 4291 link-local (directly plugged) machines\nacl SSL_ports port 443\nacl Safe_ports port 80\t\t# http\nacl Safe_ports port 21\t\t# ftp\nacl Safe_ports port 443\t\t# https\nacl Safe_ports port 70\t\t# gopher\nacl Safe_ports port 210\t\t# wais\nacl Safe_ports port 1025-65535\t# unregistered ports\nacl Safe_ports port 280\t\t# http-mgmt\nacl Safe_ports port 488\t\t# gss-http\nacl Safe_ports port 591\t\t# filemaker\nacl Safe_ports port 777\t\t# multiling http\nacl CONNECT method CONNECT\nhttp_access deny !Safe_ports\nhttp_access deny CONNECT !SSL_ports\nhttp_access allow localhost manager\nhttp_access deny manager\nhttp_access allow localnet\nhttp_access allow localhost\nhttp_access deny all\nhttp_port 3128\ncoredump_dir \/var\/spool\/squid\nrefresh_pattern ^ftp:\t\t1440\t20%\t10080\nrefresh_pattern ^gopher:\t1440\t0%\t1440\nrefresh_pattern -i (\/cgi-bin\/|\\?) 0\t0%\t0\nrefresh_pattern .\t\t0\t20%\t4320\n<\/code><\/pre>\n\n\n\n<p>Before you can begin to customize the Squid configuration to suite your needs, create the configuration file backup.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>cp \/etc\/squid\/squid.conf{,.bak}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Configure Squid Access Policies<\/h3>\n\n\n\n<p>Create an Access Control List to define your local networks that should use Squid as the proxy.<\/p>\n\n\n\n<p>Each ACL consists of a name, type and value and is defined using the&nbsp;<strong><code>acl<\/code><\/strong>&nbsp;option.<\/p>\n\n\n\n<p>For example, to configure hosts in the network 192.168.60.0\/24 to use Squid as the proxy server, you would use an ACL like;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>acl mylocalnet src 192.168.60.0\/24<\/code><\/pre>\n\n\n\n<p><strong>Replace your networks accordingly<\/strong>.<\/p>\n\n\n\n<p>This creates an ACL called&nbsp;<code>mylocalnet<\/code>&nbsp;which specifies the hosts on the specified network.<\/p>\n\n\n\n<p>After defining an ACL, you need to add a line that references the defined ACL to allow or deny access to a function of the cache.<\/p>\n\n\n\n<p>For example, use&nbsp;<strong><code>http_access<\/code><\/strong>&nbsp;to allow or deny web browsers access to the web-cache;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>http_access allow mylocalnet<\/code><\/pre>\n\n\n\n<p>Squid reads the configuration from top to bottom and hence the order of configuration options is important.<\/p>\n\n\n\n<p>You can comment the existing Network ACLS by adding hash (#) at the beginning of these lines and add your custom ACLs<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>...\n<strong>### Adding Custom ACL #######\nacl mylocalnet src 192.168.60.0\/24\nhttp_access allow mylocalnet<\/strong>\n#\n#acl localnet src 0.0.0.1-0.255.255.255 # RFC 1122 \"this\" network (LAN)\n#acl localnet src 10.0.0.0\/8            # RFC 1918 local private network (LAN)\n#acl localnet src 100.64.0.0\/10         # RFC 6598 shared address space (CGN)\n#acl localnet src 169.254.0.0\/16        # RFC 3927 link-local (directly plugged) machines\n#acl localnet src 172.16.0.0\/12         # RFC 1918 local private network (LAN)\n#acl localnet src 192.168.0.0\/16                # RFC 1918 local private network (LAN)\n#acl localnet src fc00::\/7              # RFC 4193 local private network range\n#acl localnet src fe80::\/10             # RFC 4291 link-local (directly plugged) machines\n...\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Blocking Specific Websites<\/h3>\n\n\n\n<p>Squid proxy can be used to restrict access to specific websites. For example to block access to youtube, facebook, netflix you would have to create a file that defines the domains of these websites as shown below;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim \/etc\/squid\/restricted-sites.squid<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>.youtube.com\n.facebook.com\n.netflix.com<\/code><\/pre>\n\n\n\n<p>After that, created an ACL for the restricted sites above in the squid configuration file and set the&nbsp;<strong>deny<\/strong>&nbsp;rule for the defined ACL.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>...\n### Adding Custom ACL #######\nacl mylocalnet src 192.168.60.0\/24<strong>\n<\/strong>\n## Adding Sites to Block access to ###<strong>\nacl blockedsites dstdomain \"\/etc\/squid\/restricted-sites.squid\"<\/strong>\n<strong>\nhttp_access deny blockedsites\n<\/strong>http_access allow mylocalnet\n<strong>...<\/strong><\/code><\/pre>\n\n\n\n<p>Instead of using a file to define sites to block, you can put the domains in the squid.conf file space separated on an ACL statement.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>acl blockedsites dstdomain youtube.com facebook.com netflix.com<\/strong><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Block Sites based on Specific Keywords<\/h3>\n\n\n\n<p>You can also restrict access to a website by the use of a keyword. Create a file with specific keywords as shown below;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim \/etc\/squid\/banned-keywords.squid<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>porn\nads\nmovie\ngamble<\/code><\/pre>\n\n\n\n<p>Make the necessary changes on squid configuration file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>...\n<\/strong>### Adding Custom ACL #######\nacl mylocalnet src 192.168.100.0\/24\n\n## Adding Sites to Block access to ###\nacl blockedsites dstdomain \"\/etc\/squid\/restricted-sites.squid\"<strong>\nacl keyword-ban url_regex \"\/etc\/squid\/keyword-ban.squid\"\n\n<\/strong>http_access deny blockedsites\n<strong>http_access deny keyword-ban\n<\/strong>http_access allow mylocalnet<strong> <\/strong>\n...<\/code><\/pre>\n\n\n\n<p>Comment the line below, since we have commented the localnet networks ACLs.<\/p>\n\n\n\n<p>Also comment the access rule for localnet.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#http_access allow localnet<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Masking Outgoing Traffic<\/h3>\n\n\n\n<p>To prevent proxy servers from a possibility of exposing your IP addresses on the outgoing HTTP requests, include the following directives at the end of your squid configuration file.<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>...\nrefresh_pattern ^ftp:           1440    20%     10080\nrefresh_pattern ^gopher:        1440    0%      1440\nrefresh_pattern -i (\/cgi-bin\/|\\?) 0     0%      0\nrefresh_pattern .               0       20%     4320\n<strong># Anonymize Traffic\nvia off\nforwarded_for off\n\nrequest_header_access From deny all\nrequest_header_access Server deny all\nrequest_header_access WWW-Authenticate deny all\nrequest_header_access Link deny all\nrequest_header_access Cache-Control deny all\nrequest_header_access Proxy-Connection deny all\nrequest_header_access X-Cache deny all\nrequest_header_access X-Cache-Lookup deny all\nrequest_header_access Via deny all\nrequest_header_access X-Forwarded-For deny all\nrequest_header_access Pragma deny all\nrequest_header_access Keep-Alive deny all<\/strong>\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Change Squid Default Port<\/h3>\n\n\n\n<p>Squid proxy listens on&nbsp;<code>TCP port 3128<\/code>&nbsp;by default. If you want to change this port, you would simply open the&nbsp;<code>\/etc\/squid\/squid.conf<\/code>&nbsp;configuration file and replace the value of the&nbsp;<code>http_port<\/code>&nbsp;with your desired port number.<\/p>\n\n\n\n<p>For example, to change the default port to 8888, as long as no other application is listening on the same port;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>...\n# Squid normally listens to port 3128\n# http_port 3128                 <strong>&lt;&lt; Comment the line by adding #<\/strong>\n<strong>http_port 8888<\/strong>\n...<\/code><\/pre>\n\n\n\n<p>You can also set it to listen on a specific IP (<strong>Replace the IP address accordingly<\/strong>)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>http_port 192.168.60.19.50:8888<\/strong><\/code><\/pre>\n\n\n\n<p>In general, this is how our configuration looks like;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep -vE \"^#|^$\" \/etc\/squid\/squid.conf<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>acl mylocalnet src 192.168.60.0\/24\nacl blockedsites dstdomain \"\/etc\/squid\/restricted-sites.squid\"\nhttp_access deny blockedsites\nhttp_access allow mylocalnet\nacl SSL_ports port 443\nacl Safe_ports port 80\t\t# http\nacl Safe_ports port 21\t\t# ftp\nacl Safe_ports port 443\t\t# https\nacl Safe_ports port 70\t\t# gopher\nacl Safe_ports port 210\t\t# wais\nacl Safe_ports port 1025-65535\t# unregistered ports\nacl Safe_ports port 280\t\t# http-mgmt\nacl Safe_ports port 488\t\t# gss-http\nacl Safe_ports port 591\t\t# filemaker\nacl Safe_ports port 777\t\t# multiling http\nacl CONNECT method CONNECT\nhttp_access deny !Safe_ports\nhttp_access deny CONNECT !SSL_ports\nhttp_access allow localhost manager\nhttp_access deny manager\nhttp_access allow localhost\nhttp_access deny all\nhttp_port 8888\ncoredump_dir \/var\/spool\/squid\nrefresh_pattern ^ftp:\t\t1440\t20%\t10080\nrefresh_pattern ^gopher:\t1440\t0%\t1440\nrefresh_pattern -i (\/cgi-bin\/|\\?) 0\t0%\t0\nrefresh_pattern .\t\t0\t20%\t4320\nvia off\nforwarded_for off\nrequest_header_access From deny all\nrequest_header_access Server deny all\nrequest_header_access WWW-Authenticate deny all\nrequest_header_access Link deny all\nrequest_header_access Cache-Control deny all\nrequest_header_access Proxy-Connection deny all\nrequest_header_access X-Cache deny all\nrequest_header_access X-Cache-Lookup deny all\nrequest_header_access Via deny all\nrequest_header_access X-Forwarded-For deny all\nrequest_header_access Pragma deny all\nrequest_header_access Keep-Alive deny all\n<\/code><\/pre>\n\n\n\n<p>Verify the Squid configuration for any errors;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>squid -k parse<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>2021\/10\/20 13:42:46| Startup: Initializing Authentication Schemes ...\n2021\/10\/20 13:42:46| Startup: Initialized Authentication Scheme 'basic'\n2021\/10\/20 13:42:46| Startup: Initialized Authentication Scheme 'digest'\n2021\/10\/20 13:42:46| Startup: Initialized Authentication Scheme 'negotiate'\n2021\/10\/20 13:42:46| Startup: Initialized Authentication Scheme 'ntlm'\n2021\/10\/20 13:42:46| Startup: Initialized Authentication.\n2021\/10\/20 13:42:46| Processing Configuration File: \/etc\/squid\/squid.conf (depth 0)\n2021\/10\/20 13:42:46| Processing: acl mylocalnet src 192.168.58.0\/24\n2021\/10\/20 13:42:46| Processing: acl blockedsites dstdomain \"\/etc\/squid\/restricted-sites.squid\"\n2021\/10\/20 13:42:46| Processing: http_access deny blockedsites\n2021\/10\/20 13:42:46| Processing: http_access allow mylocalnet\n2021\/10\/20 13:42:46| Processing: acl SSL_ports port 443\n2021\/10\/20 13:42:46| Processing: acl Safe_ports port 80\t\t# http\n2021\/10\/20 13:42:46| Processing: acl Safe_ports port 21\t\t# ftp\n2021\/10\/20 13:42:46| Processing: acl Safe_ports port 443\t\t# https\n2021\/10\/20 13:42:46| Processing: acl Safe_ports port 70\t\t# gopher\n2021\/10\/20 13:42:46| Processing: acl Safe_ports port 210\t\t# wais\n2021\/10\/20 13:42:46| Processing: acl Safe_ports port 1025-65535\t# unregistered ports\n2021\/10\/20 13:42:46| Processing: acl Safe_ports port 280\t\t# http-mgmt\n2021\/10\/20 13:42:46| Processing: acl Safe_ports port 488\t\t# gss-http\n2021\/10\/20 13:42:46| Processing: acl Safe_ports port 591\t\t# filemaker\n2021\/10\/20 13:42:46| Processing: acl Safe_ports port 777\t\t# multiling http\n2021\/10\/20 13:42:46| Processing: acl CONNECT method CONNECT\n2021\/10\/20 13:42:46| Processing: http_access deny !Safe_ports\n2021\/10\/20 13:42:46| Processing: http_access deny CONNECT !SSL_ports\n2021\/10\/20 13:42:46| Processing: http_access allow localhost manager\n2021\/10\/20 13:42:46| Processing: http_access deny manager\n2021\/10\/20 13:42:46| Processing: http_access allow localhost\n2021\/10\/20 13:42:46| Processing: http_access deny all\n2021\/10\/20 13:42:46| Processing: http_port 8888\n2021\/10\/20 13:42:46| Processing: coredump_dir \/var\/spool\/squid\n2021\/10\/20 13:42:46| Processing: refresh_pattern ^ftp:\t\t1440\t20%\t10080\n2021\/10\/20 13:42:46| Processing: refresh_pattern ^gopher:\t1440\t0%\t1440\n2021\/10\/20 13:42:46| Processing: refresh_pattern -i (\/cgi-bin\/|\\?) 0\t0%\t0\n2021\/10\/20 13:42:46| Processing: refresh_pattern .\t\t0\t20%\t4320\n2021\/10\/20 13:42:46| Processing: via off\n2021\/10\/20 13:42:46| Processing: forwarded_for off\n2021\/10\/20 13:42:46| Processing: request_header_access From deny all\n2021\/10\/20 13:42:46| Processing: request_header_access Server deny all\n2021\/10\/20 13:42:46| Processing: request_header_access WWW-Authenticate deny all\n2021\/10\/20 13:42:46| Processing: request_header_access Link deny all\n2021\/10\/20 13:42:46| Processing: request_header_access Cache-Control deny all\n2021\/10\/20 13:42:46| Processing: request_header_access Proxy-Connection deny all\n2021\/10\/20 13:42:46| Processing: request_header_access X-Cache deny all\n2021\/10\/20 13:42:46| Processing: request_header_access X-Cache-Lookup deny all\n2021\/10\/20 13:42:46| Processing: request_header_access Via deny all\n2021\/10\/20 13:42:46| Processing: request_header_access X-Forwarded-For deny all\n2021\/10\/20 13:42:46| Processing: request_header_access Pragma deny all\n2021\/10\/20 13:42:46| Processing: request_header_access Keep-Alive deny all\n2021\/10\/20 13:42:46| WARNING: HTTP requires the use of Via\n2021\/10\/20 13:42:46| Initializing https:\/\/ proxy context\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Restart Squid<\/h3>\n\n\n\n<p>Reconfigure Squid either by running the command below;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>squid -k reconfigure<\/code><\/pre>\n\n\n\n<p>or by restarting its service.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart squid<\/code><\/pre>\n\n\n\n<p>Check that Squid is listening on the new port;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ss -altnp | grep 8888<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>LISTEN 0      1024               *:8888            *:*    users:((\"squid\",pid=37669,fd=13))<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Allow Squid Port on Firewall<\/h3>\n\n\n\n<p>If firewall is enabled, allow the&nbsp;<code>Squid<\/code>&nbsp;port.&nbsp;<strong>Replace the port if you have changed the default<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>firewall-cmd <strong>--add-port=8888\/tcp<\/strong> --permanent<\/code><\/pre>\n\n\n\n<pre id=\"block-a4f12250-ab6c-45a7-8722-ad5bbad57af3\" class=\"wp-block-code\"><code>firewall-cmd --reload<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Configure Proxy Clients to connect to the Proxy server<\/h3>\n\n\n\n<p>To configure client to connect to the Squid proxy server, you can either set system wide proxy configurations, configure client to use the Squid proxy as the gateway or set the proxy settings on the browser.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">System Wide proxy configuration<\/h4>\n\n\n\n<p>To set system wide proxy configurations, create a configuration file under&nbsp;<code>\/etc\/profile.d<\/code>&nbsp;with environment variables defining squid proxy server details as follows;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>vim \/etc\/profile.d\/squid.sh<\/code><\/pre>\n\n\n\n<p>Replace the IP address of the Squid server accordingly.<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>PROXY_URL=\"192.168.60.19:8888\"\nHTTP_PROXY=$PROXY_URL\nHTTPS_PROXY=$PROXY_URL\nFTP_PROXY=$PROXY_URL\nhttp_proxy=$PROXY_URL\nhttps_proxy=$PROXY_URL\nftp_proxy=$PROXY_URL\nexport HTTP_PROXY HTTPS_PROXY FTP_PROXY http_proxy https_proxy ftp_proxy\n<\/code><\/pre>\n\n\n\n<p>After that, source the new configuration file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>source \/etc\/profile.d\/squid.sh<\/code><\/pre>\n\n\n\n<p>To test this, try to download anything from the clients terminal while tailing access logs on squid proxy server.<\/p>\n\n\n\n<p>On the client\u2019s terminal, run;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget google.com<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\n--2021-10-20 13:47:46--  http:\/\/google.com\/\nConnecting to 192.168.60.19:8888... connected.\nProxy request sent, awaiting response... 301 Moved Permanently\nLocation: http:\/\/www.google.com\/ [following]\n--2021-10-20 13:47:47--  http:\/\/www.google.com\/\nReusing existing connection to 192.168.60.19:8888.\nProxy request sent, awaiting response... 200 OK\nLength: unspecified [text\/html]\nSaving to: \u2018index.html\u2019\n\nindex.html                                     [ <=>                                                                                     ]  14.58K  --.-KB\/s    in 0s      \n\n2021-10-20 13:47:47 (45.7 MB\/s) - \u2018index.html\u2019 saved [14933]\n<\/code><\/pre>\n\n\n\n<p>On the Squid proxy server;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tail -f \/var\/log\/squid\/access.log <\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>...\n1634726867.006    626 192.168.60.19 TCP_MISS\/301 618 GET http:\/\/google.com\/ - HIER_DIRECT\/172.217.170.206 text\/html\n1634726867.537    530 192.168.60.19 TCP_MISS\/200 15804 GET http:\/\/www.google.com\/ - HIER_DIRECT\/216.58.223.68 text\/html<\/code><\/pre>\n\n\n\n<p>Try to access blocked sites;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget youtube.com<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>--2021-10-20 13:48:50--  http:\/\/youtube.com\/\nConnecting to 192.168.60.19:8888... connected.\nProxy request sent, awaiting response... 403 Forbidden\n2021-10-20 13:48:50 ERROR 403: Forbidden.<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>tail -f \/var\/log\/squid\/access.log<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>1634726930.663      0 192.168.60.19 TCP_DENIED\/403 3903 GET http:\/\/youtube.com\/ - HIER_NONE\/- text\/html<\/code><\/pre>\n\n\n\n<p>You can as well set your Squid server as the default gateway.<\/p>\n\n\n\n<p>On your Firefox, configure it to connect t external network via your Squid server.\u00a0<strong>Preferences<\/strong>\u00a0>\u00a0<strong>Genera<\/strong>l >\u00a0<strong>Network Settings > Manual Proxy Configuration<\/strong>. Check\u00a0<strong>Use this proxy server for all protocols.<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Read More<\/h3>\n\n\n\n<p>Read more on&nbsp;<a href=\"https:\/\/wiki.squid-cache.org\/ConfigExamples\" target=\"_blank\" rel=\"noreferrer noopener\">Squid wiki<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Related Tutorials<\/h3>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-and-setup-squid-proxy-on-debian-11-debian-10\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install and Setup Squid Proxy on Debian 11\/Debian 10<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/configure-squid-proxy-openldap-authentication-on-pfsense\/\" target=\"_blank\" rel=\"noreferrer noopener\">Configure Squid Proxy OpenLDAP Authentication on pfSense<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-and-setup-squid-proxy-on-ubuntu-20-04\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install and Setup Squid Proxy on Ubuntu 20.04<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, we are going to learn how to install and configure Squid proxy on Rocky Linux 8. Squid&nbsp;is a full-featured web proxy cache<\/p>\n","protected":false},"author":3,"featured_media":10750,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[34,121],"tags":[4217,3587,4219,277,4218],"class_list":["post-10786","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-security","category-howtos","tag-install-and-configure-squid-proxy-on-rocky-linux-8","tag-rocky-linux-8","tag-rocky-linux-8-squid","tag-squid-proxy","tag-squid-proxy-rocky-linux","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/10786"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=10786"}],"version-history":[{"count":3,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/10786\/revisions"}],"predecessor-version":[{"id":21630,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/10786\/revisions\/21630"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/10750"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=10786"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=10786"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=10786"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}