I'm trying to redirect http traffic to port 8080 on the same machine and have the iptables rules below working.
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080
iptables -t nat -A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8080
I'm trying to figure out how to make this change permanent incase of a reboot of the system.
I'm using Ubuntu 11.10 server.