Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am struggling with the TPROXY rule on mangle table, I configured this rules:

iptables -t mangle -I PREROUTING 1 -m layer7 --l7dir /etc/l7-protocols --l7proto http -p tcp --dport 80  -j TPROXY --on-port 1035 --tproxy-mark 0xffff
ip rule add fwmark 0xffff lookup 100
ip route add local dev lo table 100

The http pattern reg expr contains this really simple gerexp:


In this way all should match with that.

I wrote a program which open a sock_raw and print all received packets, I tested it and it's works, I am sure about that. What I see is that I cannot see the redirection caused by the TPROXY rule and in fact it redirect nothing, I think.

Have you any suggestion ?Maybe I misunderstand some iptable or l7filter rule and my problem is really simple.

Thanks a lot in advance! Pietro.

share|improve this question

TPROXT target require that one port is listen at the requested TCP port, after a deep debug (which included some printk!!), tried with :

nc -l -p 1035 

Packets is redirected, without is dropped.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.