Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 0.0.0.0/0 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

1 Answer 1

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

 
discard

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.