Friday, August 5, 2016

squid server configuration with few ACL



yum install squid*

vim /etc/squid/squid.conf


##
get new ad server list curl-sS -L --compressed"http://pgl.yoyo.org/adservers/serverlist.php?hostformat=nohtml&showintro=0&mimetype=plaintext"
> /etc/squid/ad_block.txt 

##refresh squid
/usr/local/sbin/squid -k reconfigure or  squid -z
make to transparent proxy
# Squid normally listens to port 3128
http_port 192.168.101.97:3128 transparent
visible_hostname localhost


acl use to without restriction access web site
acl Boss_IP src 192.168.101.230 192.168.101.88 192.168.101.20 192.168.101.83 192.168.101.19
http_access allow Boss_IP



## disable ads ( http://pgl.yoyo.org/adservers/ )
acl ads dstdom_regex "/etc/squid/ad_block.txt"
http_access deny ads

acl limited_users src 192.168.101.0/24   # downlord limit_rule_
reply_body_max_size 330 MB limited_users

acl blockfiles urlpath_regex -i "/etc/squid/blocks.files.acl"

\.[Ee][Xx][Ee]$
\.[Aa][Vv][Ii]$ # .avi or .AVI
\.[Mm][Pp]3$ # .mp3 or .MP3
\.[Zz][Ii][Pp]$
\.[Mm][Ss][Ii]$
\.[Mm][Pp]4$
\.[Ff][Ll][Vv]$
\.[Rr][Pp][Mm]$
\.[Tt][Zz]$
\.[Bb][Zz]$
\.[Mm][Ss][Ii]$


# Deny all blocked extension
#deny_info ERR_BLOCKED_FILES blockfiles
http_access deny blockfiles home    ;;--yellow is my network acl


acl blockeddomain dstdomain "/etc/squid/blocked.domains.acl"
http_access deny blockeddomain
http_reply_access deny CONNECT blockeddomain










No comments:

Post a Comment