The virtual environment is configured with vagrant under windows. ping can be done under windows, but it cannot be opened in the browser.

  question, ruby

RT: Virtual environment is configured with vagrant under windows. ping can be done under windows, but it cannot be opened in browser.
I didn’t do any configuration, just specified the next ip
图片描述

Some people in the post said that the network card under win was not directed at vagrant ipv4, and I changed it too.
图片描述

After entering the rails project to start, we can see that the 3000 port can be accessed through links. Here my config database password has not changed, but we can see that the 3000 port can be accessed to the project.
图片描述

However, when accessing through ip address in the local area, it cannot be accessed. What is the situation?http://192.168.10.10:3000(ip is set in my vagrantfile)
Solve? Urgent, has been matched for a day. . .

To add, under win, it is possible to ping vagrant

clipboard.png
However, if this ip access is denied in vagrant, only 127.0.0.1: 3000 can be used.

clipboard.png

Rails can monitor 0.0.0.0: 3000, as shown below.

clipboard.png

Ip of virtual machine in local ipconfig
clipboard.png

Ifconfig of vague virtual machine

clipboard.png

Host and virtual machine are not on the same network segment. The host belongs to 192.168.66.0/24, while the virtual machine belongs to 192.168.10.0/24. In this way, the host cannot access the virtual machine.

Modify Vagrantfile and change the IP of the virtual machine to 192.168.66.2

node.vm.network "private_network", ip: "192.168.66.2"

Restart the virtual machine.

vagrant reload

Access on host:http://192.168.66.2:3000