摘自资料:VMware网卡选项分析.zip

很多朋友都曾问到关于Guest和Host互联,其实这并不是一件困难的事情,只要能够理解VMware的网络模型即可,今天结合着我的虚拟机,来详细介绍一下VMware的3种网络结构

在说到VMware的网络模型之前,先说一下VMware的几个虚拟设备:

■       VMnet0:这是VMware用于虚拟桥接网络下的虚拟交换机;

■       VMnet1:这是VMware用于虚拟Host-Only网络下的虚拟交换机;

■       VMnet8:这是VMware用于虚拟NAT网络下的虚拟交换机;

■       VMware Network Adapter VMnet1:这是Host用于与Host-Only虚拟网络进行通信的虚拟网卡;

■       VMware Network Adapter VMnet8:这是Host用于与NAT虚拟网络进行通信的虚拟网卡;

0 概述

一、桥接网络

拓扑图

Host的物理网卡和Guest的网卡在VMnet0交换机上通过虚拟网桥进行桥接,这也就是说,你的物理网卡和你的Guest的虚拟网卡(注:这个虚拟网卡不等于VMware Network Adapter VMnet1或者VMware Network Adapter VMnet8)处于同等地位,此时的Guest就好像你的Host主机所在的一个网段所在的另外一台机器。

看一下VMware中对于Bridged网络的定义:

Bridged networking connects a virtual machine to a network using the host computer's Ethernet adapter.

Bridged networking is set up automatically if you select Use bridged networking in the New Virtual Machine Wizard or if you select the Typical setup path. This selection is available on a Linux host only if you enable the bridged networking option when you install GSX Server.

If your host computer is on an Ethernet network, bridged networking is often the easiest way to give your virtual machine access to that network. On a Windows host, you can use bridged networking to connect to either a wired or a wireless network. On a Linux host, you can use bridged networking to connect to a wired network.

If you use bridged networking, your virtual machine needs to have its own identity on the network. For example, on a TCP/IP network, the virtual machine needs its own IP address. Your network administrator can tell you whether IP addresses are available for your virtual machine and what networking settings you should use in the guest operating system. Generally, your guest operating system may acquire an IP address and other network details automatically from a DHCP server, or you may need to set the IP address and other details manually in the guest operating system.

If you use bridged networking, the virtual machine is a full participant in the network. It has access to other machines on the network and can be contacted by other machines on the network as if it were a physical computer on the network.

Be aware that if the host computer is set up to boot multiple operating systems and you run one or more of them in virtual machines, you need to configure each operating system with a unique network address. People who boot multiple operating systems often assign all systems the same address, since they assume only one operating system will run at a time. If you use one or more of the operating systems in a virtual machine, this assumption is no longer true.

If you make some other selection in the New Virtual Machine Wizard and later decide you want to use bridged networking, you can make that change in the virtual machine settings editor (VM > Settings). For details, see Changing the Networking Configuration.

二、NAT网络    

拓扑图

在NAT网络中,会使用到VMnet8虚拟交换机,Host上的VMware Network Adapter VMnet8虚拟网卡被连接到VMnet8交换机上,来与Guest进行通信,但是VMware Network Adapter VMnet8虚拟网卡仅仅是用于和VMnet8网段通信用的,它并不为VMnet8网段提供路由功能,处于虚拟NAT网络下的Guest是使用虚拟的NAT服务器连接的Internet的。

参看VMware中关于NAT网络的描述:

NAT gives a virtual machine access to network resources using the host computer's IP address.

A network address translation connection is set up automatically if you follow the Custom path in the New Virtual Machine Wizard and select Use network address translation.

If you want to connect to the Internet or other TCP/IP network using the host computer's dial-up networking or broadband connection and you are not able to give your virtual machine an IP address on the external network, NAT is often the easiest way to give your virtual machine access to that network.

NAT also allows you to connect to a TCP/IP network using a Token Ring adapter on the host computer.

If you use NAT, your virtual machine does not have its own IP address on the external network. Instead, a separate private network is set up on the host computer. Your virtual machine gets an address on that network from the VMware virtual DHCP server. The VMware NAT device passes network data between one or more virtual machines and the external network. It identifies incoming data packets intended for each virtual machine and sends them to the correct destination.

If you select NAT, the virtual machine can use many standard TCP/IP protocols to connect to other machines on the external network. For example, you can use HTTP to browse Web sites, FTP to transfer files and Telnet to log on to other computers. In the default configuration, computers on the external network cannot initiate connections to the virtual machine. That means, for example, that the default configuration does not let you use the virtual machine as a Web server to send Web pages to computers on the external network.

If you make some other selection in the New Virtual Machine Wizard and later decide you want to use NAT, you can make that change in the virtual machine settings editor (VM > Settings). For details, see Changing the Networking Configuration.

For a more thorough discussion of NAT, see Understanding NAT

三、Host-Only网络

拓扑图

在Host-Only网络中,Host-Only网络被用来设计成一个与外界隔绝的网络,其实Host-Only网络和NAT网络非常相似,唯一不同的地方就是在Host-Only网络中,没有用到NAT服务,没有服务器为VMnet1做路由,它当然就没有办法访问Internet啦,可是如果我的Host要和Guest通信呢?怎么办?对了!当然就要用到VMware Network Adapter VMnet1这块虚拟网卡了。

可以看看VMware中关于Host-Only网络的描述:

Host-only networking creates a network that is completely contained within the host computer.

A host-only network is set up automatically if you select Use Host-Only Networking in the New Virtual Machine Wizard. On Linux hosts, this selection is available only if you enabled the host-only networking option when you installed GSX Server.

Host-only networking provides a network connection between the virtual machine and the host computer, using a virtual Ethernet adapter that is visible to the host operating system. This approach can be useful if you need to set up an isolated virtual network.

If you use host-only networking, your virtual machine and the host virtual adapter are connected to a private TCP/IP network. Addresses on this network are provided by the VMware DHCP server.

If you make some other selection in the New Virtual Machine Wizard and later decide you want to use host-only networking, you can make that change in the virtual machine settings editor (VM > Settings). For details, see Changing the Networking Configuration.

Routing and Connection Sharing

If you install the proper routing or proxy software on your host computer, you can establish a connection between the host virtual Ethernet adapter and a physical network adapter on the host computer. This allows you, for example, to connect the virtual machine to a Token Ring or other non-Ethernet network.

On a Windows 2000 or Windows Server 2003 host computer, you can use host-only networking in combination with the Internet connection sharing feature in Windows to allow a virtual machine to use the host's dial-up networking adapter or other connection to the Internet. See your Windows documentation for details on configuring Internet connection sharing.

VMware网络选项分析的更多相关文章

  1. PYTHON黑帽编程1.5 使用WIRESHARK练习网络协议分析

    Python黑帽编程1.5  使用Wireshark练习网络协议分析 1.5.0.1  本系列教程说明 本系列教程,采用的大纲母本为<Understanding Network Hacks At ...

  2. linux 网络协议分析---3

    本章节主要介绍linxu网络模型.以及常用的网络协议分析以太网协议.IP协议.TCP协议.UDP协议 一.网络模型 TCP/IP分层模型的四个协议层分别完成以下的功能: 第一层 网络接口层 网络接口层 ...

  3. VMWare网络链接三种方式

    本文转自:http://www.cnblogs.com/xiaochaohuashengmi/archive/2011/03/15/1985084.html VMware虚拟机上网络连接(networ ...

  4. libevent 网络IO分析

    libevent 网络IO分析 Table of Contents 1. 简介 2. 简单使用与入门 2.1. 定时器-timeout 超时回调 2.2. 信号事件 2.3. 读取 socket 3. ...

  5. 网络流量分析——NPMD关注IT运维、识别宕机和运行不佳进行性能优化。智能化分析是关键-主动发现业务运行异常。科来做APT相关的安全分析

    科来 做流量分析,同时也做了一些安全分析(偏APT)——参考其官网:http://www.colasoft.com.cn/cases-and-application/network-security- ...

  6. Android Do not keep activities选项分析

    Android Do not keep activities选项分析 Developer Options里面有一项: Do not keep activities -> 不保留Activitie ...

  7. 《Unix/Linux网络日志分析与流量监控》获2015年度最受读者喜爱的IT图书奖

    <Unix/Linux网络日志分析与流量监控>获2015年度最受读者喜爱的IT图书奖.刊登在<中华读书报>( 2015年01月28日 19 版) 我的2015年新作刊登在< ...

  8. TFTP网络协议分析---15

    TFTP网络协议分析 周学伟 文档说明:所有函数都依托与两个出口,发送和接收. 1:作为发送时,要完成基于TFTP协议下的文件传输,但前提是知道木的PC机的MAC地址,因为当发送TFTP请求包时必须提 ...

  9. x264 编码器选项分析 (x264 Codec Strong and Weak Points) 1

    文章文件夹: x264 编码器选项分析 (x264 Codec Strong and Weak Points) 1 x264 编码器选项分析 (x264 Codec Strong and Weak P ...

随机推荐

  1. C语言中怎么求动态数组大小

    先来个简单的样例 int a[] = {1,2,3}; int arr_len = 0; arr_len = sizeof(a)/sizeof(int); 解释:sizeof() keyword是求出 ...

  2. Bluetooth in Android 4.2 and 4.3(三):Enable Bluetooth

    以下是基于Android 4.2代码,对Bluetooth BR/EDR Enable process的分析.BluetoothAdapter类代表的是local device Bluetooth a ...

  3. Copy-On-Write技术 (摘录)

    Copy-On-Write技术     Copy-On-Write是写时才copy的意思,有延迟操作的意思在里面.比如往磁盘写数据,先写到的是内存里面,只有文件close或flush时才真正写到磁盘. ...

  4. 使用HttpURLConnection实现在android客户端和服务器之间传递对象

    一般情况下,客户端和服务端的数据交互都是使用json和XML,相比于XML,json更加轻量级,并且省流量,但是,无论我们用json还是用xml,都需要我们先将数据封装成json字符串或者是一个xml ...

  5. php之数据类型自动转换

    1:概述 ---php是一种弱类型的语言,它可以根据运行环境的变化而自动进行数据类型的转换 1.1转换成布尔类型的原则 以下值都将转换成布尔类型中的false: A.布尔类型的false; B.空字符 ...

  6. js内置函数的使用

    arguments对象是一个参数对象,可以访问有操作和无操作的参数,能够获得每个参数的内容,参数的个数,例如:arguments[0];获第一个参数,arguments.length;获得参数的个数, ...

  7. java 用eclipse j2ee写的servlet 程序,WEB-INF下的配置文件web.xml在哪啊?谢谢!

    我用的版本是tomcat7.0,在webcontent\web-inf里只有一个空文件夹lib,写完servlet 类程序,就可以运行了,我想知道自动生成的配置文件在哪里?或者说从哪里能够看出来配置内 ...

  8. 如何使用SC命令添加删除服务

    1.如何删除服务 cmd然后再输入 sc delete "服务名称" 后,回车,双引号必须为英文符号. 2.添加服务 sc create ServiceName binPath= ...

  9. 如何理解systemstate

    什么是systemstate一个systemstate是由在实例中调用生成systemstats时由每一个进程的进程状态组成.而每一个进程状态是由每一个进程所持有的当前对象所对应的详细对象状态信息组成 ...

  10. 最新的 cocoapods 安装与使用(2016.11)

    cocoapods简介: cocoapods 是iOS的类库管理工具,可以让开发者很方便集成各种第三方库,而不用去网站上一个个下载,再一个个文件夹的拖进项目中,还得添加相关的系统依赖库.只需要安装好c ...