vagrant port forwarding

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

vagrant port forwarding

kiran kumar
Hi,

I am looking for a way to forwarding host port to VM i.e accessing a host port inside VM using vagrant.
config.vm.forward_port option is doing opposite of my requirement.

Can any one help me with this configuration ?


Regards
Kiran

--
 
 
Reply | Threaded
Open this post in threaded view
|

Re: vagrant port forwarding

Nicholas Robinson-Wall

I am looking for a way to forwarding host port to VM i.e accessing a host port inside VM using vagrant.
config.vm.forward_port option is doing opposite of my requirement.

No port forwarding is necessary for this, as the guest can always contact the host at 10.0.2.2 via the NAT interface. You can also reach it via the hostonly network at .1. So if you defined a hostonly address of '192.168.30.10' that would be 192.168.30.1.

Similarly you can contact the host via the bridged network by just using your host's real IP address.

-Nick

--