NAT mode
Mode introduction
Network Adapter: NAT
Virtual network settings:
vmnet0: bridge mode -- auto connect
vmnet1: host only
vmnet8: NAT mode -- NAT mode
NAT (Network Address Translation) mode: generally vmnet8, if your network IP resources are in short supply, but you want your virtual machine to be able to connect to the Internet, then NAT mode is the best choice. > NAT mode uses virtual NAT devices and virtual DHCP servers to enable virtual machines to network. The virtual machine in NAT mode accesses the Internet and exchanges data through the host machine (physical computer).
bridge mode
Mode introduction
Network Adapter: Bridged
Virtual network settings:
vmnet0: bridge mode -- select bridge network card (wired, wireless network card)
vmnet1: host only
vmnet8: NAT mode
Bridge (bridge mode): Generally, the network card displays vmnet0, and the bridge mode is to communicate with the host network card and the virtual network card of the virtual machine through a virtual network bridge. Under the function of bridging, it is similar to virtualizing the physical host as a switch. All the virtual machines set up by bridging are connected to an interface of this switch, and the physical host is also plugged into this switch, so all network cards and network cards under the bridge are connected. It is in exchange mode and can be accessed without interfering with each other. In bridge mode, the IP address of the virtual machine needs to be on the same network segment as the host. If networking is required, the gateway and DNS need to be consistent with the host network card.
host only mode
Mode introduction
Network Adapter: Host Only
Virtual network settings:
vmnet0: bridge mode -- select bridge network card (wired, wireless network card)
vmnet1: host only
vmnet8: NAT mode
Host-only (host only mode), the Host-Only mode is actually the NAT mode removes the virtual NAT device, and then uses the VMware Network Adapter VMnet1 virtual network card to connect the VMnet1 virtual switch to communicate with the virtual machine, the Host-Only mode connects the virtual machine with the virtual machine The separation of the external network makes the virtual machine an independent system that only communicates with the host.
host configuration
# Edit the network configuration file
vim /etc/network/interfaces
# Add the following content
car it
iface lo inet loopback
car eth0
iface eth0 inet dhcp # Configure the eth0 network card to automatically obtain an IP address
# restart network service
service networking restart
# View IP address
ifconfig