Depth understanding vmware virtual network

0x01: VMware Workstation
VMware Workstation is a very good virtual machine software, many enthusiasts with VMware, Workstation design environment for testing various implementations. VMware Workstation virtual network part, function is very powerful, but for beginners, slightly more complex.
0x02: vmware virtual network outlined
installed on the host VMware Workstation or VMware Server, when installed by default three virtual card, the name of which three virtual NICs were VMnet0, VMnet1, VMnet8, where the network properties VMnet0 is "physical NIC "network properties VMnet1 and VMnet8 as" virtual NIC. " By default, the virtual card is defined VMnet1 "host-only virtual networks", the definition of VMnet8 virtual network card is "NAT network", at the same time, the host physical network card is defined as "bridged network", the host physical network card can also be called VMnet0 .
The difference between the three network modes: 0x03

  • Bridge Mode
    If the virtual machine using the "bridging", i.e. VMnet0, the virtual machine corresponding to the host network computer, the virtual machine if VMnet0 selected (or bridged network), through the "virtual post VMnet0
    connected to the host switch." owned network.
  • Master mode only
    when the virtual machine using the selected virtual card VMnet1, which represents a virtual machine VMnet1 connected to the virtual switch. VMnet1, the official definition of "host-only network", the default network behavior, only a network connection to the host or other use VMnet1 virtual network adapter virtual machine. Use VMnet1 virtual network adapter virtual machine, other than the computer can not access the physical host.
  • NAT mode
    if the VMnet8 virtual machine, which is used nat embodiment, the host network through the virtual machine, one-way (from the virtual machine to the host, the external network) access networks outside the physical host, the network can not access a host other than use, VMnet8 virtual machine. But the premise is that the host must be able to access the Internet (or other computers on the network), if the host can not access the Internet, the configuration for the virtual machine VMnet8 virtual network card can not access the Internet.

Using the relationship between the same virtual NIC and a virtual machine host
by default, VMware Workstation virtual network topology shown in FIG.

  • vmnet0
    can be seen in the network topology diagram, if a virtual machine A01, A02, A03 VMnet0 use virtual switch, regardless of the host VMnet0 virtual network card, if the correct IP address, subnet mask and gateway, as long as the A01, A02 , A03 set the correct parameters IP address, subnet mask, gateway, you can access other computers (eg B) outside the host on the network, as well as other computers (for example, Z) on the Internet.

  • vmnet1
    In the figure, the virtual machine A11, A12, ~, virtual machines A03, is VMware Workstation (or VMware Server) to create virtual machines. VM A11, A12, A13 using VMnet1 (host network only) virtual network adapter, the network topology of FIG. 3-5, "corresponds to" connected to a virtual switch VMnet1; VM A81, A82 VMnet8 using virtual NIC (NAT Network , it is equivalent to a virtual switch connected to VMnet8); VM A01, A02, A03 VMnet0 using virtual NIC (network bridge, corresponding to the virtual switch connected to VMnet0). Physical host B, A represents the physical host belonging to one or more other computers within the same LAN. There's the "same local area network", that can be on the same subnet (VLAN) computer, the computer may be different subnets. Internet computer Z, other computers or servers on behalf of the Internet, may be one or more of the computer.

    在图中,虚拟机A11、A12、A13使用VMnet1虚拟网卡,表明连接到VMnet1虚拟交换机。在图中的网络拓扑中,虚拟机A11、A12、A13、物理主机A之间可以互相通讯。“可以互相通讯”,这句话表示,当A11、A12、A13、A都连接到VMnet1虚拟交换机时,这4台计算机可以互相通讯,但不一定能通讯。为什么呢?如果A11、A12、A13、A没有设置同一子网的IP地址,这是不能互相通讯(互相访问)的;或者虽然设置同一网段的地址,但A11、A12、A13、A有防火墙,禁止其他计算机访问,这时也是不能通讯的。只有当A11、A12、A13、A连接到同一个虚拟交换机,并且在网一网段(IP地址还不能冲突)、并且没有防火墙(或者有防火墙,但允许其他计算机访
    问)时,才有可能通讯。

  • vmnet8
    虚拟机A81、A82为物理机A上的连接到VMnet8虚拟交换机的虚拟机。则A81、A82可以访问A(双向互访),可以通过“虚拟路由器”单向访问虚拟机A01、A02、A03,并通过A单向访问A所属的网络上的其他计算机B,并可以单向访问Internet网络上的其他计算机Z。但A所属网络上的其他计算机及Internet网络上的其他计算机(默认情况下)不能访问A81、A82,所以说,这里的访问是“单向访问”。

    如果物理网络上的其他计算机(例如B、Z),想要访问A81、A82,则应该通过“VMnet0虚拟交换机”→“VMnet0虚拟网卡”→“虚拟路由器”→“VMnet8虚拟交换机”到A81、A82,但“虚拟路由器”默认配置,是禁止“外网”访问“内网”,在这里,VMnet0虚拟网卡及VMnet0虚拟交换机所属的网络,属性“外网”,而“VMnet8虚拟交换机”所属网络,属于内网。如果配置了这个“虚拟路由器”,例如,使用“端口映射”情况,

    如果物理网络上的其他计算机(例如B、Z),想要访问A81、A82,则应该通过“VMnet0虚拟交换机”→“VMnet0虚拟网卡”→“虚拟路由器”→“VMnet8虚拟交换机”到A81、A82,但“虚拟路由器”默认配置,是禁止“外网”访问“内网”,在这里,VMnet0虚拟网卡及VMnet0虚拟交换机所属的网络,属性“外网”,而“VMnet8虚拟交换机”所属网络,属于内网。如果配置了这个“虚拟路由器”,例如,使用“端口映射”情况,

使用同一种虚拟网卡的虚拟机与主机之间的关系
前面介绍了使用同一种虚拟网卡的虚拟机与主机之间的关系,那么,在同一个物理主机中,使用不同虚拟网卡的虚拟机,它们之间是什么关系呢?

  • 1 VMnet1默认不能访问VMnet8与VMnet0
    从图3-10中可以看到,连接到VMnet1的虚拟机(A11、A12、A13),与连接到VMnet8的虚拟机以及连接到VMnet0的虚拟机(A01、A02、A03),默认情况下,是不能互相访问的。如果它们之间要想互相访问,必须在物理主机A上,启用默认路由或者代理服务器功能,才可以互相(或者单向)访问。例如,物理主机可以安装Windows Server 2003(或Windows 2000 Server、Windows Server 2008),在该计算机上,启用“路由和远程访问”功能,并且将该计算机做成一个“路由器”,这时候,各虚拟机之间,可以互相访问。如果物理主机安装的是Windows 2000、XP等操作系统,可以启用“Internet连接共享功能”,让VMnet1单向访问VMnet8或VMnet0,反之亦然。例如,可以让
    VMnet8单向访问VMnet1等,这都是很容易的事情。

  • 2 VMnet8默认不能访问VMnet1
    VMnet8在默认情况下,不能访问VMnet1,可以通过虚拟路由器,单向访问VMnet0。如果VMnet8想要访问VMnet1,则像VMnet1访问VMnet8一样,在主机A上启用“路由器”或“Internet连接共享服务”。

  • 3 VMnet0默认不能访问VMnet8、VMnet1
    VMnet0 默认情况下,不能访问 VMnet1 与 VMnet8。如果要想访问 VMnet8,除了启用“路由器”或“Internet 连接共享外”,还可以通过配置“VMnet8”到“VMnet0”之间的“虚拟路由器”,进行端口映射的方式,访问 VMnet8 中的虚拟机。

希望大佬多多指正。。。
*******************************不积跬步无以至千里。*******************************

Guess you like

Origin www.cnblogs.com/liangxiyang/p/11443094.html