-
-
Save sergeiwaigant/cb32702776667cf8d51bafbece26b9a1 to your computer and use it in GitHub Desktop.
Redirect 443,80 to 8443,8080 on ubuntu with persistence
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
#allows localhost traffic to connect to 443 from 8443 | |
sudo iptables -t nat -A OUTPUT -o lo -p tcp --dport 443 -j REDIRECT --to-port 8443 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment