vmware5 网络设置

vmware 虚拟机和外面的网络通信有三种方式:

1、桥接方式(bridge ): 
默认使用vmnet0,如果使用这种模式,虚拟机的IP和主机的IP在同一网段,其他设置相同;这种方式可以同时访问主机以外的机器 。有的同学在安装了虚拟机后,在启动时,会报

“The network bridge on device VMnet0 is not running.The virtual machine will not
be able to communicate with the host or with other machines on your network.
Virtual device Ethernet0 will start disconnected" 类似错。

那是因为没有将 VMware Bridge Protocol 服务,方法是在 在物理网卡上安装之,具体步骤为:

打开物理网卡本地连接->属性
安装->(选中服务)添加->从磁盘安装->浏览->
X:\Program Files\VMware\VMware Server目录下选 netbridge.inf
X代表你安装vmware软件的安装所在盘.
安装完成后双击 VMware Bridge Protocl 写入0 就可以了。
然后重启。

2、nat方式:

默认使用vmnet8
将虚拟机设置成使用dhcp方式上网,windows下选择"自动获取ip",linux下开启dhcp服务即可
也可以手动设置:
ip设置与vmnet8同网段,gateway设置成vmnet8的gateway(/etc/vmware/vmnet8/nat/nat.conf)中可以查到vmnet8的gateway,通常是xxx.xxx.xxx.2。
netmask,broadcast设置与vmnet8相同,dns设置与主机相同。
例如 vmnet8 ip:172.16.249.1 gw :172.16.249.2
虚拟机设置: ip :172.16.249.100  gw: 172.16.249.2

扫描二维码关注公众号,回复: 1388085 查看本文章

3.host-only :
默认使用vmnet1

将虚拟机ip设置与vmnet1同网段,gateway设置成vmnet1的ip,其余设置与vmnet1相同,dns设置与主机相同
例如 vmnet1 ip :172.16.245.1
虚拟机设置: ip :172.16.245.100 gateway :172.16.245.1
这样虚拟机仅仅可以访问主机 通信,但是 虚拟机不能访问互联网

猜你喜欢

转载自host.iteye.com/blog/934814