Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- install squid:
- yum install squid
- edit config:
- nano /etc/squid/squid.conf
- --------------------------------------------------
- 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
- 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
- #allow client ip
- #acl allowip src "/etc/squid/allowip.squid"
- #block sites by domain
- #acl blocksites dstdomain "/etc/squid/blockedsites.squid"
- #block sites by keyword
- #acl blockkeywords url_regex -i "/etc/squid/blockkeywords.squid"
- #block client by ip
- #acl blockip src "/etc/squid/blockip.squid"
- http_access allow manager localhost
- #deny blockip ACL
- #http_access deny blockip
- #deny blockedsites ACL
- #http_access deny blocksites
- #deny blockedsites ACL if not allowip
- #http_access deny blocksites !allowip
- #deny blockkeywords ACL
- #http_access deny blockkeywords
- #deny blockkeywords ACL if not allowip
- #http_access deny blockkeywords !allowip
- http_access deny manager
- http_access deny !Safe_ports
- http_access deny CONNECT !SSL_ports
- http_access allow localnet
- http_access allow localhost
- http_access deny all
- http_port 3128
- #alternate port number
- #http_port 8080
- #transparent proxy
- #http_port 3128 intercept
- #Restrict download size
- #reply_body_max_size 10 MB all
- #Restrict download size if not allowip
- #reply_body_max_size 10 MB !allowip
- hierarchy_stoplist cgi-bin ?
- coredump_dir /var/spool/squid
- 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
- --------------------------------------------------
- start squid on boot:
- chkconfig squid on
- start squid:
- service squid start
- ==================================================================
- to block sites:
- nano /etc/squid/blockedsites.squid
- ---------------------------------------------------
- yahoo.com
- ithelpblog.com
- ---------------------------------------------------
- to block by keywords:
- nano /etc/squid/blockkeywords.squid
- ---------------------------------------------------
- sex
- porn
- ---------------------------------------------------
- to block client by ip address
- nano /etc/squid/blockip.squid
- ---------------------------------------------------
- 192.168.0.120
- 192.168.0.130
- ---------------------------------------------------
- to fullaccess client by ip address
- nano /etc/squid/allowip.squid
- ---------------------------------------------------
- 192.168.0.100
- ---------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement