Last active
October 4, 2016 03:24
-
-
Save resourcemode/7c7a9de1bb2eda6d9fbcc2343a8725a3 to your computer and use it in GitHub Desktop.
http port forwarding to access VM vagrant hosted applications
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
Access your local vagrantbox from your remote or other machine within the network. | |
Get the host machine IP and add it in the /etc/hosts of your server/computer that will access the vagrantbox. | |
E.g 10.9.6.91 yourdomain.dev | |
First step is to create this file 'http' in /etc/pf.anchors and add the data below: | |
rdr-anchor "forwarding" | |
load anchor "forwarding" from "/etc/pf.anchors/http" | |
Next step is to create this file 'pf-http.conf' in /etc and add the data below: | |
rdr-anchor "forwarding" | |
load anchor "forwarding" from "/etc/pf.anchors/http" | |
Next step is to execute this on your terminal sudo pfctl -ef /etc/pf-http.conf | |
Edit your Port Forwarding in vagrantbox VM | |
Add the info below: | |
Name: tcp5901 | |
Protocol: TCP | |
Host Port: 5901 | |
Guest Port: 5901 | |
Name: tcp8080 | |
Protocol: TCP | |
Host Port: 8080 | |
Guest Port: 80 | |
Name:5672 | |
Protocol: TCP | |
Host Port: 5672 | |
Guest Port: 5672 | |
Done... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment