Open T0bi-Ethirbirge opened 1 month ago
Actually TPROXY works with OUTPUT chain: https://v2.hysteria.network/docs/advanced/TPROXY/
But, firstly, can you try turning of the firewall, if any? I learned that ufw's ufw-not-local
chain drops TPROXYied packets.
Also, it looks better to change
iptables -t mangle -A PREROUTING -s 172.17.0.2 -p udp -j MARK --set-mark 1 iptables -t mangle -A PREROUTING -m mark --mark 1 -p udp -j TPROXY --tproxy-mark 1 --on-port 12346
to
iptables -t mangle -A PREROUTING -s 172.17.0.2 -p udp -j TPROXY --tproxy-mark 1 --on-port 12346
because --set-mark and --tproxy-mark basically does the same thing.
I'm working on a transparent Shadowsocks server that relays all its traffic through Redsocks. The TCP part works without any problems but the UDP proved difficult. I know TProxy doesn't work on the output chain so I have tried to have a docker container to host the Shadowsocks server and relay the docker container traffic through Redsocks using TProxy. That works because the container traffic would go through the PREROUTING chain first.
IPTables commands:
Redocks Config
Nothing appears on the Redsocks' console, gets redirected to Redsocks, and the UDP traffic is blocked.
using the command
sudo iptables -t mangle -L PREROUTING -v -n
I can see that the IPTables command filters the UDP traffic but nothing gets sent or redirected.Any help would be appreciated. Thank you.