A-A+

虚拟机软件Vmware中的三种网络模式

2015年12月13日 站长资讯 暂无评论

安装好 VMware workstation 后,在物理机的网络连接里面你可以看到多了两块网卡:

VMnet1 是虚拟机Host-only模式的网络接口

VMnet8 是虚拟机 NAT 模式的网络接口

1.桥接模式(Bridged)

桥接模式:桥接模式下,VMware虚拟出来的操作系统就像是局域网中的一台独立的主机,它可以访问虚拟机局域网内的任何一台机器。不过你需要多于一个的IP地址,并且需要手工为虚拟系统配置IP地址、子网掩码,而且还要和宿主机器处于同一个网段,这样虚拟系统才能和宿主机器以及和宿主机器在同一局域网、同一网段的机器进行通信。

下面为一个具体例子:

①虚拟机中编辑网络模式,选择桥接模式:

②修改IP地址,和宿主机的本地连接网卡的IP地址在同一个网段:

本地连接的IP设置: www.xiaoxiongboke.com/netcore

虚拟机的IP设置:

③网络拓扑图:

④测试:

在虚拟机中ping宿主机:

  1. C:\Documents and Settings\Administrator>ping 172.16.1.73  
  2. Pinging 172.16.1.73 with 32 bytes of data:  
  3. Reply from 172.16.1.73: bytes=32 time<1ms TTL=64  
  4. Reply from 172.16.1.73: bytes=32 time<1ms TTL=64  
  5. Reply from 172.16.1.73: bytes=32 time<1ms TTL=64  
  6. Reply from 172.16.1.73: bytes=32 time<1ms TTL=64  
  7. Ping statistics for 172.16.1.73:  
  8.     Packets: Sent = 4Received = 4Lost = 0 (0% loss),  
  9. Approximate round trip times in milli-seconds:  
  10.     Minimum = 0msMaximum = 0msAverage = 0ms  

在虚拟机中ping同一网段的PC:

  1. 10  
  2. C:\Documents and Settings\Administrator>ping 172.16.1.31  
  3. Pinging 172.16.1.31 with 32 bytes of data:  
  4. Reply from 172.16.1.31: bytes=32 time=2ms TTL=64  
  5. Reply from 172.16.1.31: bytes=32 time=1ms TTL=64  
  6. Reply from 172.16.1.31: bytes=32 time=1ms TTL=64  
  7. Reply from 172.16.1.31: bytes=32 time=1ms TTL=64  
  8. Ping statistics for 172.16.1.31:  
  9.     Packets: Sent = 4Received = 4Lost = 0 (0% loss),  
  10. Approximate round trip times in milli-seconds:  
  11.     Minimum = 1msMaximum = 2msAverage = 1ms  
标签:

给我留言