<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.16.1">
</HEAD>
<BODY>
I have already tried to load <FONT COLOR="#000000">the tproxy table with the tproxy_any parameter</FONT> as you describe because I have seen this in the archive but it didn't solve the problem<BR>
<BR>
<BR>
On mer, 2008-02-20 at 11:45 +0100, Laszlo Attila Toth wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hello,</FONT>

<FONT COLOR="#000000">nantenaina Tianarivo &#237;rta:</FONT>
<FONT COLOR="#000000">&gt; Hello everybody,</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; I am tring to make tproxy work with our squid but I have a problem with </FONT>
<FONT COLOR="#000000">&gt; the iptable to redirect traffic to squid now.</FONT>
<FONT COLOR="#000000">&gt; I have compiled a linux kernel 2.6.22.18 patched with </FONT>
<FONT COLOR="#000000">&gt; tproxy-4.0.3-2.6.22. and iptable 1.3.8. For squid, i'am using Version </FONT>
<FONT COLOR="#000000">&gt; 2.6.STABLE5.</FONT>
<FONT COLOR="#000000">&gt; I think my kernel is well compiled because I see all the tproxy module </FONT>
<FONT COLOR="#000000">&gt; loaded :</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; proxy:/usr/src/linux# lsmod | grep -i proxy</FONT>
<FONT COLOR="#000000">&gt; xt_tproxy               1984  0</FONT>
<FONT COLOR="#000000">&gt; xt_TPROXY               1984  1</FONT>
<FONT COLOR="#000000">&gt; iptable_tproxy          6468  2 xt_TPROXY</FONT>
<FONT COLOR="#000000">&gt; ip_tables              12420  2 iptable_filter,iptable_tproxy</FONT>
<FONT COLOR="#000000">&gt; x_tables               14564  5 </FONT>
<FONT COLOR="#000000">&gt; ipt_LOG,xt_tcpudp,xt_tproxy,xt_TPROXY,ip_tables</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; My iptables rules is like this :</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; iptables -t tproxy -A PREROUTING -p tcp -m tcp  -i gre1 --dport 80 -j LOG</FONT>
<FONT COLOR="#000000">&gt; iptables -t tproxy -A PREROUTING -p tcp -m tcp  -i gre1 --dport 80 -j </FONT>
<FONT COLOR="#000000">&gt; TPROXY --on-port 80</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; when I check it with tcpdump, I see traffic for http port on the gre1 </FONT>
<FONT COLOR="#000000">&gt; interface</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; proxy:/usr/src/linux# tcpdump -n -i gre1</FONT>
<FONT COLOR="#000000">&gt; tcpdump: WARNING: arptype 778 not supported by libpcap - falling back to </FONT>
<FONT COLOR="#000000">&gt; cooked socket</FONT>
<FONT COLOR="#000000">&gt; tcpdump: verbose output suppressed, use -v or -vv for full protocol decode</FONT>
<FONT COLOR="#000000">&gt; listening on gre1, link-type LINUX_SLL (Linux cooked), capture size 96 bytes</FONT>
<FONT COLOR="#000000">&gt; 13:10:51.437856 IP 62.56.240.17.3200 &gt; 84.16.80.10.80: . ack 3247536657 </FONT>
<FONT COLOR="#000000">&gt; win 2264 &lt;nop,nop,timestamp 24199037 1582152&gt;</FONT>
<FONT COLOR="#000000">&gt; 13:10:51.492666 IP 62.56.240.17.3199 &gt; 84.16.80.10.80: . ack 3204902926 </FONT>
<FONT COLOR="#000000">&gt; win 3604 &lt;nop,nop,timestamp 24199051 1582156&gt;</FONT>
<FONT COLOR="#000000">&gt; 13:10:51.523999 IP 62.56.240.17.3198 &gt; 84.16.80.10.80: . ack 3189913679 </FONT>
<FONT COLOR="#000000">&gt; win 16022 &lt;nop,nop,timestamp 24199058 1582173&gt;</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; when I check it on access.log of my squid, my requests are actually sent </FONT>
<FONT COLOR="#000000">&gt; to the squid.</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; But it is not the client ip which is sent to the Internet but the squid </FONT>
<FONT COLOR="#000000">&gt; box IP.</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; when I issue iptables-save -c command to check if there are traffic that </FONT>
<FONT COLOR="#000000">&gt; enter my iptables rule, the counter so zero traffic.</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; proxy:/usr/src/linux# iptables-save -t tproxy -c</FONT>
<FONT COLOR="#000000">&gt; # Generated by iptables-save v1.3.8 on Wed Feb 20 13:07:45 2008</FONT>
<FONT COLOR="#000000">&gt; *tproxy</FONT>
<FONT COLOR="#000000">&gt; :PREROUTING ACCEPT [128:11992]</FONT>
<FONT COLOR="#000000">&gt; [0:0] -A PREROUTING -i gre1 -p tcp -m tcp --dport 80 -j LOG</FONT>
<FONT COLOR="#000000">&gt; [0:0] -A PREROUTING -i gre1 -p tcp -m tcp --dport 80 -j TPROXY --on-port </FONT>
<FONT COLOR="#000000">&gt; 80 --on-ip 0.0.0.0</FONT>
<FONT COLOR="#000000">&gt; COMMIT</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; even the LOG don't tell me anything about traffic in gre1 interfaces.</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; what I see in the log is this error that appear from time to time:</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; Feb 20 13:08:31 proxy squid[2353]: parseHttpRequest: NF </FONT>
<FONT COLOR="#000000">&gt; getsockopt(SO_ORIGINAL_DST) failed: (92) Protocol not available</FONT>
<FONT COLOR="#000000">&gt; Feb 20 13:08:31 proxy squid[2353]: tproxy </FONT>
<FONT COLOR="#000000">&gt; ip=62.56.240.17,0x11f0383e,port=0 ERROR ASSIGN</FONT>

<FONT COLOR="#000000">It seems you want to use the squid with tproxy patch for tproxyv2 but </FONT>
<FONT COLOR="#000000">you use tproxyv4. They are incompatible. The iptables commands are the </FONT>
<FONT COLOR="#000000">same but the tproxy4 kernel code is different.</FONT>

<FONT COLOR="#000000">When the squid uses tproxy-specific commands, there should be only one </FONT>
<FONT COLOR="#000000">clall: set the socket option IP_FREEBIND, _or_ load the tproxy table </FONT>
<FONT COLOR="#000000">with the tproxy_any parameter:</FONT>

<FONT COLOR="#000000">   modprobe iptable_tproxy tproxy_any=1</FONT>

</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>