Skip to content

KHAPCHI.COM

One stick to rule all staffs!

  • Home
  • Technology
  • Tools
  • About
  • Toggle search form
  • How to make DNS lookup of an IP or Domain using Python3. Technology
  • Multilib problems while using yum. Technology
  • Prepare a Linux server for first use. Technology
  • 7 Commands to know your Linux Server Technology
  • How to connect to Local MySQL Db using Python3 Technology
  • Begin! Uncategorized
  • Python3 regular expression to fetch Domains from a string or Paragraph. Technology
  • How to store JSON response from an API to MySQL table? Technology

Install and configure Squid3 for Ubuntu20.04 for known hosts – IP Access

Posted on December 8, 2022December 8, 2022 By Khapchi No Comments on Install and configure Squid3 for Ubuntu20.04 for known hosts – IP Access

To configure Squid3 proxy on Ubuntu 20.04, you can follow these steps:

  1. Install Squid3 using the following command:
sudo apt-get install squid3
  1. After the installation is complete, open the Squid configuration file using your preferred text editor. For example:
sudo nano /etc/squid/squid.conf
  1. Locate the http_port directive in the configuration file, and specify the port number that Squid will listen on. By default, Squid listens on port 3128.
  2. Locate the acl directives in the configuration file, and define the network access controls for your Squid proxy. For example, you can allow access to your Squid proxy only from specific IP addresses or networks:
acl localnet src 10.0.0.0/8     # RFC1918 possible internal network
acl localnet src 172.16.0.0/12  # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
  1. Locate the http_access directive in the configuration file, and specify which users or networks are allowed or denied access to your Squid proxy. For example, you can allow access to your Squid proxy only from the IP addresses or networks defined in the previous step:
http_access allow localnet
http_access deny all
  1. Save the changes to the configuration file and exit the text editor.
  2. Restart the Squid service to apply the changes:
sudo systemctl restart squid
  1. To verify that Squid is running and listening on the correct port, use the following command:
sudo netstat -tulpn | grep squid

This should display the Squid process and the port number it is listening on.

You can now use your Squid proxy to route traffic for your network. Keep in mind that you may need to configure your network settings to use the Squid proxy.

To test if the configured proxy is working use the curl command as follows:

curl –proxy [proxy server]:[port] [URL]

For example:

curl --proxy localhost:3128 https://www.google.com/

If the proxy is working properly, you should see the contents of the website in the terminal.

Uncategorized Tags:IP based access, proxy, squid3, Ubuntu20.04

Post navigation

Previous Post: Multilib problems while using yum.
Next Post: How to connect to Local MySQL Db using Python3

Related Posts

  • Begin! Uncategorized

Leave a Reply Cancel reply

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

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Recent Posts

  • Python3 regular expression to fetch Domains from a string or Paragraph.
  • Store JSON response from API as separate columns in MySQL table?
  • How to store JSON response from an API to MySQL table?
  • How to Query any REST API using Python3 easy.
  • How to fetch all DNS records of a Domain using Python3.

Recent Comments

    Archives

    • December 2022
    • July 2020
    • May 2020

    Categories

    • Technology
    • Uncategorized

    Archives

    • December 2022
    • July 2020
    • May 2020
    • How to Query any REST API using Python3 easy. Technology
    • Multilib problems while using yum. Technology
    • How to store JSON response from an API to MySQL table? Technology
    • How to connect to Local MySQL Db using Python3 Technology
    • Begin! Uncategorized
    • How to fetch all DNS records of a Domain using Python3. Technology
    • Prepare a Linux server for first use. Technology
    • Python3 regular expression to fetch Domains from a string or Paragraph. Technology

    Copyright © 2025 KHAPCHI.COM.

    Powered by PressBook News WordPress theme