[squid-users] Tproxy Help // Transparent works fine

From: Alexandre DeAraujo <alexd_at_cal.net>
Date: Mon, 15 Jun 2009 15:37:06 -0700

I have a Transparent Proxy setup currently working and not seeing any problems while browsing. I am trying to setup squid to show
client's IP instead of proxy server's IP.
How do I go from this setup to implementing tproxy? Any pointers will be highly appreciated.

CentOS release 5.3 (Final)
iptables v1.4.3.2
Squid Cache: Version 3.0.STABLE16
Linux 2.6.29.4-tproxy2 (custom kernel for tproxy)
Cisco 7206VXR WCCPv2

// start of squid.conf
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
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 SSL_ports port 443
acl SSL_ports port 8443
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 8443 # Plesk
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localnet
#http_access deny all
http_access allow all
http_port 3128 transparent
hierarchy_stoplist cgi-bin ?
hosts_file /etc/hosts
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
coredump_dir /var/spool/squid

http_port 3129

logformat squid %ts.%03tu %6tr %>a %Ss/%03Hs %<st %rm %ru %un %Sh/%<A %mt
#emulate_httpd_log on
access_log /var/log/squid/access.log squid
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
debug_options ALL,3

no_cache allow our_networks
cache_dir ufs /var/spool/squid 200000 256 256
cache_effective_user squid
cache_swap_high 100%
cache_swap_low 80%
cache_mem 2 GB
maximum_object_size 8192 KB
half_closed_clients on
client_db off

wccp2_router <router primary IP on GEthernet>
wccp2_rebuild_wait on
wccp2_forwarding_method 1
wccp2_return_method 1
wccp2_assignment_method 1
wccp2_service standard 0

forwarded_for on
// end of squid.conf

// start of /etc/rc.d/rc.local
modprobe ip_gre
iptunnel add wccp2 mode gre remote <router wccp id IP address> local <eth0 IP address> dev eth0
ifconfig wccp2 <eth0 IP Address> netmask 255.255.255.255 up
echo 0 > /proc/sys/net/ipv4/conf/wccp2/rp_filter
# these are the ONLY iptables rules on the system at the moment(to avoid issues).
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
iptables -t nat -A PREROUTING -i wccp2 -p tcp -j REDIRECT --to-port 3128
// end of rc.local

Thanks,

Alex DeAraujo
Received on Mon Jun 15 2009 - 22:37:35 MDT

This archive was generated by hypermail 2.2.0 : Wed Jun 17 2009 - 12:00:04 MDT