-
-
Save juniorctl/0cfe809ec663ef2f05464cb22f977416 to your computer and use it in GitHub Desktop.
Forward Vagrant forwarded ports to standard ports using iptables
This file contains hidden or 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 service 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 | |
| sudo iptables -L -n -t nat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment