1

I used vagrant to setup a virtual machine and then on that virtual machine, I set up a webserver with ip I config like below:

  config.vm.network "private_network", ip: "192.168.33.12"
  config.vm.network "public_network", ip: "192.168.33.13"
  config.vm.network :public_network

And I connected successfully to my web server on my computer via this IP 192.168.33.12 but then I tried to use other computer on the same network, I couldn't connect to it (192.168.33.13 neither)

1 Answers1

0

It's because your virtual machine missed default gateway for your network. Try adding your LAN default gateway to the virtual machine.

 ssh -p 2222 vagrant@localhost

 sudo route add default gw 192.168.33.254

where 192.168.33.254 has to be change with correct default gateway.

gile
  • 5,580
  • 1
  • 25
  • 31