Sunday, August 9, 2009

iptables forward local port 80 to 8080

This is about how to forward local port 80 to 8080, or any other port,
which is useful when you are runing some test server with no root
privilege, while the client can still connect to the standard www port.

iptables -t nat -A OUTPUT -d 127.0.0.1 -p tcp --dport 80 -j REDIRECT --to-port 8080

No comments: