Centos virtual machine bridge mode can not connect to the external network solution

Problem Description

The requirement is to build a virtual machine cluster as a server on one machine. The specific scenario is to use VMware Workstation software on a win machine to create 3 virtual machines, and the operating system of the virtual machines is Centos7.6.

At the beginning, the network connection mode was selected as NAT mode. At this time, the virtual machine can connect to the external network, and the host machine can also ping each other, but other physical machines in the LAN cannot ping the virtual machine, that is, the virtual machine cannot be used as a server at this time. use.

Therefore, the network connection mode was changed to bridge mode, and a fixed ip address was set in consideration of the requirement of remote login. At this time, the virtual machine and the host machine can ping each other, and another physical machine in the same LAN can also ping each other. The virtual machine can be pinged successfully (the firewall of the host machine needs to be turned off), but the virtual machine cannot access the external network , which leads to the inability to execute many commands that require the network.

failed attempt

After this problem occurred, I began to consult the information. The following two solutions are the most common, but neither worked.

  • In VMware's virtual network editor, first "restore default settings", and then adjust the network card in bridge mode from "automatic" to the network card connected to the host machine and the external network.
  • Set "VMware Bridge Protocol". emmm, I didn't find where to set it.

final solution

The final solution is to use the method in the article that the virtual machine uses a bridge to access the network, ping can ping each other, but there is no way to access, the reason is that the port is not open, and the network configuration file of the virtual machine is set and restarted. After that, I switched the network card in bridge mode back to "automatic", and I can still access the external network, which means that it is not the problem here.

Guess you like

Origin blog.csdn.net/CloudInSky1/article/details/126894086