adircastro
(usa Debian)
Enviado em 05/09/2007 - 18:05h
TSM,
Veja o início do meu iptables e me diga se falta algo nele:
-----------------
#!/bin/bash
iptables -F
iptables -t nat -F
iptables -t mangle -F
modprobe iptable_nat
#
# Proxy transparente (aponta no squid) na interface ethx - rede local
#
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
#
# Compartilhando a internet na interface ethx - rede externa
iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
E esse é meu squid:
-------------------
server:/etc/squid# cat squid.conf
http_port 8080 transparent
cache_mem 64 MB
maximum_object_size_in_memory 64 KB
maximum_object_size 4096 KB
minimum_object_size 0 KB
cache_swap_low 90
cache_swap_high 95
cache_dir ufs /var/spool/squid 512 16 256
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
pid_filename /var/run/squid.pid
error_directory /usr/share/squid/errors/Portuguese
emulate_httpd_log on
visible_hostname srv-cyber
cache_mgr gerenciacyber@ig.com.br
#
# ACLS RECOMENDADAS
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563 # https, snews
acl SSL_ports port 873 # rsync
acl Safe_ports port 80 # 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 # multiling http
acl Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl purge method PURGE
acl CONNECT method CONNECT
#
# ACLS PERSONALIZADAS
# Define a rede interna
acl redelocal src 192.168.100.0/255.255.255.0
#
# DEFINE SITES BLOQUEADOS NA REDE
acl proibidos dstdomain "/etc/squid/proibidos
#
# HTTP_ACCESS RECOMENDADAS
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
#
# LIBERACAO DE DOWNLOADAS ATE 5 MB
#reply_body_max_size 524880 allow all
#
#PERMITE ACESSO DA REDE INTERNA
http_access allow redelocal
#
# NEGA TUDO QUE NAO FOI LIBERADO OU NEGADO
http_access deny all