There are two main types of network configurations on VMware: NAT and bridge mode. This article mainly introduces how the physical machine connects to the virtual machine in these two methods.
NAT
NAT (Network Address Translation, network address translation). When some hosts inside the private network have already been assigned local IP addresses, but now they want to communicate with hosts on the Internet, the NAT method can be used.
This method requires NAT software to be installed on the router that connects the private network to the Internet. A router with NAT software installed is called a NAT router, and it has at least one valid external global IP address. In this way, when all hosts using local addresses communicate with the outside world, their local addresses must be converted into global IP addresses on the NAT router in order to connect to the Internet.
②Virtual routing gateway/IP query and modification:
① Physical machine [WINDOWS] IP configuration
③ Virtual machine IP configuration [CentOS6.x]
Now that we can communicate, we can ping the virtual machine directly on the physical machine:
Related terms:
IP : address
NETMASK : subnet mask, 8-bit binary &, used to determine whether the machine is in the same network segment. Typically 255.255.255.0.
GATEWAY : The gateway address, usually the routing IP address.
DNS : resolves addresses for server domain names, which are used to convert domain names into IP addresses.
8.8.8.8 The domain name resolution server provided by google is generally useless in China. Generally, you can set the routing address provided by the operator, and it will automatically search.
bridge mode
The following is the mac demo interface
In this mode, the operating system virtualized by VMWare is like an independent host in the local area network, which can access any machine in the network.
In bridge mode, you need to manually configure the IP address and subnet mask for the virtual system, and it must be on the same network segment as the host machine, so that the virtual system can communicate with the host machine. At the same time, since this virtual system is an independent host system in the local area network, its TCP/IP configuration information can be manually configured to access the Internet through the gateway or router of the local area network.
① Physical machine mac configuration
First check the mac computer, its own computer uses wifi, the IP is as follows:
Then the gateway IP of wifi is 192.168.1.1. Then vmware uses bridging technology:
② Virtual machine configuration
Configure IP addresses, etc. .
restart network service
Check whether the mac is pinged
You can also try Ping the external network. After all, the wifi I use can connect to the external network, and the result is successful.
The bridged computer needs to be in the same network segment as the network management system, and at the same time, it cannot have any IP conflicts with other machines on the network segment.