Last active
May 7, 2016 07:08
-
-
Save Marko-M/2f72080ba103611fe819 to your computer and use it in GitHub Desktop.
Forward Vagrant forwarded ports to standard ports using iptables
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
#!/bin/bash | |
# Forward relevant Vagrant forwarded ports to standard ports using iptables (adjust 8080, 8443). | |
# To make persistent install and use "iptables-persistent" package. Just do a | |
# "sudo iptables-persistent save" and service will reload saved rules on each boot. | |
sudo iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 8080 | |
sudo iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 443 -j REDIRECT --to-ports 8443 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment