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

From: Eliezer Croitoru <eliezer_at_ngtech.co.il>
Date: Mon, 27 Jan 2014 22:17:58 +0200

Hey Peter,

Tproxy is working and pretty nice for many users.
You are probably missing couple rules in iptables and might not
understand fully tproxy effects.
I still doesn't understand the issue.

What OS are you using?
If you can tell me more about the system I might be able to understand
the issue.
Are these are the only iptables rules you are using?
What routing rules are you using?

The document:
http://wiki.squid-cache.org/Features/Tproxy4
is not up-to-date and the current linux kernels are supporting tproxy
out of the box.

If you can share the basic setup I would be able to help you a bit more.

Thanks,
Eliezer

On 27/01/14 19:18, Peter Warasin wrote:
> hi guys
>
>
> I configured a transparent proxy environment using TPROXY following the
> howto on the squid wikihttp://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
Received on Mon Jan 27 2014 - 20:23:16 MST

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