Skip to content

Instantly share code, notes, and snippets.

@yanaga
Created February 25, 2012 19:07
Show Gist options
  • Save yanaga/1910125 to your computer and use it in GitHub Desktop.
Save yanaga/1910125 to your computer and use it in GitHub Desktop.
iptables redirection from port 80 to port 8080
sudo iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
sudo iptables -t nat -A OUTPUT -d 127.0.0.1/32 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
sudo iptables-save | sudo tee /etc/iptables.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment