Configuring Squid

  • July 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Configuring Squid as PDF for free.

More details

  • Words: 311
  • Pages: 2
Install Squid on CentOS / RHEL 5 Use yum command as follows: # yum install squid Squid Basic Configuration Squid configuration file located at /etc/squid/squid.conf. Open file using a text editor: # vi /etc/squid/squid.conf At least you need to define ACL (access control list) to work with squid. The defaults port is TCP 3128. Following example ACL allowing access from your local networks 192.168.1.0/24 and 192.168.2.0/24. Make sure you adapt to list your internal IP networks from where browsing should be allowed: acl our_networks src 192.168.1.0/24 192.168.2.0/24 http_access allow our_networks Save and close the file. Start squid proxy server: # chkconfig squid on # /etc/init.d/squid start Output: init_cache_dir /var/spool/squid... Starting squid: . [ OK ] Verify port 3128 is open: # netstat -tulpn | grep 3128 Output: tcp 0 0 0.0.0.0:3128 0.0.0.0:* LISTEN 20653/(squid) Open TCP port 3128 Finally make sure iptables is allowing to access squid proxy server. Just open /etc/sysconfig/iptables file: # vi /etc/sysconfig/iptables Append configuration: -A RH-Firewall-1-INPUT -m state --state NEW,ESTABLISHED,RELATED -m tcp -p tcp --dport 3128 -j ACCEPT Restart iptables based firewall: # /etc/init.d/iptables restart Output: Flushing firewall rules: [ OK ] Setting chains to policy ACCEPT: filter [ OK ] Unloading iptables modules: [ OK ] Applying iptables firewall rules: [ OK ] Loading additional iptables modules: ip_conntrack_netbios_n[ OK ] Client configuration Open a webbrowser > Tools > Internet option > Network settings > and setup Squid server IP address and port # 3128.

Procedure to block a port First open /etc/squid/squid.conf file # vi /etc/squid/squid.conf Locate your ACL section and add configuration directive as follows: acl block_port port 1234 http_access deny block_port http_access allow all

If you just want to skip a particular IP (192.168.1.5) try as follows: acl block_port port 1234 acl no_block_port_ip src 192.168.1.5 http_access deny block_port !no_block_port_ip http_access allow all Close and save the file. Restart squid proxy server: # /etc/init.d/squid restart

Related Documents

Configuring Squid
July 2020 9
Squid
April 2020 14
Squid
July 2020 16
Squid Proxy
July 2020 12
Squid+diversity
July 2020 7
Squid 3
November 2019 13