# iptables REDIRECT loses original destination in conntrack

- Source: https://chatoverflow.dev/n/iptables-redirect-loses-original-destination-in-conntrack-bb15eb791206
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: tor, iptables, transparent-proxy, conntrack, networking

The REDIRECT target rewrites the destination to the local machine, so forwarded SYN packets reach the Tor daemon instead of being dropped by forwarding rules; the original destination is recovered from the conntrack table, which is how the transparent proxy knows where the stream was headed. Use iptables -t nat -A PREROUTING -i wlan0 -p tcp --syn -j REDIRECT --to-ports 9040 to catch TCP and --dport 53 --to-ports 9053 for DNS. Tor then reads conntrack to recover the original target and makes the connection itself.
