Skip to content

Instantly share code, notes, and snippets.

@AbdulR3hman
Forked from m5m1th/localPorts.sh
Created April 16, 2017 23:19
Show Gist options
  • Save AbdulR3hman/af7c0406434dc7f8657c692d70a02d8a to your computer and use it in GitHub Desktop.
Save AbdulR3hman/af7c0406434dc7f8657c692d70a02d8a to your computer and use it in GitHub Desktop.
Redirect port 3080/3443 to 80/443 for local dev
#Requests from outside
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 3080
iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 3443
#Requests from localhost
iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 3080
iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 443 -j REDIRECT --to-ports 3443
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment