Squid patch updated to match the squid-3.0.STABLE16 port (www/squid30).
FreeBSD 8 already support this, but you will need to change the IP_NONLOCALOK to IP_BINDANY in src/comm.cc (or libiapp/comm_ips_freebsd.c under lusca).
With FreeBSD 7 you still need the kernel patch. As an option you can try this backport of the IP_BINDANY commit (ip_bindany_stable.patch).
Lusca has integrated the tproxy support for FreeBSD.
We still don't know how much traffic the tproxy can handle, but as you can see here and here it should be ok for most of small/medium ISPs. Thanks again to Adrian for share this information.
# cd /usr/src # fetch http://tproxy.no-ip.org/freebsd-tproxy-sys.patch # patch < freebsd-tproxy-sys.patch
options IPDIVERT options IPFIREWALL options IPFIREWALL_NAT options IPFIREWALL_VERBOSE options IPFIREWALL_FORWARD options IPFIREWALL_DEFAULT_TO_ACCEPT options MSGMNB=8192 options MSGSSZ=64 options MSGTQL=2048 options SHMSEG=16 options SHMALL=4096 options IP_NONLOCALBIND options LIBALIAS
# cp /usr/src/sys/netinet/in.h /usr/include/netinet
# cd /usr/ports/www/squid30/files # fetch http://tproxy.no-ip.org/freebsd-tproxy-squid.patch # cd /usr/ports/www/squid30 # fetch http://tproxy.no-ip.org/freebsd-tproxy-port.patch # patch < freebsd-tproxy-port.patch # make configSelect the options SQUID_TPROXY, SQUID_IPFW and any others options you need.
# make install clean
# echo net.inet.ip.nonlocalok=1 >> /etc/sysctl.conf
http_port XXX.INTERNAL.IP.XXX:3128 transparent tproxy
# fxp0 -> External interface # em0 -> Internal interface # 200.200.200.1 -> Gateway (this is set on internal interface) # 200.200.200.0/24 -> Clients network ipfw add fwd 200.200.200.1,3128 tcp from 200.200.200.0/24 to any 80 in via em0 # default rule to transparent proxy ipfw add fwd 200.200.200.1 tcp from any 80 to 200.200.200.0/24 in via fxp0 # catch the packets that come back using the clients IPs
patchs:
freebsd-tproxy-sys.patch MD5 (freebsd-tproxy-sys.patch) = 504c03c1a77c46e952f59fd26c9722ab