Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Forward port 80 to 8080 on EC2 instance.
sudo iptables -t nat -L
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8000
@unimonkiez
Copy link

unimonkiez commented Jul 27, 2020

To remove

sudo iptables -t nat -D PREROUTING 1

@Edweis
Copy link

Edweis commented Jan 13, 2021

I think you mean

sudo iptables -t nat -L
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080 # 8080 -> 8080

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment