squid.conf
Код: Выделить всё
# ACCESS CONTROLS
# -----------------------------------------------------------------------------
acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
# 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 192.168.0.0/24
#
acl SSL_ports port 443 # https
acl SSL_ports port 563 # snews
acl SSL_ports port 873 # rsync
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 Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl Safe_ports port 993
acl Safe_ports port 465
acl purge method PURGE
acl CONNECT method CONNECT
#acl url_filtred src 192.168.0.172-192.168.0.173
acl url_filtred src 192.168.0.2-192.168.0.250
#acl itlist url_regex -i "/etc/squid/itlist"
acl blacklist url_regex -i "/etc/squid/blacklist"
#http_access deny all
#Recommended minimum configuration:
http_access allow manager localhost
#http_access deny itlist url_filtred
http_access deny blacklist url_filtred
http_access allow localnet
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
# Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports
acl whitelist url_regex -i "/etc/squid/whitelist"
http_access allow localhost whitelist
http_access allow localnet whitelist
http_access deny blacklist url_filtred
#http_access allow localnet
http_access allow localhost
http_access deny all
icp_access allow localnet
icp_access deny all
# NETWORK OPTIONS
# -----------------------------------------------------------------------------
http_port 192.168.0.1:3128 transparent
access_log /var/log/squid/access.log squid
SquidGuard.conf
Код: Выделить всё
dbhome /var/lib/squidGuard/db
logdir /var/log/squid
#
# TIME RULES:
# abbrev for weekdays:
# s = sun, m = mon, t =tue, w = wed, h = thu, f = fri, a = sat
#time workhours {
# weekly mtwhf 08:00 - 20:30
# date *-*-01 08:00 - 20:30
#}
#
# SOURCE ADDRESSES:
#
src clients {
ip 192.168.0.210-192.168.0.250
}
#
# DESTINATION CLASSES:
#
dest pornography {
domainlist porn/domains
expressionlist porn/expressions
urllist porn/urls
}
dest warez {
domainlist warez/domains
urllist warez/urls
}
dest agressive {
domainlist agressive/domains
urllist agressive/urls
}
dest ads {
domainlist ads/domains
urllist ads/urls
}
dest drugs {
domainlist drugs/domains
urllist drugs/urls
}
dest hacking {
domainlist hacking/domains
urllist hacking/urls
}
dest violence {
domainlist violence/domains
}
dest blacklist {
domainlist /etc/squid/blacklist
}
acl {
clients {
pass !pornography !ads !drugs !warez !blacklist !agressive !hacking !violence all
redirect [url]http://192.168.0.1/index.html[/url]
}
}
Как я понял получилось у меня так, работает Squid и iptables, почему то не работает SquidGuard не цепляет списки из /var/lib/squidguard/db/
Добавил еще
Код: Выделить всё
iptables -t nat -A PREROUTING -s 192.168.0.0/24 ! -d 192.168.0.1 -p tcp -m multiport --dport 80 -j REDIRECT --to-port 3128