Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Nov 2010 20:42:53 +0200
From:      Daniel Iliev <daniel.iliev@gmail.com>
To:        freebsd-pf@freebsd.org
Subject:   redirecting local traffic to localhost
Message-ID:  <20101125204253.1ffc11fb@bsd.ilievnet.com>

next in thread | raw e-mail | index | archive | help

Hi,

I'm trying to setup a transparent squid.
While intercepting traffic from other hosts works fine, I can't figure
out how to redirect locally originated packets to the proxy daemon.
Squid is listening on 127.0.0.1:3128 with the "intercept" flag set. PF
redirects the http traffic like this:

rdr on msk0 from any to any port 80 -> 127.0.0.1 port 3128

So far, so good, but how should I redirect the packets from the squid
box itself? The rule I'm looking for looks like this on Linux:

iptables -t nat -I OUTPUT -m owner ! --uid-owner squid -p tcp --dport \
80 -j REDIRECT --to-port 3128



-- 
Best regards,
Daniel



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101125204253.1ffc11fb>