imq / linuximq

Pseudo-driver for the intermediate queue device.

Home Page:https://imq.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IMQ conflict with TPROXY

oknet opened this issue · comments

commented

The TPROXY does not work if I put an IMQ rule before the TPROXY rules.

iptables -t mangle -A PREROUTING -p tcp -m tcp --dport 80 -j IMQ --todev 0
iptables -t mangle -A PREROUTING -p tcp -m tcp --dport 80 -j TPROXY --on-ip 0.0.0.0 --on-port 8080 --tproxy-mark 1/1
iptables -t mangle -A PREROUTING -p tcp -m tcp --sport 80 -j MARK --set-xmark 0x1/0x1

What is the kernel version & OS ?
Can you describe what you want to accomplish?

commented

You are trying to set up IMQ+TPROXY on the same box as the proxy ATS ?

commented

Maybe you could try like this
iptables -t mangle -A PREROUTING -i eth0 -j IMQ --todev 0
iptables -t mangle -A POSTROUTING -o eth0 -j IMQ --todev 1
iptables -t mangle -A PREROUTING -i eth1 -j IMQ --todev 2
iptables -t mangle -A POSTOUTING -o eth1 -j IMQ --todev 3

and post some output of the rules (verbose) to see if packets are going to imq.

Hi MihaiC,

Thanks for your opinion, i tried but it still doesn't work, i guess there maybe some conflict between IMQ and TPROXY in their kernel implementation which we don't know before,  because nobody use them this way like us before ...

JZ.