Win10 and the virtual machine can ping each other, but the web project in the virtual machine cannot be accessed under win

this is true. My computer is a win10 system. When vagrant is installed on my computer and LNMP environment is installed in vagrant, all related services start normally. both host and virtual machines can ping each other , but browsers in host computers sometimes cannot access web items in virtual machines. Sometimes I can access it, but after a few minutes, the browser is refreshed and I can"t access it again. The firewalls under my win and linux are turned off. My host ip is 192.168.1.107, so the ip set in my virtual machine is: 192.168.1.110
I know from my colleague that he has also encountered this situation, and his solution is as follows: typing the cmd command under win: arp-a appears as follows:

192.168.1.110 ip 08-00-27-e0-24-62

ifconfig::

HWaddr 08:00:27:e0:24:62
web

win192.168.1.110 ip
win:arp -d 192.168.1.110 iparp -a.

win10192.168.1.110

virtualbox

:

192.168.56.1

Jun.21,2022

the same IP address appears, but the MAC address is not the same. There must be an address in the local area network (possibly another device in the local area network) that has been sending a broadcast to the route, telling the route that I am 192.168.1.110.

reference solution:

  1. Virtual machine Nic turns off bridging and changes it to NAT translation mode
  2. Delete the virtual machine bridge network card, add a new network card again, so that the MAC address changes again, and then configure another static IP address in the virtual machine

you can turn off the firewall and try

Menu