VMware三種網絡配置方式

 

VMware是很受歡迎的虛擬機,在咱們平時的工做中須要常常用到,此文簡單總結了平時使用的三種網絡配置方式,具體的原理沒有去深究。網絡

虛擬機系統安裝的是Linux系統。post

首先,咱們在本機上查看全部網絡配置鏈接,使用命令:ipconfig命令行

  1. C:\Documents and Settings\user>ipconfig
  2. Windows IP Configuration
  3. Ethernet adapter VMware Network Adapter VMnet8:
  4. Connection-specific DNS Suffix . :
  5. IP Address. . . . . . . . . . . . : 192.168.74.1
  6. Subnet Mask . . . . . . . . . . . : 255.255.255.0
  7. Default Gateway . . . . . . . . . :
  8. Ethernet adapter VMware Network Adapter VMnet1:
  9. Connection-specific DNS Suffix . :
  10. IP Address. . . . . . . . . . . . : 192.168.2.1
  11. Subnet Mask . . . . . . . . . . . : 255.255.255.0
  12. Default Gateway . . . . . . . . . :
  13. Ethernet adapter 無線網絡鏈接:
  14. Connection-specific DNS Suffix . :
  15. IP Address. . . . . . . . . . . . : 192.168.1.209
  16. Subnet Mask . . . . . . . . . . . : 255.255.255.0
  17. Default Gateway . . . . . . . . . : 192.168.1.1
  18. Ethernet adapter 本地鏈接:
  19. Media State . . . . . . . . . . . : Media disconnected
  20. Ethernet adapter VirtualBox Host-Only Network:
  21. Connection-specific DNS Suffix . :
  22. IP Address. . . . . . . . . . . . : 192.168.154.1
  23. Subnet Mask . . . . . . . . . . . : 255.255.255.0
  24. Default Gateway . . . . . . . . . :
  25. C:\Documents and Settings\user>
上面內容中,咱們能夠看到本地鏈接及其它虛擬鏈接,其中VMware Network Adapter VMnet八、VMware Network Adapter VMnet1和本地鏈接是咱們在各類模式下要使用的不一樣鏈接網絡配置。

本地鏈接:是本機用Bridge方式與虛擬機交互時使用的主機網卡;rest

VMware Network Adapter VMnet1:是本機用Host-Only方式與虛擬機交互時使用的虛擬網卡;blog

VMware Network Adapter VMnet8:是本機用NAT方式與虛擬機交互時使用的虛擬網卡;ip

接下來是試驗結論:ci

一、Bridge模式:虛擬機

Bridge模式使用的網卡是:本地鏈接,及物理網卡 
設置方法: 
a.在命令行使用ipconfig命令,獲取本地鏈接的網絡IP地址,如上爲:172.16.2.41; 
b.設置虛擬機的IP地址與本地鏈接的IP地址在同一網段,如172.16.2.241;it

c.使用service network restart命令重啓網絡配置;io

d.使用ping 命令檢查網絡是否暢通,如:ping 172.16.2.41。

二、Host-Only模式:

Host-Only模式使用的網卡是:VMware Network Adapter VMnet1 
設置方法: 
a.在命令行使用ipconfig命令,獲取主機上VMware Network Adapter VMnet1的網絡IP地址,如上爲:192.168.2.1; 
b.設置虛擬機的IP地址與VMware Network Adapter VMnet1的IP地址在同一網段,如192.168.2.241;

c.使用service network restart命令重啓網絡配置;

d.使用ping 命令檢查網絡是否暢通,如:ping 192.168.2.1。

三、NAT模式:

NAT模式使用的網卡是:VMware Network Adapter VMnet8 
設置方法: 
a.在命令行使用ipconfig命令,獲取主機上VMware Network Adapter VMnet8的網絡IP地址,如上爲:192.168.74.1; 
b.設置虛擬機的IP地址與VMware Network Adapter VMnet8的IP地址在同一網段,如192.168.74.241;

c.使用service network restart命令重啓網絡配置;

d.使用ping 命令檢查網絡是否暢通,如:ping 192.168.74.1。

相關文章
相關標籤/搜索