Skip to content

Instantly share code, notes, and snippets.

@mikehelland
Last active August 21, 2020 16:52
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 mikehelland/75d81c778b7babdaa0cdb184f0fd02af to your computer and use it in GitHub Desktop.
Save mikehelland/75d81c778b7babdaa0cdb184f0fd02af to your computer and use it in GitHub Desktop.
node port forwarding
# don't do this until you've got certbot run, otherwise it won't validate
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8081
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
sudo apt install iptables-persistent
# if you need to remove the port forwarding for certbot, these commands list and delete the routes
# sudo iptables -t nat -L --line-numbers
# sudo iptables -t nat -D PREROUTING 2
sudo ufw allow 8081/tcp
sudo ufw allow 8080/tcp
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment