简单区分Vmware的三种网络连接模式(bridged、NAT、host-only)
2016-02-19 14:30
666 查看
from https://www.slyar.com/blog/vmware-bridged-nat-hostonly.html
Vmware在安装时默认安装了两块虚拟网卡,VMnet1和VMnet8,另外还有VMnet0。这些虚拟网卡的配置都是由Vmware虚拟机自动生成的,一般来说不需要用户自行设置。
Vmware提供了三种网络连接模式,分别为
1、bridged(桥接模式):默认使用VMnet0,不提供DHCP服务
![](https://www.slyar.com/blog/wp-content/uploads/2009/07/vmware-network-bridged.png)
在桥接模式下,虚拟机和宿主计算机处于同等地位,虚拟机就像是一台真实主机一样存在于局域网中。因此在桥接模式下,我们就要像对待其他真实计算机一样为其配置IP、网关、子网掩码等等。
当我们可以自由分配局域网IP时,使用桥接模式就可以虚拟出一台真实存在的主机。
2、NAT(网络地址转换模式):默认使用VMnet8,提供DHCP服务
![](https://www.slyar.com/blog/wp-content/uploads/2009/07/vmware-network-nat.png)
在NAT模式下,宿主计算机相当于一台开启了DHCP功能的路由器,而虚拟机则是内网中的一台真实主机,通过路由器(宿主计算机)DHCP动态获得网络参数。因此在NAT模式下,虚拟机可以访问外部网络,反之则不行,因为虚拟机属于内网。
使用NAT模式的方便之处在于,我们不需要做任何网络设置,只要宿主计算机可以连接到外部网络,虚拟机也可以。
NAT模式通常也是大学校园网Vmware最普遍采用的连接模式,因为我们一般只能拥有一个外部IP。很显然,在这种情况下,非常适合使用NAT模式。
3、Host-only(主机模式):默认使用VMnet1,提供DHCP服务
![](https://www.slyar.com/blog/wp-content/uploads/2009/07/vmware-network-hostonly.png)
在Host-only模式下,相当于虚拟机通过双绞线和宿主计算机直连,而宿主计算机不提供任何路由服务。因此在Host-only模式下,虚拟机可以和宿主计算机互相访问,但是虚拟机无法访问外部网络。
当你想组成一个与物理网络相隔离的虚拟网络时,无疑非常适合使用Host-only模式。
Host-only only permits network operations with the Host OS.
NAT mode will mask all network activity as if it came from your Host OS, although the VM can access external resources.
Bridged mode replicates another node on the physical network and your VM will receive it's own IP address if DHCP is enabled in the network.
Host-Only: The VM will be assigned one IP, but it's only accessible by the box VM is running on. No other computers can access it.
NAT: Just like your home network with a wireless router, the VM will be assigned in a separate subnet, like
Bridged: Your VM will be in the same network as your host, if your host IP is
Vmware在安装时默认安装了两块虚拟网卡,VMnet1和VMnet8,另外还有VMnet0。这些虚拟网卡的配置都是由Vmware虚拟机自动生成的,一般来说不需要用户自行设置。
Vmware提供了三种网络连接模式,分别为
1、bridged(桥接模式):默认使用VMnet0,不提供DHCP服务
![](https://www.slyar.com/blog/wp-content/uploads/2009/07/vmware-network-bridged.png)
在桥接模式下,虚拟机和宿主计算机处于同等地位,虚拟机就像是一台真实主机一样存在于局域网中。因此在桥接模式下,我们就要像对待其他真实计算机一样为其配置IP、网关、子网掩码等等。
当我们可以自由分配局域网IP时,使用桥接模式就可以虚拟出一台真实存在的主机。
2、NAT(网络地址转换模式):默认使用VMnet8,提供DHCP服务
![](https://www.slyar.com/blog/wp-content/uploads/2009/07/vmware-network-nat.png)
在NAT模式下,宿主计算机相当于一台开启了DHCP功能的路由器,而虚拟机则是内网中的一台真实主机,通过路由器(宿主计算机)DHCP动态获得网络参数。因此在NAT模式下,虚拟机可以访问外部网络,反之则不行,因为虚拟机属于内网。
使用NAT模式的方便之处在于,我们不需要做任何网络设置,只要宿主计算机可以连接到外部网络,虚拟机也可以。
NAT模式通常也是大学校园网Vmware最普遍采用的连接模式,因为我们一般只能拥有一个外部IP。很显然,在这种情况下,非常适合使用NAT模式。
3、Host-only(主机模式):默认使用VMnet1,提供DHCP服务
![](https://www.slyar.com/blog/wp-content/uploads/2009/07/vmware-network-hostonly.png)
在Host-only模式下,相当于虚拟机通过双绞线和宿主计算机直连,而宿主计算机不提供任何路由服务。因此在Host-only模式下,虚拟机可以和宿主计算机互相访问,但是虚拟机无法访问外部网络。
当你想组成一个与物理网络相隔离的虚拟网络时,无疑非常适合使用Host-only模式。
Host-only only permits network operations with the Host OS.
NAT mode will mask all network activity as if it came from your Host OS, although the VM can access external resources.
Bridged mode replicates another node on the physical network and your VM will receive it's own IP address if DHCP is enabled in the network.
Host-Only: The VM will be assigned one IP, but it's only accessible by the box VM is running on. No other computers can access it.
NAT: Just like your home network with a wireless router, the VM will be assigned in a separate subnet, like
192.168.6.1is your host computer, and VM is
192.168.6.3, then your VM can access outside network like your host, but no outside access to your VM directly, it's protected.
Bridged: Your VM will be in the same network as your host, if your host IP is
172.16.120.45then your VM will be like
172.16.120.50. It can be accessed by all computers in your host network.
相关文章推荐
- 网络爬虫
- iOS开发之网络编程--4、NSURLSessionDataTask实现文件下载(离线断点续传下载) <进度值显示优化>
- Tomcat配置https协议详解(菜鸟的不二选择)
- HttpClient post parameters to Https(避免ssl错误)
- 在使用富文本编辑器kindeditor时,使用图片上传的功能报不允许访问路径***的HTTP谓词POST
- Ubuntu 14.04 手动编译安装apache httpd 服务器
- HTTP请求工具类
- TortoiseGit HTTPS方式保存密码最简单的方法
- 分享 C++命名空间的解释 http://blog.chinaunix.net/uid-26874138-id-3215266.html
- 【网络】iOS上传下载
- 知名网络安全公司
- 开源流媒体服务器EasyDarwin支持epoll网络模型,大大提升流媒体服务器网络并发性能
- 基于openssl的https服务配置
- HttpClient 教程
- HttpRequest请求接口
- 用Wireshark简单分析HTTP通信
- 游戏中的网络同步机制——LOCKSTEP
- 推荐大家去博客园看我的博客:http://www.cnblogs.com/bj-xy/点击随笔分类,Python基础学习
- HTTP与HTTPS握手的那些事
- Universal-Image-Loader,android-Volley,Picasso、Fresco和Glide五大Android开源组件加载网络图片的优缺点比较