VMWare network adapter and interpretation provided (the NAT, bridging, host only)

1 Introduction

A virtual machine for developers no stranger, he can create a wide variety of virtual machine for us. We can use a computer with Windows operating system to learn Linux system, you can also experience the Apple operating system. Of course, we also borrowed set of virtual machines can build a small cluster. Although the Internet has to say VMWare memory for large, but can stop us using his resolve.

This time, we mainly introduce three commonly used network adapters provide the main mode of VMWare, namely NAT, bridging, host-only. Well, then one by one we will explain the role of these configurations and network adapters.

2. Only host mode (Host-only)

2.1  Host-Only mode concept

Host-Only mode is actually NAT mode removes the virtual NAT device and then use VMware Network Adapter VMnet1 virtual card to connect VMnet1 virtual switch to communicate with the virtual machine. It is called a host-only mode, that is, the virtual machine can only communicate with the host, can not connect to the Internet, you can not access the LAN and visited. He and NAT mode as a standalone virtual machine network card, generic name for the VMware Virtual Ethernet Adapter for VMnet1

2.2 setting method

2.2.1 setting virtual network editor can set the start and end of the range of DHCP.

2.2.2 virtual machine is set to Host-Only mode

2.3 usage scenarios

Host-Only mode is for security reasons, Host-Only mode virtual machines and the external network spaced so that the virtual machine as an independent system, communicate with each other only with the host. So, if a virtual machine is running relatively non-confidential information may consider using this adapter mode.

3. Bridge Mode

3.1 bridge mode concept

桥接模式就是将主机网卡与虚拟机虚拟的网卡利用虚拟网桥进行通信。在桥接的作用下,类似于把物理主机虚拟为一个交换机,所有桥接设置的虚拟机连接到这个交换机的一个接口上,物理主机也同样插在这个交换机当中,所以所有桥接下的网卡与网卡都是交换模式的,相互可以访问而不干扰。在桥接模式下,虚拟机ip地址需要与主机在同一个网段,如果需要联网,则网关与DNS需要与主机网卡一致。

3.2 配置方式

3.3 应用场景

3.3.1 如果是局域网都要访问虚拟机,可以考虑使用这种网络适配器模式。

3.3.2 局域网、宿主机和虚拟机的Mac地址是不能重复的,否则会导致不能正常上网。

4 NAT模式

4.1 NAT模式概念

NAT模式借助虚拟NAT设备和虚拟DHCP服务器,使得虚拟机可以联网。在NAT模式中,主机网卡直接与虚拟NAT设备相连,然后虚拟NAT设备与虚拟DHCP服务器一起连接在虚拟交换机VMnet8上,这样就实现了虚拟机联网。

4.2 NAT设置方式

4.2.1 设置虚拟网络编辑器

在这里,我们设置子网ip为192.168.10.0,NAT的网关IP为192.168.10.1,所以这个NAT的虚拟机网卡网段为192.168.10。

4.2.2 更改宿主机适配器设置

这里需要注意的是,ip应该新分配一个,但是不能和默认网关重复,默认网关和DNS设置设置成和虚拟网络编辑器中的网关一致。

4.2.3 设置虚拟机网络适配器

4.3 使用场景

4.3.1 当虚拟机需要连接局域网或者外网,但是局域网其他电脑不能访问虚拟机,此种情况可以考虑此适配器模式。

4.3.2 虚拟机的Mac地址除了和宿主机不能一直,可以和其他局域网的MAC一样。

4.3.3 当同一局域网虚拟设备很大的时候可以考虑此种模式。

发布了72 篇原创文章 · 获赞 24 · 访问量 9万+

Guess you like

Origin blog.csdn.net/oYinHeZhiGuang/article/details/104662423