Virtualbox提供了5种网络模式


1. Not attached //有网卡但无连接
2. Network Address Translation (NAT) 网络地址转换
3. Bridged networking 桥接网络
4. Internal networking 内部网络
5.Host-only networking 主机网络

1. Not attached

In this mode, VirtualBox reports to the guest that a network card is present, but that there is no connection -- as if no Ethernet cable was plugged into the card. This way it is possible to "pull" the virtual Ethernet cable and disrupt the connection, which can be useful to inform a guest operating system that no network connection is available and enforce a reconfiguration.

2. Network Address Translation (NAT)

If all you want is to browse the Web, download files and view e-mail inside the guest, then this default mode should be sufficient for you, and you can safely skip the rest of this section.
可以这样理解:Vhost访问网络的所有数据都是由主机提供的,vhost并不真实存在于网络中,主机与网络中的任何机器都不能查看和访问到Vhost的 存在。
虚拟机与主机关系:
只能单向访问,虚拟机可以通过网络访问到主机,主机无法通过网络访问到虚拟机。
虚拟机与网络中其他主机的关系:
只能单向访问,虚拟机可以访问到网络中其他主机,其他主机不能通过网络访问到虚拟机。
虚拟机与虚拟机之间的关系:

3.Bridged networking 桥接网络

This is for more advanced networking needs such as network simulations and running servers in a guest. When enabled, VirtualBox connects to one of your installed network cards and exchanges network packets directly, circumventing your host operating system's network stack.
可以这样理解,它是通过主机网卡,架设了一条桥,直接连入到网络中了。因此,它使得虚拟机能被分配到一个网络中独立的IP,所有网络功能完全和在网络中的真实机器一样。

4. Internal networking 内部网络

This can be used to create a different kind of software-based network which is visible to selected virtual machines, but not to applications running on the host or to the outside world.
虚拟机与外网完全断开,只实现虚拟机于虚拟机之间的内部网络模式。
虚拟机与主机关系:
不能相互访问,彼此不属于同一个网络,无法相互访问。
虚拟机与网络中其他主机关系:
不能相互访问,理由同上。
虚拟机与虚拟机关系:
可以相互访问.

5.Host-only networking 主机网络

This can be used to create a network containing the host and a set of virtual machines, without the need for the host's physical network interface. Instead, a virtual network interface (similar to a loopback interface) is created on the host, providing connectivity among virtual machines and the host.