Seteo Proxy Trasparente

El proxy trasparente tiene una configuracion del squid. /etc/squid/squid.conf

Esa es la siguiente

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 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

acl mi_red src 192.168.0.0/24

acl permito url_regex -i ‘/etc/squid/permitidas’

acl bloqueo url_regex -i ‘/etc/squid/bloqueadas’

#http_access allow mi_red permito

#http_access allow mi_red !bloqueo

reply_body_max_size 100 mb

http_port 3128 transparent

cache_mem 1400 MB

maximum_object_size_in_memory 5120 KB

cache_dir ufs /var/spool/squid 3048 8 128

maximum_object_size 4096 KB

cache_swap_low 90

cache_swap_high 95

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

cache_effective_user proxy

visible_hostname Sanatorio del Pilar Proxy Server

cache_effective_group proxy


Luego tiene una regla de redireccion para el puerto 3218 ir al 80.

/etc/init.d/redireccion.sh

con el siguiente contenido:

#! /bin/sh

### BEGIN INIT INFO

# Provides:          noip2

# Required-Start:    $local_fs $remote_fs $network $syslog $named

# Required-Stop:     $local_fs $remote_fs $network $syslog $named

# Default-Start:     2 3 4 5

# Default-Stop:      0 1 6

# Short-Description: Start/stop redireccion

### END INIT INFO

iptables -t nat -A PREROUTING -i eth0 -p tcp –dport 80 -j REDIRECT –to-port 3128

iptables -t nat -A PREROUTING -i eth0 -p tcp –dport 443 -j REDIRECT –to-port 3128