What's the equivalent of this iptables rule in ip6tables:

-A OUTPUT -s -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080

I tried this and it doesn't seem to work:

-A OUTPUT -s ::1/128 -p tcp -m tcp --dport 80 -j REDIRECT --on-port 8080
  • I don't believe output loopback traffic traverses the output table normally, but I could be wrong about that. – Falcon Momot Aug 28 '13 at 9:16
  • 1
    What kernel version? ip6tables supports nat for kernels >= 3.7 – Laurentiu Roescu Aug 28 '13 at 9:26
  • Kernel 2.6.32. Yes I now read that nat is supported form 3.7 and above. Thanks! – BlackBeret Aug 28 '13 at 11:27

The REDIRECT target is only available for IPv4.

To redirect IPv6 traffic, you can use TPROXY (in very recent versions of netfilter), or use a userland port forwarding utility such as xinetd.


I believe you should use ip6tables instead of iptables when handling IPv6 traffic; I have not tried though if the standard iptables command can handle IPv6.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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