Skip to content

Instantly share code, notes, and snippets.

@juanramirezc2
Forked from danibram/iptables.sh
Created January 9, 2019 19:51
Show Gist options
  • Save juanramirezc2/1952be3c6146f34c023d5374e01eb1fb to your computer and use it in GitHub Desktop.
Save juanramirezc2/1952be3c6146f34c023d5374e01eb1fb to your computer and use it in GitHub Desktop.
Redirect 443,80 to 8443,8080 on ubuntu with persistence
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8443
sudo sh -c "iptables-save > /etc/iptables.rules"
sudo apt-get install iptables-persistent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment