Chinaunix首页 | 论坛 | 博客
  • 博客访问: 146838
  • 博文数量: 52
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 490
  • 用 户 组: 普通用户
  • 注册时间: 2007-11-05 12:05
文章分类

全部博文(52)

文章存档

2013年(1)

2010年(3)

2009年(6)

2008年(25)

2007年(17)

我的朋友

分类: 系统运维

2007-11-10 21:32:24

VMware Network Configuration

VM provides 3 types of networking BRIGE, NAT, and Host-Only.

NAT, and Host-Only have its own virtual hardware, VM-net for NAT, VM-net1 for Host-Only.

Below section describe the basic features and setting of three types networking in VMware.

 

Bridged networking connects a virtual machine to a network using the host computer's Ethernet adapter. It play a same role as host on networking environment, which means it should has a unique identity on network, usually it is IP address. On the other word one of your virtual machine occupy one IP address on network.

It is easy to set the Bridged networking.

1.        Choose network type as Bridge, right click the windows menu of virtual machine—Setting—Hardware—Ethernet—Bridge—OK to complete.

2.        If you have a DHCP server in your host network, your virtual machine can work already, if you have not, set the IP in the same subnet as the host IP address is okay.

 

NAT gives a virtual machine access to network resources using the host computer's IP address. It is easy to understand that the NAT networking in VM if you have an experience of NAT networking configuration. The subnet in the virtual machine is different of host’s subnet. Then the NAT map was done by the virtual hardware VM-net8. Take an example for explaining the setting in VM virtual machine.

Assumption: Host machine is windows, virtual machine is Linux

Choose network type as NAT, right click the windows menu of virtual machine—Setting—Hardware—Ethernet—NAT—OK to complete.

Make sure NAT DHCP(one of services follow with VM installation) is running on the host system, set the virtual machine acquire IP address via DHCP sever. From here the virtual machine is okay to comunication with external network or host machine.

 

Some problem always happen, NAT DHCP service not running on the host system or you have ever changed the IP address of the VM-net8 on host system network connection. Now you may check follows bellows steps.

1.        On Windows, From start--programs—VMware---Manage virtual networks—NAT—eidt, Record the gateway IP address. Here is 192.168.5.2,

2.        In the cmd, use ipconfig /all to check the IP address of VM-net8 is same subnet 192.168.5.0/24 or not, if not, correct it manually.

3.        Set one of IP in subnet 192.168.5.0/24 such as 192.168.5.100/24.

Ifconfig eth0 192.168.5.100 netmask 255.255.255.0

4.        Set the gateway of virtual machine to 192.168.5.2 by command

5.        Route add default gw 192.168.5.2

 

Key in NAT setting,

1, Subnet of VMnet8, virtual machine IP address and NAT subnet setting in “Manage virtual networks” should be the same

2, gateway of virtual machine should be point to NAT gateway in “Manage virtual networks”

Host-only networking creates a network that is completely contained within the host computer. It is almost same from the effect of network when using NAT and Host-Only. While Host-only use another virtual hardware VM-net1 and its isolate network from host network.

 

1.        Choose network type as Host-only, right click the windows menu of virtual machine—Setting—Hardware—Ethernet—Host-only—OK to complete.

2.        Normally the VM-net1 is visible in the windows network connections and assigned an IP by Host-Only DHCP, here it is 192.168.3.1/24

3.        Set the same subnet IP address 192.168.3.0/24 in the virtual machine 192.168.3.100

Ifconfig eth0 192.168.3.100 netmask 255.255.255.0

4.        Add default gateway 192.168.3.1, IP address of VM-net1.

5.        By this point the virtual machine can only communication with host and failed for external network, If you hope your virtual machine can access internet you should make your host play role as router, in the windows system, the easiest way is share the local connection to VM-net1,note that  local connection can access internet itself. right click the local connection—advanced—share internet connection—choose VM-net1—Ok to complete.

 

Key in Host-Only network setting

1.        Virtual machine IP and VM-net1 in w should be the same

2.        Gateway of virtual machine should point to IP of VM-net1

3.        Host local connection was shared, which means host play role of router for virtual machine.

 

 

 

阅读(2377) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~