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
However, if this ip access is denied in vagrant, only 127.0.0.1: 3000 can be used.
Rails can monitor 0.0.0.0: 3000, as shown below.
Ip of virtual machine in local ipconfig
Ifconfig of vague virtual machine
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.
Access on host:http://192.168.66.2:3000