Squid proxy :
Squid is a proxy server for caching and filtering web content . Squid proxy is used by various organisation and internet providers to reduce bandwidth and to increase response time .
Squid proxy service will cache the requested web-content and re-using it for the further request of the same content .
In the above diagram, squid proxy will cache the webcontent of krizna.com from the ISP during the first request and it will deliver the cached content for the further requests of krizna.com without requesting from ISP. This will reduce bandwidth and will increase response time as the content is delivered from the local network.
» Install squid proxy
» Restricting Access to specific web sites
» Restricting Access to specific keywords
» Restricting Access to specific ipaddress
» Allow Full access to specific ipaddress
» Changing squid proxy port number
» Restricting download size
» Configure squid as transparent proxy
» Install squid proxy on centos 6 :
In this article we can see how to install and configure squid proxy on centos 6 . After installing Centos 6 (Centos 6 installation step by step screenshots ) and configuring network (How to setup network in centos 6)
Update yum repositories and packages by typing the below command
[root@leela ~]# yum update
Step 1 » Install squid package and dependencies using the below command
[root@leela ~]# yum install squid
» By default squid configuration file “/etc/squid/squid.conf” will contains recommended minimum configuration and squid caching feature will work without making any changes . Recommended minimum configuration will looks like the below
# # Recommended minimum configuration: # acl manager proto cache_object acl localhost src 127.0.0.1/32 ::1 acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1 # Example rule allowing access from your local networks. # Adapt to list your (internal) IP networks from where browsing # should be allowed 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 acl localnet src fc00::/7 # RFC 4193 local private network range acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines acl SSL_ports port 443 acl Safe_ports port 80 # http acl Safe_ports port 21 # ftp acl Safe_ports port 443 # https acl Safe_ports port 70 # gopher acl Safe_ports port 210 # wais acl Safe_ports port 1025-65535 # unregistered ports acl Safe_ports port 280 # http-mgmt acl Safe_ports port 488 # gss-http acl Safe_ports port 591 # filemaker acl Safe_ports port 777 # multiling http acl CONNECT method CONNECT # # Recommended minimum Access Permission configuration: # # Only allow cachemgr access from localhost http_access allow manager localhost http_access deny manager # Deny requests to certain unsafe ports http_access deny !Safe_ports # Deny CONNECT to other than secure SSL ports http_access deny CONNECT !SSL_ports # We strongly recommend the following be uncommented to protect innocent # web applications running on the proxy server who think the only # one who can access services on "localhost" is a local user #http_access deny to_localhost # # INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS # # Example rule allowing access from your local networks. # Adapt localnet in the ACL section to list your (internal) IP networks # from where browsing should be allowed http_access allow localnet http_access allow localhost # And finally deny all other access to this proxy http_access deny all # Squid normally listens to port 3128 http_port 3128 # We recommend you to use at least the following line. hierarchy_stoplist cgi-bin ? # Uncomment and adjust the following to add a disk cache directory. #cache_dir ufs /var/spool/squid 100 16 256 # Leave coredumps in the first cache dir coredump_dir /var/spool/squid # Add any of your own refresh_pattern entries above these. refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern -i (/cgi-bin/|?) 0 0% 0 refresh_pattern . 0 20% 4320
Step 2» Now start squid service
[root@leela ~]# service squid start
and type this below command to start squid service automatically while booting.
[root@leela ~]# chkconfig --levels 235 squid on
Step 3 » Setup your web browser to access Internet through proxy server on port 3128 .
IE : Tools » Internet options »Connections » LAN settings » Choose “Use a proxy server for your LAN” » Type your Proxy server ip (192.168.1.11 ) and port no 3128
Firefox : Options / Preferences » Advanced » Network » Settings » Choose “Manual proxy configuration ” » Type your Proxy server ip (192.168.1.11 ) and port no 3128
Step 4 » Browse some sites and check the access log file on proxy server
[root@leela ~]# cat /var/log/squid/access.log 1343759484.331 1828 192.168.1.15 TCP_MISS/200 7005 GET https://www.krizna.com/ - DIRECT/216.172.163.231 text/html 1343759484.645 265 192.168.1.15 TCP_MISS/304 477 GET http://platform.twitter.com/widgets.js - DIRECT/23.64.79.144 application/javascript 1343759484.681 309 192.168.1.15 TCP_MISS/304 839 GET http://apis.google.com/js/plusone.js - DIRECT/173.194.36.36 - 1343759485.005 178 192.168.1.15 TCP_MISS/200 495 GET http://www.google-analytics.com/__utm.gif? - DIRECT/74.125.236.142 image/gif 1343759502.763 20292 192.168.1.15 TCP_MISS/200 1898 CONNECT s-static.ak.facebook.com:443 - DIRECT/23.64.66.110 - 1343759502.765 20292 192.168.1.15 TCP_MISS/200 1898 CONNECT s-static.ak.facebook.com:443 - DIRECT/23.64.66.110 - 1343759723.040 240567 192.168.1.15 TCP_MISS/200 2904 CONNECT plusone.google.com:443 - DIRECT/173.194.36.41 - 1343759933.642 958 192.168.1.15 TCP_MISS/304 394 GET https://www.krizna.com/ - DIRECT/216.172.163.231 - 1343759934.518 459 192.168.1.15 TCP_MISS/200 495 GET http://www.google-analytics.com/__utm.gif? - DIRECT/173.194.36.8 image/gif 1343759943.131 2186 192.168.1.15 TCP_MISS/200 8343 CONNECT www.facebook.com:443 - DIRECT/66.220.146.94 - 1343759943.266 10616 192.168.1.15 TCP_MISS/200 2790 CONNECT apis.google.com:443 - DIRECT/74.125.236.128 - 1343759943.267 10615 192.168.1.15 TCP_MISS/200 2228 CONNECT ssl.gstatic.com:443 - DIRECT/74.125.236.143 - 1343759950.875 2596 192.168.1.15 TCP_MISS/200 32219 CONNECT www.facebook.com:443 - DIRECT/66.220.146.94 - 1343759961.388 20443 192.168.1.15 TCP_MISS/200 1911 CONNECT s-static.ak.fbcdn.net:443 - DIRECT/23.64.77.177 -
Troubleshooting :
If you not able to browse using proxy settings , Disable the firewall ( iptables ) and selinux service on your squid proxy server .
Disable firewall ( Iptables ) »
[root@leela ~]# service iptables stop
[root@leela ~]# chkconfig iptables off
Disable Selinux » open the file /etc/selinux/config and find the line
SELINUX=enforcing
and replace with
SELINUX=disabled
now reboot the server and try step 4.
Configure squid proxy as web filter:
You can restrict user access to particular websites or keywords using access control lists (ACLs) .
» Restricting Access to specific web sites :
For example , we can see how to block facebook.com and gmail.com .
Step 1 » create a file ( /etc/squid/blockedsites.squid ) and add the site names one per line.
[root@leela ~]# cat /etc/squid/blockedsites.squid
#blocked sites
www.facebook.com
www.gmail.com
Step 2 » Open the /etc/squid/squid.conf and create a new acl ” blocksites” and acl type “dstdomain” in the acl section like the below .
acl Safe_ports port 488 # gss-http acl Safe_ports port 591 # filemaker acl Safe_ports port 777 # multiling http acl CONNECT method CONNECT # ACL blocksites acl blocksites dstdomain "/etc/squid/blockedsites.squid"
and add the following line “http_access deny blocksites” to http_section to deny the access to the acl “blocksites” .
# Recommended minimum Access Permission configuration: # # Only allow cachemgr access from localhost http_access allow manager localhost # Deny access to blocksites ACL http_access deny blocksites
Step 3 » Now restart squid service
[root@leela ~]# service squid restart
Step 4 » Try to access facebook.com in your browser . you could see the blocked page as below .
and check the log file you can see the facebook request is denied .
[root@leela ~]# tail -f /var/log/squid/access.log ................................................................................. 1343820985.542 1 192.168.1.15 TCP_DENIED/403 4255 GET http://www.facebook.com/ - NONE/- text/html 1343820986.998 1411 192.168.1.15 TCP_MISS/200 13152 GET http://www.squid-cache.org/Artwork/SN.png - DIRECT/198.186.193.234 image/png 1343820987.004 0 192.168.1.15 TCP_DENIED/403 4178 GET http://www.facebook.com/favicon.ico - NONE/- text/html
» Restricting Access to specific keywords :
Step 1 » create a file ( /etc/squid/blockkeywords.squid ) and add the keywords one per line.
[root@leela ~]# cat /etc/squid/blockkeywords.squid
#blocked keywords
sex
porn
xxx
Step 2 » Open the /etc/squid/squid.conf and create a new acl “blockkeywords” and acl type “url_regex” in the acl section
acl Safe_ports port 488 # gss-http acl Safe_ports port 591 # filemaker acl Safe_ports port 777 # multiling http acl CONNECT method CONNECT # ACL blocksites acl blocksites dstdomain "/etc/squid/blockedsites.squid" # ACL blockkeywords acl blockkeywords url_regex -i "/etc/squid/blockkeywords.squid"
and add the following line “http_access deny blockkeywords” to http_section to deny the access to the acl “blockkeywords” .
# Recommended minimum Access Permission configuration: # # Only allow cachemgr access from localhost http_access allow manager localhost # Deny access to blocksites ACL http_access deny blocksites # Deny access to blockkeywords ACL http_access deny blockkeywords
» Restricting Access to specific Ipaddress :
Step 1 » create a file ( /etc/squid/blockip.squid ) and add the ip adresses one per line.
[root@leela ~]# cat /etc/squid/blockip.squid
#blocked ips
192.168.1.20
192.168.1.21
Step 2 » Open the /etc/squid/squid.conf and create a new acl “blockip” and acl type “src” in the acl section
acl Safe_ports port 488 # gss-http acl Safe_ports port 591 # filemaker acl Safe_ports port 777 # multiling http acl CONNECT method CONNECT # ACL blocksites acl blocksites dstdomain "/etc/squid/blockedsites.squid" # ACL blockkeywords acl blockkeywords url_regex -i "/etc/squid/blockkeywords.squid" # ACL blockip acl blockip src "/etc/squid/blockip.squid"
and add the following line “http_access deny blockip” to http_section to deny the access to the acl “blockip” .
# Recommended minimum Access Permission configuration: # # Only allow cachemgr access from localhost http_access allow manager localhost # Deny access to blockip ACL http_access deny blockip # Deny access to blocksites ACL http_access deny blocksites # Deny access to blockkeywords ACL http_access deny blockkeywords
» Allow Full access to specific Ipaddress :
You can allow specific ip address to gain full access without blocking sites and keywords . just create a file “/etc/squid/allowip.squid ” and add the ip address one per line and create an acl “allowip” and acl type “src” in the acl section
# ACL allowip acl allowip src "/etc/squid/allowip.squid"
and add the “allowip” in the http_access as below
# Recommended minimum Access Permission configuration: # # Only allow cachemgr access from localhost http_access allow manager localhost # Deny access to blockip ACL http_access deny blockip # Deny access to blocksites ACL http_access deny blocksites !allowip # Deny access to blockkeywords ACL http_access deny blockkeywords !allowip
» Changing squid proxy port number:
You can change squid proxy port number , by default it uses 3128 port .
Just find the below line in “/etc/squid/squid.conf”
http_port 3128
and replace with
http_port 8000 # whatever port number you want
» Restricting Download size :
You can restrict download file size using reply_body_max_size .
Add the below line at the bottom of the http_access section
#Restrict download size
reply_body_max_size 10 MB all
or
#Restrict download size
reply_body_max_size 10 MB !allowip
» Configuring Squid as Transparent Proxy :
You can configure squid as transparent proxy .
Step 1 » just find the below line
# Squid normally listens to port 3128
http_port 3128
and replace with
# Squid normally listens to port 3128
http_port 3128 intercept
Step 2 » Create a file “/root/squidfw.sh” and add the following firewall script ( modify as per your interface configuration ).
#!/bin/sh # squid server IP SQUID_SERVER="192.168.1.11" # Interface connected to Internet INTERNET="eth0" # Interface connected to LAN LAN_IN="eth1" # Squid port SQUID_PORT="3128" # DO NOT MODIFY BELOW # Clean old firewall iptables -F iptables -X iptables -t nat -F iptables -t nat -X iptables -t mangle -F iptables -t mangle -X # Load IPTABLES modules for NAT and IP conntrack support modprobe ip_conntrack modprobe ip_conntrack_ftp # For win xp ftp client #modprobe ip_nat_ftp echo 1 > /proc/sys/net/ipv4/ip_forward # Setting default filter policy iptables -P INPUT DROP iptables -P OUTPUT ACCEPT # Unlimited access to loop back iptables -A INPUT -i lo -j ACCEPT iptables -A OUTPUT -o lo -j ACCEPT # Allow UDP, DNS and Passive FTP iptables -A INPUT -i $INTERNET -m state --state ESTABLISHED,RELATED -j ACCEPT # set this system as a router for Rest of LAN iptables --table nat --append POSTROUTING --out-interface $INTERNET -j MASQUERADE iptables --append FORWARD --in-interface $LAN_IN -j ACCEPT # unlimited access to LAN iptables -A INPUT -i $LAN_IN -j ACCEPT iptables -A OUTPUT -o $LAN_IN -j ACCEPT # DNAT port 80 request comming from LAN systems to squid 3128 ($SQUID_PORT) aka transparent proxy iptables -t nat -A PREROUTING -i $LAN_IN -p tcp --dport 80 -j DNAT --to $SQUID_SERVER:$SQUID_PORT # if it is same system iptables -t nat -A PREROUTING -i $INTERNET -p tcp --dport 80 -j REDIRECT --to-port $SQUID_PORT # DROP everything and Log it iptables -A INPUT -j LOG iptables -A INPUT -j DROP
Step 3 » just run the script
[root@leela ~]# sh /root/squidfw.sh
and add the below line to “/etc/rc.local” to run the script during startup
sh /root/squidfw.sh
Step 4 (Updated) » Change default gateway ip to squid server ip on the user machines .
Now users can access Internet without setting proxy in the browser settings.
That’s it , hope this article will help you to learn little things about configuring squid proxy on centos 6.
Thanks, i really appreciate your effort
Thanks soooooo much, everything worked well.
Nice one. Clear and helpful tutorial!
Good day. This is the first time i set up a proxy server. I hope you can help me how to setup a transparent proxy.I am trying to setup a transparent proxy behind the firewall and i am using eth1 on the squid server. my problem is when i assign a proxy setting on the browser it works but when i remove the proxy setting on the browser it does not work. i just followed the how to on this page.
Thanks in advance.
Yes its actually clear tutorial and it was really helpful me too…
ADDITIONAL INFO. this is the firewall script that im currentlu using. i put a commet on this line because i am getting an error message #echo 1 > /proc/sys/net/ipv4/ip_forward
#!/bin/sh
# squid server IP
SQUID_SERVER=”192.168.1.1″
# Interface connected to Internet
INTERNET=”eth0″
# Interface connected to LAN
LAN_IN=”eth1″
# Squid port
SQUID_PORT=”3128″
# DO NOT MODIFY BELOW
# Clean old firewall
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
# Load IPTABLES modules for NAT and IP conntrack support
modprobe ip_conntrack
modprobe ip_conntrack_ftp
# For win xp ftp client
#modprobe ip_nat_ftp
#echo 1 > /proc/sys/net/ipv4/ip_forward
# Setting default filter policy
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
# Unlimited access to loop back
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
# Allow UDP, DNS and Passive FTP
#iptables -A INPUT -i $INTERNET -m state –state ESTABLISHED,RELATED -j ACCEPT
# set this system as a router for Rest of LAN
#iptables –table nat –append POSTROUTING –out-interface $INTERNET -j MASQUERADE
iptables –append FORWARD –in-interface $LAN_IN -j ACCEPT
# unlimited access to LAN
iptables -A INPUT -i $LAN_IN -j ACCEPT
iptables -A OUTPUT -o $LAN_IN -j ACCEPT
# DNAT port 80 request comming from LAN systems to squid 3128 ($SQUID_PORT) aka transparent proxy
iptables -t nat -A PREROUTING -i $LAN_IN -p tcp –dport 80 -j DNAT –to $SQUID_SERVER:$SQUID_PORT
# if it is same system
iptables -t nat -A PREROUTING -i $INTERNET -p tcp –dport 80 -j REDIRECT –to-port $SQUID_PORT
# DROP everything and Log it
iptables -A INPUT -j LOG
iptables -A INPUT -j DROP
Hi jjsn,
Can you just paste the error msg here? and can you please check the gateway of the machine , Gateway should be squid server IP for using it as transparent proxy.
Thanks Krizna it works now. I will just post for any possible problem encountered.
HI Krizna, Additional question how can i enable ports such as port 21,22,25,110,etc… and also ping currently the user only access is browsing.
Just add these lines in the iptables script and try again
#iptables -A OUTPUT -i $INTERNET -p tcp -m multiport --dports 21,22,110,25,143 -m state --state NEW -j ACCEPT
#iptables -A INPUT -i $INTERNET -p tcp -m multiport --dports 21,22,110,25,143 -m state --state NEW -j ACCEPT
#iptables -A OUTPUT -p icmp --icmp-type echo-request -j ACCEPT
#iptables -A INPUT -p icmp --icmp-type echo-reply -j ACCEPT
I will try that. Thanks again
Hi,
I have installed Squid in Centos 6.3.
I want to use this pc as firewall between my Internet & LAN
I want to do the following below things.
1. Connect the Internet to the PC (installed with Centos)
2. using squid configure the Eth0 as incoming internet
3. Eth1 as distributing internet to LAN
4. using Squid as Proxy and assign the IP addresses to the client pcs using MAC address
5. how to restrict the use of certain websites in client pcs during working hours. and allow them only on specific times like 5pm to 9am and 1pm to 2pm.
Thanks
Kishore
Hi…
It is working very Good ….Thnkz….
Hi,
I have installed Squid in Centos 6.3.
I want to use this pc as firewall between my Internet & LAN
I want to do the following below things.
1. Connect the Internet to the PC (installed with Centos)
2. using squid configure the Eth0 as incoming internet
3. Eth1 as distributing internet to LAN
4. using Squid as Proxy and assign the IP addresses to the client pcs using MAC address
5. how to restrict the use of certain websites in client pcs during working hours. and allow them only on specific times like 5pm to 9am and 1pm to 2pm.
Thanks
Kishore
Hi…
It is working very Good ….Thnkz….
it nice
it nice
many thanks
many thanks
i am using reh hat el 5 for squid proxy server. i paste one porn file in squid folder to restrict some webites . Another file using name Hicet that also paste in squid folder it is using for particular ips can search all websites . how can i use this porn and hicet file in centos squid.conf file ?
create acl for porn file and hicet file like below ..
acl blockporn dstdomain “/etc/squid/porn”
acl allowips src “etc/squid/hicet”
and control access like this
http_access deny blockporn
http_access allow allowips
[or]
http_access deny blockporn !allowips
i am using reh hat el 5 for squid proxy server. i paste one porn file in squid folder to restrict some webites . Another file using name Hicet that also paste in squid folder it is using for particular ips can search all websites . how can i use this porn and hicet file in centos squid.conf file ?
create acl for porn file and hicet file like below ..
acl blockporn dstdomain “/etc/squid/porn”
acl allowips src “etc/squid/hicet”
and control access like this
http_access deny blockporn
http_access allow allowips
[or]
http_access deny blockporn !allowips
i am using centos 6.3. in squid.conf file where i can insert my clinet ips ?
@vijay
please provide more details like . purpose of using client ips ( to block or allow )
anyway to allow or deny ips , you should define an ACL for IP groups ..
For Eg:
developers : 192.168.1.2 ,192.168.1.3
testers : 172.27.1.2 , 172.27.1.3
Now in squid.conf file under ACL section define acl for both developers and testers like below
acl devips src 192.168.1.2 192.168.1.3
acl testips src 172.27.1.2 172.27.1.3
and under http_access .. you can allow or deny particular acl
http_access deny devips
http_access allow testips
hey dear all https site not working in transparent squid. please get solution for this… urgent
i am using centos 6.3. in squid.conf file where i can insert my clinet ips ?
@vijay
please provide more details like . purpose of using client ips ( to block or allow )
anyway to allow or deny ips , you should define an ACL for IP groups ..
For Eg:
developers : 192.168.1.2 ,192.168.1.3
testers : 172.27.1.2 , 172.27.1.3
Now in squid.conf file under ACL section define acl for both developers and testers like below
acl devips src 192.168.1.2 192.168.1.3
acl testips src 172.27.1.2 172.27.1.3
and under http_access .. you can allow or deny particular acl
http_access deny devips
http_access allow testips
hey dear all https site not working in transparent squid. please get solution for this… urgent
i want write coding for squid proxy server in centos 6. here i am going to use this ip serious 192.168.153.0/24 for browing. i insert my this lines acl Net src 192.168.153.0/24 http_access allow Net in squid conf file behind this lines adapt to list your internal IP networks from where browsing should be allowed: but getting error message when i service restart squid this msg you should probably remove 192.168.153.0/24 from the ACL name Net . how to slove this
vijay
can you paste the squid.conf file content ? ..
use http://pastebin.com/
i want write coding for squid proxy server in centos 6. here i am going to use this ip serious 192.168.153.0/24 for browing. i insert my this lines acl Net src 192.168.153.0/24 http_access allow Net in squid conf file behind this lines adapt to list your internal IP networks from where browsing should be allowed: but getting error message when i service restart squid this msg you should probably remove 192.168.153.0/24 from the ACL name Net . how to slove this
vijay
can you paste the squid.conf file content ? ..
use http://pastebin.com/
#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
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
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
acl NET src 192.168.153.0/24 # Your Internal Network
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager
# Deny requests to certain unsafe ports
http_access deny !Safe_ports
# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports
# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on “localhost” is a local user
#http_access deny to_localhost
#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#
# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
acl Net 192.168.153.0/255.255.255.0
http_access allows Net
#http_access allow localnet
http_access allow localhost
# And finally deny all other access to this proxy
http_access deny all
# Squid normally listens to port 3128
http_port 3128
# We recommend you to use at least the following line.
hierarchy_stoplist cgi-bin ?
# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/spool/squid 100 16 256
# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid
# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|?) 0 0% 0
refresh_pattern . 0 20% 4320
vijay
it seams you got 2 acls in the same name Net and some typo errors..
replace these lines
acl Net 192.168.153.0/255.255.255.0
http_access allows Net
with
http_access allow Net
you have already defined acl Net under ACL section.
acl NET src 192.168.153.0/24 # Your Internal Network
#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
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
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
acl NET src 192.168.153.0/24 # Your Internal Network
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager
# Deny requests to certain unsafe ports
http_access deny !Safe_ports
# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports
# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on “localhost” is a local user
#http_access deny to_localhost
#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#
# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
acl Net 192.168.153.0/255.255.255.0
http_access allows Net
#http_access allow localnet
http_access allow localhost
# And finally deny all other access to this proxy
http_access deny all
# Squid normally listens to port 3128
http_port 3128
# We recommend you to use at least the following line.
hierarchy_stoplist cgi-bin ?
# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/spool/squid 100 16 256
# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid
# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|?) 0 0% 0
refresh_pattern . 0 20% 4320
vijay
it seams you got 2 acls in the same name Net and some typo errors..
replace these lines
acl Net 192.168.153.0/255.255.255.0
http_access allows Net
with
http_access allow Net
you have already defined acl Net under ACL section.
acl NET src 192.168.153.0/24 # Your Internal Network
i server ip 192.168.153.153 . i configured 192.168.153.153 port 3128 in connections ineternet explorer but not browsing .
#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
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
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
acl NET src 192.168.153.0/24 # Your Internal Network
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager
# Deny requests to certain unsafe ports
http_access deny !Safe_ports
# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports
# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on “localhost” is a local user
#http_access deny to_localhost
#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#
# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow Net
#http_access allow localnet
http_access allow localhost
# And finally deny all other access to this proxy
http_access deny all
# Squid normally listens to port 3128
http_port 3128
# We recommend you to use at least the following line.
hierarchy_stoplist cgi-bin ?
# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/spool/squid 100 16 256
# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid
# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|?) 0 0% 0
refresh_pattern . 0 20% 4320
i server ip 192.168.153.153 . i configured 192.168.153.153 port 3128 in connections ineternet explorer but not browsing .
#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
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
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
acl NET src 192.168.153.0/24 # Your Internal Network
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager
# Deny requests to certain unsafe ports
http_access deny !Safe_ports
# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports
# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on “localhost” is a local user
#http_access deny to_localhost
#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#
# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow Net
#http_access allow localnet
http_access allow localhost
# And finally deny all other access to this proxy
http_access deny all
# Squid normally listens to port 3128
http_port 3128
# We recommend you to use at least the following line.
hierarchy_stoplist cgi-bin ?
# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/spool/squid 100 16 256
# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid
# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|?) 0 0% 0
refresh_pattern . 0 20% 4320
thanks
thanks
[root@localhost ~]# cat /ect/squid/blockkeywords.squid
cat: /ect/squid/blockkeywords.squid: No such file or directory
@2c4ddb138a661fb89cbbb1cebaccd704:disqus
hi vijay .. you need to create files yourself and add some keywords to block
[root@localhost ~]# cat /ect/squid/blockkeywords.squid
cat: /ect/squid/blockkeywords.squid: No such file or directory
@2c4ddb138a661fb89cbbb1cebaccd704:disqus
hi vijay .. you need to create files yourself and add some keywords to block
hi thanks for information . I want open only one website in particular ips how can i configure
acl partips src 192.168.1.10 192.168.1.11
acl allowsite dstdomain http://www.google.com
http_access deny partips !website
hi thanks for information . I want open only one website in particular ips how can i configure
acl partips src 192.168.1.10 192.168.1.11
acl allowsite dstdomain http://www.google.com
http_access deny partips !website
if i want one or two websites only allow particular ips
if i want one or two websites only allow particular ips