nivaldopaulo19
(usa Debian)
Enviado em 19/02/2015 - 19:04h
Detalhe estou usando duas placas de rede no server debian que esta assim:
interfaces
# The primary network interface (WAN)
auto eth0
iface eth0 inet static
address 10.10.10.200
netmask 255.255.255.0
network 10.10.0.0
broadcast 10.10.255.255
gateway 10.10.10.254
dns-server 10.10.10.254
#the secondary network interface (LAN)
auto eth1
iface eth1 inet static
address 192.168.10.254
netmask 255.255.255.0
Pasta /etc/default/isc-dhcp-server
INTERFACES="eth1"
Dentro do /etc/init.d/rc.firewall
#FIREWALL DO SERVIDOR
#Compartilha a internet
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
#Proxy transparente
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to 3128
#Ativa roteamento no kernel
echo 1 > /proc/sys/net/ipv4/ip_forward
Squid.conf
#acls bloqueio#
acl rede src 192.168.10.0/24
acl site url_regex -i "/home/arquivos/bloqueados.txt"
#bloqueando extensoes de downloads#
#acl extensoes urlpath_regex -i "/home/arquivos/extensoes.txt"
#controle do cache#
acl SSL_ports port 443 #https
acl Safe_ports port 80 #http
acl Safe_ports port 21 #ftp
acl Safe_ports port 443 563 #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
#Acao das acls#
acl manager proto cache_obeject
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access allow localhost
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
#libera ou bloqueia redes#
http_access allow rede !site
http_access deny all
#e-mail do administrador#
#cache_mgr nivaldo@divinfo.com.br
#erros proxy#
error_directory /usr/share/squid3/errors/pt-br
#proxy transparente#
http_port 192.168.10.254:3128 transparent
hierarchy_stoplist cgi_bin ?
access_log /var/log/squid3/access.log squid
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880
refresh_pattern . 0 20% 4320
coredump_dir /var/spool/squid3