[squid-users] TPROXY does not redirect to squid port

From: Peter Warasin <peter_at_endian.com>
Date: Mon, 27 Jan 2014 18:18:08 +0100

hi guys

I configured a transparent proxy environment using TPROXY following the
howto on the squid wiki http://wiki.squid-cache.org/Features/Tproxy4
I setup a tproxy port in squid on port 18080 and created the following
iptables rule:

-A PREROUTING -p tcp --dport 80 -j TPROXY --on-port 18080 --tproxy-mark
0x1/0x1

But squid does never see packets coming in.

So I tried with the following tool:
https://github.com/kristrev/tproxy-example
The same, packets are not seen.

By chance I tried to redirect to port 80 instead of 18080, in order that
redirection does not happen at all, and then packets were seen by the
tproxy-example tool.

Seems that redirection is not working correctly or not at all.

I proved with iptables logging rules that routing is correct, because
packets are coming in the INPUT chain instead of FORWARD and are marked
as they should be.

Also I see the following debug output when compiled the tproxy iptables
modules with -DDEBUG:

xt_TPROXY: redirecting: proto 6 194.232.104.141:80 ->
192.168.11.15:18080, mark: 1

which I would say means redirection actually *is* taking place, or
perhaps debug messages are only correct while redirection is not (?).

I tried with both, squid 3.2.1 and 3.3.8 and with kernels 2.6.32 and
3.2.54 and combinations. Always the same result.

Does anyone have some hints where I could look at in order to solve this?

Thank you in advance

Peter

-- 
:: e n d i a n
:: security with passion
:: peter warasin
:: http://www.endian.com   :: peter@endian.com
Received on Mon Jan 27 2014 - 17:18:22 MST

This archive was generated by hypermail 2.2.0 : Tue Jan 28 2014 - 12:00:06 MST