Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vagrant ping or curl from guest to host machine

I wonder how I can run the command, using the terminal, from my vagrant machine:

$ ping localhost:3000

or

$ curl http://localhost:3000

In host machine (OSX) I have a rails server running in localhost:3000, so I expect something to show in the rails log.

like image 797
Emba Moussa Avatar asked Jun 24 '15 22:06

Emba Moussa


1 Answers

When I run in the VM:

$ ip route show

In the output there is a line like:

default via 10.0.2.2 dev enp0s3 proto static metric 1024

That is the IP to ping from the guest:

curl http://10.0.2.2:3000

like image 148
Emba Moussa Avatar answered Sep 30 '22 15:09

Emba Moussa