NAT Network Configuration

Disclaimer: Respect bloggers original articles, please indicate the source. If wrong, correct me hope. Contact: [email protected] https://blog.csdn.net/Supreme_Sir/article/details/85201152

Problem Description:

In a development environment, as programmers, we often encounter connection problems with the virtual machine is created, in which the network configuration is an integral part of the process. Today I will be here on the record about issues related to VMware12 in network configuration.

About VMware network connection mode of

Usually when we install the VMware, VMware automatically creates two virtual NICs for us, a VMnet1 (Host mode only), a VMNet8 (NAT) mode, they were acting on different connection modes.

HostOnly (Host mode only)

As the name suggests, this mode can only be computer entities in communication with each host, which is a relatively closed network. Therefore, by default, use only the host mode with networking virtual machine can not connect to the Internet. (Installed on the host appropriate routing or proxy software, or by using Internet Connection Sharing feature on the host Windows system still allows the virtual machine to connect to the Internet or other networks).
This kind of connection to use for the entity host VMNet1 virtual network card.

NAT (network address translation mode)

NAT, Network Address Translation is an abbreviation, meaning the network address translation. When network connections using NAT mode, the VMware will create a separate private network (similar to the creation of a new LAN) for mutual communication between the host and the virtual machine on the physical machine. This is why we will often use a network connection, but this is my focus today. So since it is the key, did not chart says a **

NAT network configuration diagram

上图中,左边红色方框代表的是我们要创建的主机,其中的绿色方框代表的是虚拟主机中的虚拟网卡。右边黄色方框代表的是我们的实体主机,其中的蓝色方框代表的是我们在安装 VMware 软件时,其在我们实体主机中创建的名为 VMnet8 的虚拟网卡。上方黑色方框代表的是我们在使用 VMware 搭建 NAT 网络环境时需要创建的虚拟网关。正是由于这个虚拟网关的存在,才使得虚拟主机与实体主机实现了数据通信。因此,我们先从最重要的虚拟网关的创建方式开始说起:

  • 虚拟网关的创建与配置

虚拟网关的创建是在 VMware 软件中进行的。当我们打开软件后,在导航条上可以看到“编辑”选项,点击后选择“虚拟网络编辑器”,随后进入配置页面。如下图:

Virtual Network Editor

选择“更改设置”

Here Insert Picture Description

进入配置页面后(左半部分),选择名为 VMNet8 的连接模式后,在“VMNet信息”栏中选择“NAT模式”随后点击“NAT设置”,进入NAT设置界面(右半部分),在“网关IP”栏输入你想要的网关IP,点击“确定”即可。(注意:该网关IP中第三部分,即图中 32 部分,不可与实体主机网关IP中的第三部分相同)。第四步完成之后来到第五步,配置子网IP,该输入框中IP地址前三段必须与网关IP的前三段相同,且末尾值即第四段必须为 0。(子网掩码,默认 255.255.255.0 即可)最后,点击”确定“完成虚拟网关配置。

  • 实体主机中 VMnet8 虚拟网卡配置

配置及注意事项如图:

Configuration and Notes

  • 虚拟主机网络配置

如果虚拟主机为 Windows 系统,则配置方式和注意事项同上。若虚拟主机为 Linux 系统,则需根据 Linux 环境网络配置方式进行配置。(注意:虚拟主机IP地址不可与 VMNet8 中IP地址相同)

Bridge(桥接模式)

Bridge mode means that the virtual host entity through a network communication card host entity. This approach requires an IP address and physical host virtual host IP address in the same network segment. So the opportunity to occupy a virtual IP address on the LAN. Bridge mode network host is connected wired and wireless network adapter. If you want the virtual machine as a completely independent look at the computer, and allow it and the other end of the same network communication, then the bridge mode is usually the easiest way virtual machines access to the network.

Guess you like

Origin blog.csdn.net/Supreme_Sir/article/details/85201152