Skip to content

Instantly share code, notes, and snippets.

@lourenzo
Created March 27, 2017 23:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lourenzo/50085ced1a5a9b40c3d9aa7387cf8975 to your computer and use it in GitHub Desktop.
Save lourenzo/50085ced1a5a9b40c3d9aa7387cf8975 to your computer and use it in GitHub Desktop.
Forward 80 to 8080 or any other port in Amazon Linux
  • You will need to do some things as 'root':
sudo su
  • The following command will redirect the port using iptables
/sbin/iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
  • Then save your settings
/sbin/iptables-save > /etc/sysconfig/iptables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment