I'm trying to configure port redirection from port 80 to 8080 on server with both IPv4 and IPv6 support. The OS is Ubuntu 14.04 with the 3.2* series kernel. It is a production server, so I don't want to upgrade kernel.
I'm using UFW as a firewall software and I'd like to stick with it also for IPv6. Currently, I handle port redirecting for IPv4 in /etc/ufw/before.rules with this:
*nat :PREROUTING ACCEPT [0:0] -A PREROUTING -p tcp --dport -80 -j REDIRECT --to-port 8080
This works perfectly for IPv4, but if I add this into before6.rules, UFW won't start and complain about a problem running ufw-init.
From searchnig the web including this site, I've found out that ip6tables doesn't support NAT and REDIRECT in kernels older then 3.8. I've also came across a solution using ip6table's TPROXY, but I haven't been able to find the right syntax for the before6.rules for ufw and, more importantly, I believe that TPROXY is not the same as REDIRECT (I'm not as good in iptables, so I may be wrong, feel free to correct this statement).
So my final question is:
Is it possible to redirect port 80 to 8080 via UFW for IPv6 connections on box with 3.2 kernel? And if ufw doesn't support this, is it possible to accomplish it via ip6tables only?
Thank you in advance!