mustafa
(usa Debian)
Enviado em 29/07/2007 - 02:35h
hierarchy_stoplist cgi-bin ?
cache_mem 200 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 30096 KB
minimum_object_size 0 KB
maximum_object_size_in_memory 150 KB
ipcache_size 2048
ipcache_low 80
ipcache_high 95
cache_dir ufs /var/cache/squid 1000 16 256
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_swap_log /var/log/squid/swap.log
cache_store_log /var/log/squid/store.log
debug_options ALL,3
ftp_user Squid@
hosts_file /etc/hosts
#ACL#
acl all src 192.168.0.0/255.255.0.0
acl manager proto cahe_object
acl localhost src 192.168.0.0/255.255.0.0
acl SSL_ports port 443 563
acl Safe_ports port 80 #http
acl Safe_ports port 8080 #http
acl Safe_ports port 21 #ftp
acl Safe_ports port 443 563 #https, snews
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 #multilink http
acl Safe_ports port 500
acl CONNECT method CONNECT
acl blacklist dstdomain "/etc/squid/blacklist"
acl
[*****] dstdomain "/etc/squid/
[*****]"
acl ads dstdomain "/etc/squid/ads"
acl extensoes url_regex -i "/etc/squid/extensoes"
#http#
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny blacklist
http_access deny
[*****]
http_access deny ads
http_access deny extensoes
icp_access allow all
error_directory /usr/share/squid/errors/Portuguese
visible_hostname proxy_sua empresa
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
http_port 3128
firewall
#!/bin/sh
# Carrega os módulos
#modprobe iptables
modprobe iptable_nat
modprobe ip_nat_ftp
#Mais uma linha interessante de se adicionar, que protege contra pacotes danificados (usados em ataques DoS por exemplo) é:
# iptables -A FORWARD -m unclean -j DROP
# Compartilha a conexão
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
# Direciona para Squid
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128
# Abre algumas portas
##iptables -A INPUT -p tcp --destination-port 80 -j ACCEPT
##iptables -A INPUT -p tcp --destination-port 8080 -j ACCEPT
##iptables -A INPUT -p tcp --destination-port 110 -j ACCEPT
##iptables -A INPUT -p tcp --destination-port 25 -j ACCEPT
##iptables -A INPUT -p tcp --destination-port 22 -j ACCEPT
##iptables -A INPUT -p udp --destination-port 22 -j ACCEPT
##iptables -A INPUT -p tcp --destination-port 3306 -j ACCEPT
##iptables -A INPUT -p udp --destination-port 1723 -j ACCEPT
##iptables -A INPUT -p tcp --destination-port 1723 -j ACCEPT
##iptables -A INPUT -p 47 -j ACCEPT
# Abre para a rede local
##iptables -A INPUT -p tcp --syn -s 192.168.0.0/255.255.255.0 -j ACCEPT
# Fecha o resto
##iptables -A INPUT -p tcp --syn -j DROP
iptables -t nat -A PREROUTING -p tcp --dport 3306 -i eth0 -j DNAT --to 192.168.0.3:3306
#Se você quiser que o PC também não responda a pings, adicione a linha:
# echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all