Non-core business, only in brief
After the virtual machine is installed, the need for network configuration.
The virtual machine has three kinds of network connections:
Host Only Mode Host-only: only support between the virtual machine and the host communication can not be connected to the external network
Bridge mode bridge: the external network may be connected
Network Address Translation NAT modes: the external network may be connected
NAT
Network Address Translation, network address translate
Configurable Logic
After the virtual machine is created successfully, it automatically creates a virtual network adapter in the host VMnet8;
Virtual machine also comes with a card eth0;
Eth0 of the VMnet8 IP and IP to be in the same network segment, corresponding to a switch inserted in the same;
The VMnet8 IP and IP host need not be in the same network segment;
VMnet8 perform NAT between the network interface and the host;
Data sent through the virtual machine virtual network adapter, and then the NAT, and then sent from the host interface;
The setting
1. VMnet8 Right-click and set the IP subnet mask, local connection with the host
2. There are two ways the virtual machine network
Dynamic IP
IP addresses will change
Simple to set up, set in a virtual machine menu, without modifying the eth0
Then right-VM -> Settings -> Network adapters -> NAT mode, then you can view the IP.
Static IP
Set a fixed IP
Modification is eth0, what do not control the virtual network is set up inside the editor
BOOTPROTO="static" IPADDR=192.168.10.11 NETMASK=255.255.255.0 GATEWAY=172.16.95.254 DNS1=172.16.8.40 DNS2=172.16.8.41
Then restart the network services
service network restart
此时可查看 IP
桥接
参考资料:
https://blog.csdn.net/qdliukai/article/details/80004394 理论性较强
https://www.cnblogs.com/lyangfighting/p/9518726.html#top 非常完整的实操